Layer7 API Management

  • 1.  Undefined Error When Dealing with Large Message

    Broadcom Employee
    Posted Feb 21, 2018 10:30 AM
      |   view attached

    I Published a Web API in the Gateway (REST interface) which has a back-end routing to a SOAP service. This SOAP service returns a large XML message as a response which is close to 90 MB. Once the GW policy receives the response, It will perform certain transformations and run a loop to extract separate elements from the large XML and build a template JSON response to be sent to the requester. This final json content is first set using a context variable as a string and is then referenced within a "Return Template to Requestor" assertion.

     

    Now, when I try to hit the GW service, it is getting a response from the SOAP back-end as expected and does all the looping and transformations of the response as expected and also sets the final context variable with the full json content. Just when the "Return Template Response to Requestor" assertion is being executed, the GW throws an error as "Undefined (-1)". All these are captured through audit events and through Service debugger. I am completely not sure what is causing this error.

     

    In audit event viewer, If I see the "Request" tab, it says "Unable to get Request XML: Stream Time Out". The request was in fact empty since it was a GET call from the client. The "Response" tab is empty.

     

    If someone else has also encountered such issue while dealing with large messages, Please let me know what might be causing such an issue as this is stopping the customer to go live in Production.

     

    PS: I tried the same service with a small XML response around 10 KB and it returned the response without any issue. Hence, there's no problem with the policy logic and it seems to be an issue associated with the size of the response message that the GW is trying to process. I have the xml max bytes cluster property set to 0.

     

    If you can pin point me to any KB or any cluster property or provide me with any custom assertion or any workaround solution to mitigate this, it will be greatly helpful.

     

    Attachments: Screenshots of Policy Snippet & Audit Viewer logs.

    Attachment(s)

    docx
    GW-Error-Undefined.docx   99 KB 1 version


  • 2.  Re: Undefined Error When Dealing with Large Message
    Best Answer

    Broadcom Employee
    Posted Feb 22, 2018 03:20 PM

    Karthik,

     

    I know you mentioned you set the xml bytes to 0, but if you follow the below article, it gets into a little more detail and a few other properties you can play around with:

     

    API gateway: Optimizing for Large Files and Messag - CA Knowledge 

     

    Let us know if the above article helps.

     

    -Alec Daniello

    APIM Support