Author |
Message
|
KIT_INC |
Posted: Thu Oct 30, 2014 12:49 pm Post subject: Is there a way to make a subflow a separate UOW ? |
|
|
Knight
Joined: 25 Aug 2006 Posts: 589
|
I have a message flow which does some MQ work and DB updates and it is a single UOW (very standard message flow). I now want to reuse the function and make it a subflow. But I also want it to be a separate UOW from the UOW of the flow that calls the subflow. That is regardless of the main flow is successful or not I need the work done by the subflow committed if the the sub flow completes all the work. I know that I can do node level commit such as using 'commit' in a compute node to commit work done inside the compute node as a separate UOW from the main flow. But I am looking for a way to do UOW at a subflow level. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Oct 30, 2014 12:50 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Is the SLA so tight that this work needs to be done as a subflow, and you can't squeeze in a call to another real flow (using MQ or etc.) ? |
|
Back to top |
|
 |
McueMart |
Posted: Fri Oct 31, 2014 2:46 am Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
Sounds like a valid RFE to be able to put multiple nodes (or a complete subflow) within the same axillary transaction.
I doubt the development team would go for it though as it would complicate the already complex transaction model of broker.
Also, as mqjeff says, you can do this already by just invoking a separate flow. |
|
Back to top |
|
 |
KIT_INC |
Posted: Fri Oct 31, 2014 4:23 am Post subject: |
|
|
Knight
Joined: 25 Aug 2006 Posts: 589
|
We just need the confirmation that it cannot be done. Not any tight SLA issue. We were look for a way to see if we can dynamically control the UOW of this particular subflow (either a separate UOW or the same UOW as the mainflow). If we use an intermediate input node, then it will definitely be a separate UOW. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Oct 31, 2014 5:00 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If it *can* be done, and I'm only saying *if*...
You would have to do stuff with PROPAGATE to push things down a path that commited a bunch of transactions, and then do something to ensure that when you returned, the existing transactions were still open.
I don't know how to do the second part, but *perhaps* you could manage it by throwing and catching exceptions. |
|
Back to top |
|
 |
KIT_INC |
Posted: Fri Oct 31, 2014 5:47 am Post subject: |
|
|
Knight
Joined: 25 Aug 2006 Posts: 589
|
Thanks for the suggestion mqjeff. I'll see what I can do with the propagate statement.
The suggestion was it is much straight forward to use an intermediate node if I want the UOW to be separated. But I need some suggestion on how I can better control unexpected situations.
Mainflow ---- subflow (commit subflow uow) -----mainflow continue (commit mainflow UOW)
My thinking with the suggestion is
Mainflow ---- intermediate output (MQOUTPUT, Q1) ----(MQGET-WAIT Q2)--- mainflow continue (commit mainflow UOW)
MQINPUT, Q1 --- 'subflow logic' -- MQoutput Q2(subflow UOW commit)
This will work. But I have to prevent unexpected situations such as someone accidentally put a message to Q1 and kick off the 'subflow' logic or for whatever reason a message is left behind in Q1. I need to make sure the Q1 and Q2 are empty when each iteration of the mainflow is started.
Is using something other than MQ, such as http request/response be better ? Any suggestion ? |
|
Back to top |
|
 |
|