|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Rollback AND control the response |
« View previous topic :: View next topic » |
Author |
Message
|
goffinf |
Posted: Sat Jun 27, 2009 10:36 am Post subject: Rollback AND control the response |
|
|
Chevalier
Joined: 05 Nov 2005 Posts: 401
|
Version 6.1
My flow receives message using a HTTPInput and part way through uses an MQOuput with Transaction mode set to 'Yes', after which an ACK message is created and returned to the caller.
If an exception occurs AFTER the MQOutput I want :-
a. the MQOuput to not commit
b. to create and return a specific NACK message to the caller.
If I don't connect the Catch terminal of the HTTPInput node, I get behaviour (a), but the response message is generated by the HTTPInput node itself depending on the setting for the Error Handling/Fault Format). But its not the message I would like to return.
If I do connect the Catch terminal of the HTTPInput node I can create whatever response message I like (NACK in my case) but the MQOuput message will be committed.
Is there any way I can get (a) and (b) ?
Thanks
Fraser. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Jun 28, 2009 9:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
you did not specify what your flow does. You did not specify where your MQOutput node goes to, you did not specify what processing you do after the MQOutput node and you did not specify what kind of message the MQOutput node sends (i.e. enquiry, update msgs to a db, etc...)...
So no we cannot help you. We have way too little information.
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
goffinf |
Posted: Mon Jun 29, 2009 12:43 am Post subject: |
|
|
Chevalier
Joined: 05 Nov 2005 Posts: 401
|
fjb_saper wrote: |
you did not specify what your flow does |
Receives a message over HTTP, validates it, then (if valid) puts it onto an internal MQ Queue (using an MQOutput node), then creates the response (an Acknowledgement). If the creation of the Acknowledgement fails I want to return a specific error response AND have ensure that the MQ PUT does not commit.
Quote: |
You did not specify where your MQOutput node goes to |
Not sure quite what you mean, but it just PUTs on to a local queue, that is set to be transactional and persistant
Quote: |
you did not specify what processing you do after the MQOutput node |
I generate a response to the caller (an Ack). This involves some processing that has the potential to error, and if so, I want to ensure that the MQPut is not committed.
Quote: |
you did not specify what kind of message the MQOutput node sends (i.e. enquiry, update msgs to a db, etc...)... |
Its just doing a PUT to a local persistant queue under a transaction. That said, that queue is the input to another MB flow which deals with further delivery procesisng of the message, so its important that its not picked up if creation of the Acknowledgement fails.
Quote: |
So no we cannot help you. We have way too little information. |
Hopefully you do now ? |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Mon Jun 29, 2009 2:33 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
If you add a throw after your httpreply node does this achieve the desired behaviour (although im not sure if the request node will attempt to send a fault when the exception hits it - i've not tried this before!)?
If you are setting your output messages to be peristent then the transaction mode of automatic will be sufficient for what you want.
Quote: |
Its just doing a PUT to a local persistant queue under a transaction.
|
Messages may or may not be persistant, queues only have a default persiance setting which may or may not be used by the applications that put the messages. |
|
Back to top |
|
 |
goffinf |
Posted: Mon Jun 29, 2009 4:34 am Post subject: |
|
|
Chevalier
Joined: 05 Nov 2005 Posts: 401
|
WMBDEV1 wrote: |
If you add a throw after your httpreply node does this achieve the desired behaviour (although im not sure if the request node will attempt to send a fault when the exception hits it - i've not tried this before!)? |
For anyone else who's interested, this does indeed work. Wiring the catch terminal of the HTTPInput to a Compute node (or whatever) to create the required error response, then to a SECOND HTTPReply (the main flow has its own) and then after a THROW.
WMBDEV1 wrote: |
If you are setting your output messages to be peristent then the transaction mode of automatic will be sufficient for what you want.
...
Messages may or may not be persistant, queues only have a default persiance setting which may or may not be used by the applications that put the messages. |
Thanks for the clarification. |
|
Back to top |
|
 |
inMo |
Posted: Mon Jun 29, 2009 9:39 am Post subject: |
|
|
 Master
Joined: 27 Jun 2009 Posts: 216 Location: NY
|
Using the throw node will do the trick. If you want to go a step deeper, you can try a compute node & a throw statement. Doing so would allow you to take a look at the failure then create a specific error message you want to be linked to your generated exception. |
|
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
|
|
|
|