Topic
  • 7 replies
  • Latest Post - ‏2017-01-25T18:37:50Z by lancelotlinc
1EME_Tridip_Sarma
1EME_Tridip_Sarma
8 Posts

Pinned topic HTTPAsyncRequest Node timeout

‏2017-01-25T06:09:40Z |

Hi All,

   We are using HTTPAsyncRequest and HTTPAsyncResponse nodes in our project. The requirement is to set the timeout (the time that it waits for the server/service to respond) dynamically on runtime from the config. However, when I check the Local environment overrides on the HTTPAsyncRequest node the timeout property is not applicable.We also tried setting SET OutputLocalEnvironment.Destination.HTTP.Timeout = 10; but doesn't work. This is a shocker for us as the same is present in HTTPRequest and SOAPAsyncRequest nodes. 

   Please advice on this. Also alternate options, if any. Thanks,

  • lancelotlinc
    lancelotlinc
    485 Posts

    Re: HTTPAsyncRequest Node timeout

    ‏2017-01-25T13:32:24Z  

    Whats the point of setting the timeout dynamically ? To say it differently, its pointless to set the timeout dynamically. Your requirement is not valid.

     

    The whole idea behind Async operations is that it does not depend on any waiting interval and that passage of time is not relevant to the operation being conducted.

     

    Please re-examine your requirement.

     

  • 1EME_Tridip_Sarma
    1EME_Tridip_Sarma
    8 Posts

    Re: HTTPAsyncRequest Node timeout

    ‏2017-01-25T13:56:07Z  

    Whats the point of setting the timeout dynamically ? To say it differently, its pointless to set the timeout dynamically. Your requirement is not valid.

     

    The whole idea behind Async operations is that it does not depend on any waiting interval and that passage of time is not relevant to the operation being conducted.

     

    Please re-examine your requirement.

     

    Thanks for the response.

      The requirement is valid. This is not a fire and forget pattern , but where the system expects a response (and in our case within a specified time).

     Its just that we had used this async solution to implement this as we didn't want the new request threads to wait for the other to complete in a synchronous pattern. My point is we can set the timeout in the properties section during implementation and it works fine, but why not dynamically at rum time. Also the same is possible using the SOAPAsyncRequest nodes. 

    Please advice.

     

  • lancelotlinc
    lancelotlinc
    485 Posts

    Re: HTTPAsyncRequest Node timeout

    ‏2017-01-25T14:54:00Z  

    Thanks for the response.

      The requirement is valid. This is not a fire and forget pattern , but where the system expects a response (and in our case within a specified time).

     Its just that we had used this async solution to implement this as we didn't want the new request threads to wait for the other to complete in a synchronous pattern. My point is we can set the timeout in the properties section during implementation and it works fine, but why not dynamically at rum time. Also the same is possible using the SOAPAsyncRequest nodes. 

    Please advice.

     

    We implemented same using local cache object to track correlation Ids effectively replacing the Http with MQ. That way, we could process many more simultaneous requests than active threads. We've successfully tested 3,000 concurrent transactions (HttpInput -> MQOuput  |  MQInput -> HttpReply).

  • 1EME_Tridip_Sarma
    1EME_Tridip_Sarma
    8 Posts

    Re: HTTPAsyncRequest Node timeout

    ‏2017-01-25T15:20:11Z  

    We implemented same using local cache object to track correlation Ids effectively replacing the Http with MQ. That way, we could process many more simultaneous requests than active threads. We've successfully tested 3,000 concurrent transactions (HttpInput -> MQOuput  |  MQInput -> HttpReply).

    I believe you implemented this pattern to exposes a service to the client (IIB is the service in this case).

    In our case we need to call an external service from the IIB message flow (IIB is the client in this case.)
     

  • lancelotlinc
    lancelotlinc
    485 Posts

    Re: HTTPAsyncRequest Node timeout

    ‏2017-01-25T15:22:18Z  

    I believe you implemented this pattern to exposes a service to the client (IIB is the service in this case).

    In our case we need to call an external service from the IIB message flow (IIB is the client in this case.)
     

    The same pattern holds true.

     

    Use queues and local cache to  create the asynchronous part of the interaction so you are not tied to the number of max threads.

     

  • 1EME_Tridip_Sarma
    1EME_Tridip_Sarma
    8 Posts

    Re: HTTPAsyncRequest Node timeout

    ‏2017-01-25T16:08:07Z  

    The same pattern holds true.

     

    Use queues and local cache to  create the asynchronous part of the interaction so you are not tied to the number of max threads.

     

     

    Thanks again for quick responses.

      We considered something similar - MQInput -> HTTPRequest node -> MQOutput. But then the HttpRequestNode being synchronous won't be able to take other requests until it completes the current request/thread.

       Hence the decision to go with the HttpAsyncRequest/Response node was taken. Everything works fine as expected, except that the timeout could not be set dynamically.

  • lancelotlinc
    lancelotlinc
    485 Posts

    Re: HTTPAsyncRequest Node timeout

    ‏2017-01-25T18:37:50Z  

     

    Thanks again for quick responses.

      We considered something similar - MQInput -> HTTPRequest node -> MQOutput. But then the HttpRequestNode being synchronous won't be able to take other requests until it completes the current request/thread.

       Hence the decision to go with the HttpAsyncRequest/Response node was taken. Everything works fine as expected, except that the timeout could not be set dynamically.

    The HttpAsync nodes use system queues behind the scenes. If the default functionality is not what you want, it is not too hard to duplicate the in-built functionality yourself and make whatever enhancements you want to your own satisfaction.

     

    There are several ways you can do this. First is by creating a message flow to use queues that periodically check for replies to a custom Java program external to the IIB. Another way is to use the Custom node example and extend it to do the same. Third, you can submit a feature request to IBM, but some of my feature requests have not been implemented since 2003.

     

    Again, the whole point about Async to begin with is to ignore any timeout or time to complete. There is no reason to change the timeout value on-the-fly. Just set it to several minutes and forget about it. Dynamically changing the Async timeout value has no real business purpose.