Author |
Message
|
wildtiger |
Posted: Wed Dec 10, 2008 9:11 am Post subject: Transaction Control in Message Flow |
|
|
 Acolyte
Joined: 21 Apr 2002 Posts: 55 Location: Canada
|
I have a question about transaction control in following message flow.
Code: |
+-------+
| |
+-+------------------+ MQ |
| | |Output1|
+-------+ | | +-------+
| +--(Failure)---+ |
| MQ +--(Catch)-------+ +--------+ +-------+
| Input +--(Out)----+ | | | |
+-------+ | +--+Compute2+--(Out)--+ MQ |
| | | | |Output2|
| +--------+ | +--------+ +-------+
| | | |
+--+Compute1+-(Out)--+
| | |
+--------+ | +--------+ +-------+
| | | | |
+--+Compute3+--(Out)--+ MQ |
| | |Output3|
+--------+ +-------+
|
In above message flow, the transaction attribute of the MQInput node is "Yes", all rest are "Automatic". When there's an exception thrown in Compute2 node, an output message was sent to MQOutput3 queue while the input message was sent to MQOutput1).
This is not what I want. I want the whole transaction to be backed out when there is an error or exception occurred in anywhere in the flow. Either two messages output to MQOutput2 and MQOutput3 (one in each queue) when the flow completes successfully or one message (the original input message) goes to MQOutput1 if there is an error/exception in the flow.
When I disconnect the "Catch" terminal of the MQInput node, I found it worked as what I want. But any one help explain it?
[/quote] |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Dec 10, 2008 9:17 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I bet there's a question on the Broker Developer certification exam that covers just this topic. |
|
Back to top |
|
 |
wildtiger |
Posted: Wed Dec 10, 2008 9:37 am Post subject: |
|
|
 Acolyte
Joined: 21 Apr 2002 Posts: 55 Location: Canada
|
Where can I find the information?
mqjeff wrote: |
I bet there's a question on the Broker Developer certification exam that covers just this topic. |
|
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 10, 2008 11:08 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
wildtiger wrote: |
Where can I find the information? |
Link's at the top of the page  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
wildtiger |
Posted: Wed Dec 10, 2008 2:31 pm Post subject: |
|
|
 Acolyte
Joined: 21 Apr 2002 Posts: 55 Location: Canada
|
I still have the question: what the default transaction behaivor of a message flow? If I have a flow of MQInput->Compute1->MQOutput1->Compute2->MQOutput2. Both Failure and Catch terminal of MQInput1 node are wired to a failure queue (an MQOutput node).
If an error/exception occurred in Compute2, the message sent to MQOutput1 remains there. It looks like there is no transaction by default.
The transaction worked when I disconnected the Catch terminal of the MQInput1 node.
I tried to read the broker info centre and documents. It's still not very clear to me. Can anyone help explain for me?
Thanks in advance! |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Dec 10, 2008 2:53 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you looked at the flow nodes under the construction tab?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Vitor |
Posted: Thu Dec 11, 2008 12:26 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
wildtiger wrote: |
It looks like there is no transaction by default.
|
Transactional default is controlled by message persistance if you don't control it yourself.
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Dec 11, 2008 5:39 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Transaction control is handled by the Input node.
If the input node doesn't see an error, there is no rollback. |
|
Back to top |
|
 |
wildtiger |
Posted: Thu Dec 11, 2008 6:49 am Post subject: |
|
|
 Acolyte
Joined: 21 Apr 2002 Posts: 55 Location: Canada
|
fjb_saper wrote: |
Have you looked at the flow nodes under the construction tab?  |
Hi fjb_saper, I don't see a construction tab. Could you tell which node? I didn't selecct "Coordinated Transaction" option on the Configuration tab of the BAR. |
|
Back to top |
|
 |
wildtiger |
Posted: Thu Dec 11, 2008 6:52 am Post subject: |
|
|
 Acolyte
Joined: 21 Apr 2002 Posts: 55 Location: Canada
|
Vitor wrote: |
wildtiger wrote: |
It looks like there is no transaction by default.
|
Transactional default is controlled by message persistance if you don't control it yourself.
 |
Hi Victor, I've select the Transaction mode of the MQInput node to "Yes". According to the manual, the transaction enabled. My question is, do I have to select "Coordinated Transaction" option on the Configuration tab of the BAR? I tried this option, the result is message left in the MQInput queue not consumed. |
|
Back to top |
|
 |
wildtiger |
Posted: Thu Dec 11, 2008 6:54 am Post subject: |
|
|
 Acolyte
Joined: 21 Apr 2002 Posts: 55 Location: Canada
|
mqjeff wrote: |
Transaction control is handled by the Input node.
If the input node doesn't see an error, there is no rollback. |
Hi mqjeff, what if there's an error further down the flow? should it be rolled back? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Dec 11, 2008 7:19 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
Luke |
Posted: Thu Dec 11, 2008 9:17 am Post subject: |
|
|
Centurion
Joined: 10 Nov 2008 Posts: 128 Location: UK
|
I can kind of see why you might be confused by this though ...
Maybe it will be clearer if you try inserting a TryCatch node connected to the Out terminal of MQInput, leave the MQInput Catch terminal unconnected and connect the catch of the TryCatch node to MQ Output1, and the Try to Compute1.
This would get the same result as your initial setup, and for the same reason, but maybe it's a bit clearer?
You need to think a bit more about how Catch works when an exception is thrown .... |
|
Back to top |
|
 |
|