Author |
Message
|
paintpot |
Posted: Tue Oct 04, 2011 2:51 am Post subject: Resequence node error handling |
|
|
Centurion
Joined: 19 Sep 2005 Posts: 112 Location: UK
|
Hi all,
WMB 7.0.0.3 toolkit and broker bang up to date. Windows 32 bit for this test env.
I have this flow:
MQInput -> Sequence -> Resequence -> Compute -> MQOutput
Any errors in the Compute node roll back to the Resequence node, which then seems to resend the message again - i.e. it loops.
If I connect the Failure terminal to an error handler sub flow, it is not used.
If I connect the Catch terminal to an error handler sub flow (home grown), then I can consume the message and stop the loop - but no rollback is issued.
I could write a small amount of state into my flow, and cache the message id - and remove any retry messages (e.g. by passing them into an error handler subflow).
Is the Resequence node acting as it should? Anything I have missed? is the strategy above a good one?
Thanks in advance |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Oct 04, 2011 4:36 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 04, 2011 4:52 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I haven't looked, but I suspect you'll find that the resequence node acts in the same manner as the Collector node - that it creates a new transaction and new message flow on the out side than from the in side.
If that's true, then, yes, it's acting as designed. |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Oct 04, 2011 4:56 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
mqjeff wrote: |
I haven't looked, but I suspect you'll find that the resequence node acts in the same manner as the Collector node - that it creates a new transaction and new message flow on the out side than from the in side.
If that's true, then, yes, it's acting as designed. |
Therefore it might be good practice to put a TryCatch Node on the output from the resequence node as it is for the collector node... _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
paintpot |
Posted: Tue Oct 04, 2011 5:07 am Post subject: |
|
|
Centurion
Joined: 19 Sep 2005 Posts: 112 Location: UK
|
thanks guys - my rescuers!! I was worried I was having a tumbleweed moment there.
My issue is that I want to rollback any work after the Resequence node, on error. I don't seem to be able to do this (MQ messages stay 'put') in my test code.
I think I have to:
- take a record of the message id in shared cache
- if the message fails, let it roll all the way back (ought to rollback the transaction)
- on second try, perform error handling (e.g. logging etc)
- kill the message as part of the second try
and
- clear up the cache periodically |
|
Back to top |
|
 |
paintpot |
Posted: Wed Oct 05, 2011 12:19 am Post subject: |
|
|
Centurion
Joined: 19 Sep 2005 Posts: 112 Location: UK
|
ok - I have added a Compute node that caches the previous message id, and if there is a match with the current message, it activates error handling and kills the message.
This works - obviously different users might want different approaches, like adding a backout count to the cache to allow more attempts before doing this.
 |
|
Back to top |
|
 |
|