|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Http Request Retry |
« View previous topic :: View next topic » |
Author |
Message
|
mqbrks |
Posted: Thu Apr 26, 2012 5:28 am Post subject: Http Request Retry |
|
|
Voyager
Joined: 17 Jan 2012 Posts: 75
|
Hi All,
I knew this type of question has been posted many times, but just want to confirm whether my logic is correct or not.
we have a scenario -
main flow
httpinput -> Error Handler Try -> Main Flow -> Subflow(http request node) -> Success Response(http reply)
Error Handler Catch-> Exception -> Error Response
we have an exception at the subflow(http request node) as sometimes the service can be down for a nsec or so. a retry logic has to be implemented.
>>>>I have implemented a retry logic in the error handler catch section as the exception throw is eventually caught there and in this section I check if the exception is xyzz....and counter <3, then - connect to the mainflow(try terminal).
>>>>Is this way of implementing retry logic good, or should we use a try catch block before the http request node. if we do so ,we can retry only once, because if a exception occurs again, it goes to the main catch terminal of the error handler(main).
Any ideas?
Thank You! |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Apr 26, 2012 5:33 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Looks like you have circular logic between retry and main flow. This is never a good idea.
An alternative would be to have a Compute node propagate once, then check the return code from the subflow. If not success, propagate again. If still not success, throw an error. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
mqbrks |
Posted: Thu Apr 26, 2012 6:01 am Post subject: |
|
|
Voyager
Joined: 17 Jan 2012 Posts: 75
|
lancelotlinc wrote: |
Looks like you have circular logic between retry and main flow. This is never a good idea.
An alternative would be to have a Compute node propagate once, then check the return code from the subflow. If not success, propagate again. If still not success, throw an error. |
Thank you for the reply lancelotlinc...But the Subflow is not returning a response, it is throwing an exception which has to be caught. And this exception is in httprequest node and not the JCN. And the retry is not once, it is thrice. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Apr 26, 2012 6:03 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
mqbrks wrote: |
lancelotlinc wrote: |
Looks like you have circular logic between retry and main flow. This is never a good idea.
An alternative would be to have a Compute node propagate once, then check the return code from the subflow. If not success, propagate again. If still not success, throw an error. |
Thank you for the reply lancelotlinc...But the Subflow is not returning a response, it is throwing an exception which has to be caught. And this exception is in httprequest node and not the JCN. And the retry is not once, it is thrice. |
Mainflow: Compute -> Subflow
Subflow: Input -> Try/Catch
If Catch terminal activated, set a negative response in Environment. The Compute node checks this location for return code. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
mqbrks |
Posted: Thu Apr 26, 2012 6:05 am Post subject: |
|
|
Voyager
Joined: 17 Jan 2012 Posts: 75
|
lancelotlinc wrote: |
mqbrks wrote: |
lancelotlinc wrote: |
Looks like you have circular logic between retry and main flow. This is never a good idea.
An alternative would be to have a Compute node propagate once, then check the return code from the subflow. If not success, propagate again. If still not success, throw an error. |
Thank you for the reply lancelotlinc...But the Subflow is not returning a response, it is throwing an exception which has to be caught. And this exception is in httprequest node and not the JCN. And the retry is not once, it is thrice. |
Mainflow: Compute -> Subflow
Subflow: Input -> Try/Catch
If Catch terminal activated, set a negative response in Environment. The Compute node checks this location for return code. |
Yes I did the same....but eventually, if an exception is raised again, it goes to the main catch terminal of the error handler. So this is only one retry right? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Apr 26, 2012 6:09 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
You can have as many retries as you want. I would use ESQL Compute to do this vs. JCN. In your ESQL Compute, propagate once, check response code. If not success, propagate again. If still not success, propagate again, as many times as you want. Be aware that your caller likely has a timeout, so don't exceed the timeout he/she expects. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|