Layer 7 API Management

Expand all | Collapse all

What's the difference between having the Configure Message Streaming (Buffer immediately) and not having the assertion at all?

Jump to Best Answer
  • 1.  What's the difference between having the Configure Message Streaming (Buffer immediately) and not having the assertion at all?

    Posted 12-05-2018 11:19 AM

    Hi all,

     

    As part of our policies, we're logging the time it takes to buffer a service's response. We do this by adding Configure Message Streaming (Buffer immediately) assertion right after the HTTP routing, and then measuring it's latency. We've always assumed this would give us some insights on the network latency for getting the response's full payload. Questions:

     

    1. Is our assumption accurate? Or is there something else to consider as part of the Configure Message Streaming Assertion's latency?

    2. How does the policy behaves when using this assertion vs not using it at all?

     

    Thanks in advance,

    -Jaime



  • 2.  Re: What's the difference between having the Configure Message Streaming (Buffer immediately) and not having the assertion at all?

    Posted 12-05-2018 01:52 PM

    Jaime,

     

    The Configure Message Streaming assertion is mainly designed for inbound request to stream through as by default these payloads will be cached prior to be sent through. One caveat of this is that the policy should not analyze the payload just the headers of the request otherwise it will need to be cached. As for response messages, as long as no assertion after the HTTP Routing assertion analyzes the payload then it should be streamed back to the client. Same caveat applies for the inbound request message.

     

    Sincerely,

     

    Stephen Hughes

    Broadcom Support



  • 3.  Re: What's the difference between having the Configure Message Streaming (Buffer immediately) and not having the assertion at all?

    Posted 12-05-2018 01:57 PM

    Hey Stephen,

     

    Thanks for your reply. We're not using the assertion for streaming purposes, but to "measure" how long does a service response's payload reaches the gateway. We do this by using the Configure Message Streaming assertion, on Buffer Immediately mode. What we want to understand is how does the Buffer Immediately mode compares to not having the assertion at all, specially when dealing with big responses (~1MB).

     

    Thanks again,

    -Jaime



  • 4.  Re: What's the difference between having the Configure Message Streaming (Buffer immediately) and not having the assertion at all?

    Posted 12-05-2018 02:44 PM

    Jaime,

     

    A better way to capture the latency of how long the HTTP Routing assertion takes to complete is to use the latency context variables in policy. Assertion Latency - CA API Gateway - 9.3 - CA Technologies Documentation 

     

    Sincerely,

     

    Stephen Hughes

    Broadcom Support



  • 5.  Re: What's the difference between having the Configure Message Streaming (Buffer immediately) and not having the assertion at all?

    Posted 12-05-2018 02:56 PM

    Hey Stephen, thanks for replying again. 

    We actually do that as well, but we learned that measuring that latency only gives you the time it took the response header's to reach the gateway, not the full payload. Here's what we currently have:

     

     

    We noticed that the bigger the response, the higher the bufferingLatency, even when the targetLatency may remain fairly similar. Anyway, my 2 questions of the original post still stand

     

    Best,

    -Jaime



  • 6.  Re: What's the difference between having the Configure Message Streaming (Buffer immediately) and not having the assertion at all?

    Posted 12-05-2018 05:12 PM

    Jaime,

     

    If the message size is buffered on the gateway there is a setting called attachment.diskThreshold that will control when the request buffer will write to disk. Default is 1048576 bytes. Once you break this threshold it will write temporarily to disk so disk IO becomes a factor. This may account for the slow timings receiving the payload. What version of the gateway are you using?

     

    Sincerely,

     

    Stephen Hughes

    Broadcom Support



  • 7.  Re: What's the difference between having the Configure Message Streaming (Buffer immediately) and not having the assertion at all?

    Posted 12-05-2018 05:15 PM

    Stephen,

     

    We already updated that setting to a higher value, so, no writting to disk should be happening. Again, I'd just like to understand what does the Buffer Immediately option does compared to not using that assertion at all.

     

    Thanks,

    -Jaime



  • 8.  Re: What's the difference between having the Configure Message Streaming (Buffer immediately) and not having the assertion at all?

    Posted 12-05-2018 05:50 PM

    Jaime,

     

    The Buffer immediately just forces the policy to store the message in memory without using the standard logic to stream if nothing acts against the payload.

     

    Sincerely,

     

    Stephen Hughes

    Broadcom Support



  • 9.  Re: What's the difference between having the Configure Message Streaming (Buffer immediately) and not having the assertion at all?

    Posted 12-05-2018 05:53 PM

    Thanks Stephen! Now, what happends if I DO NOT use the Buffer Immediately AND the policy has logic that DOES act against the payload? Is the payload buffered at that point, the same way as if there was the Buffer Immediately?



  • 10.  Re: What's the difference between having the Configure Message Streaming (Buffer immediately) and not having the assertion at all?
    Best Answer

    Posted 12-05-2018 06:44 PM

    Jaime,

     

    If you were to put in an audit detail or set a context variable with the variable ${response.mainpart} then it will act in the same manner as buffer immediately.

     

    Sincerely,

     

    Stephen Hughes

    Broadcom Support



  • 11.  Re: What's the difference between having the Configure Message Streaming (Buffer immediately) and not having the assertion at all?

    Posted 12-06-2018 02:34 PM

    Thanks, Stephen, this is what I was looking for!