ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Http Request Retry

Post new topic  Reply to topic
 Http Request Retry « View previous topic :: View next topic » 
Author Message
mqbrks
PostPosted: Thu Apr 26, 2012 5:28 am    Post subject: Http Request Retry Reply with quote

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
View user's profile Send private message
lancelotlinc
PostPosted: Thu Apr 26, 2012 5:33 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
mqbrks
PostPosted: Thu Apr 26, 2012 6:01 am    Post subject: Reply with quote

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
View user's profile Send private message
lancelotlinc
PostPosted: Thu Apr 26, 2012 6:03 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
mqbrks
PostPosted: Thu Apr 26, 2012 6:05 am    Post subject: Reply with quote

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
View user's profile Send private message
lancelotlinc
PostPosted: Thu Apr 26, 2012 6:09 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Http Request Retry
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.