Layer7 API Management

Expand all | Collapse all

Fire and Forget Fragment

  • 1.  Fire and Forget Fragment

    Posted Jun 19, 2018 05:54 AM

    Is there any way we can write a "Fire and Forget" fragment in CA API Gateway ? Any OOTB assertion which can be helpful in this.

     

    I have to write notification logic, but I don't want to wait for a backed for a successful response for a notification delivery.

     

    Regards

    Ashutosh



  • 2.  Re: Fire and Forget Fragment

    Broadcom Employee
    Posted Jun 19, 2018 12:39 PM

    Ashutosh,

     

    Can you provide more context about the request and type of policy logic you are trying to setup?

     

    We have scheduled tasks that can run at specific intervals. If the notification is not dependent on the results of the backend they could run before the route, or concurrently with the route.

     

    Manage Scheduled Tasks - CA API Gateway - 9.3 - CA Technologies Documentation 

     

    Regards,

    Joe



  • 3.  Re: Fire and Forget Fragment

    Posted Jun 20, 2018 04:26 AM

    Hi Jow,

     

    Notification totally depends on the previous result. For example, on login scenario using user Id and Password, we want to notify the user if he/she has logged in via new device. So we internally check those things in our system and get the result. On the basis of the result, we want to notify the user, however we don’t want to wait for even milli second for that notification to be delivered. It should be just fire and forget.

     

    Let me know if this makes sense to you.

     

    Best Regards

     

    Ashutosh Singh



  • 4.  Re: Fire and Forget Fragment

    Broadcom Employee
    Posted Jun 19, 2018 02:43 PM

    Ashutosh,

     

    You may be able to leverage the the Accumulate Data in Memory Assertion to accomplish what you want.

     

    Accumulate Data in Memory Assertion - CA API Gateway - 9.3 - CA Technologies Documentation 



  • 5.  Re: Fire and Forget Fragment

    Broadcom Employee
    Posted Jul 02, 2018 08:14 PM

    Hi BARRY STERN,

    It will be interesting on how to use Accumulate Data in Memory Assertion here.

    Could you provide an example?

    As per my understanding, as soon as you use route via http(s) assertion, you have to wait for the response.

     

    Regards,

    mark



  • 6.  Re: Fire and Forget Fragment

    Posted Jun 21, 2018 03:46 PM

    try calling another service;

    service 1 gets whatever data and calls service 2

    service 2 returns template response with the send immediately box checked, then sends to wherever

    service 1 get back the template response and continues processing while service 2 does the notification



  • 7.  Re: Fire and Forget Fragment

    Posted Jun 21, 2018 11:39 PM

    Hi Ben,

     

    Thanks for your response.

     

    Let’s say service 2 has lots of routing and in the end we use return templated with checked Immediate return. Don’t you think those routing are still gona take time as it is before the return template in the service?



  • 8.  Re: Fire and Forget Fragment

    Posted Sep 12, 2018 12:25 PM

    yes, if you don't do what I suggested then it will not behave how I described.

    To make the first service continue you have to return the template response from the second service before you do the routing, that ordering is what allows the first to continue while the second is handling the routing.



  • 9.  Re: Fire and Forget Fragment

    Broadcom Employee
    Posted Jul 02, 2018 08:23 PM

    Dear ashutosh.singh ,

    HTTP call is basically a sync operation, as soon as you use route via http(s) to the backend, you have to wait for the response.

    To async the process, or to "fire and forget", using a queue (MQ, or JMS queue) in the middle could be a solution.

    The flows could be like this,

    flow1

    request -> your api: send notification, put request to queue, return without waiting response  

    flow2

    queue listener -> retrieve request, route to backend, process the response, etc.

     

    Regards,

    Mark



  • 10.  Re: Fire and Forget Fragment

    Broadcom Employee
    Posted Nov 10, 2018 12:10 AM

    Ashutosh,

     

    Did the responses provided address the question you had?

     

    Sincerely,

     

    Stephen Hughes

    CA Support



  • 11.  Re: Fire and Forget Fragment

    Posted Nov 12, 2018 03:34 AM

    Hey Stephen,

     

    Yes, responses were useful to me.

     

    Best Regards

     

    Ashutosh Singh