Author |
Message
|
Base |
Posted: Tue Jul 14, 2009 2:35 am Post subject: How to notify a subflow in case of rollback? |
|
|
Apprentice
Joined: 09 Apr 2009 Posts: 32
|
Hi,
I am developing a component which is in fact a subflow. In this subflow I am emitting events. My Problem is that I have to somehow emit events if there occurs an exception which leads the flow where my subflow is embedded to be rolled back.
But there are some restrictions:
1. The problem is that I cannot touch the initial input node to set transaction events because I can only work in my subflow (I don't know where my subflow would be used later).
2. It is also not possible to try catch the error in my subflow and passing the exception forward because it could happen that the exception could be repaired in front of my subflow - if so my subflow wouldn't be noticed.
So is there a possibility that I can notify my subflow, that an rollback (or an successfully processing) was made? |
|
Back to top |
|
 |
MQEnthu |
Posted: Tue Jul 14, 2009 4:02 am Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
How does your subflow capture errors/events? Does it capture the exceptionlist and put it in a queue? _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
Base |
Posted: Tue Jul 14, 2009 4:09 am Post subject: |
|
|
Apprentice
Joined: 09 Apr 2009 Posts: 32
|
MQEnthu wrote: |
How does your subflow capture errors/events? Does it capture the exceptionlist and put it in a queue? |
ATM there is nothing implemented. the problem is that I need to emit some events when the whole flow is rolled back without touching anything outside my subflow (so no transactional events are possible).
When I am capturing the exception then I am not allowed to change this. On the one hand I am knowing that something after the subflow went wrong but on the other hand I cannot say for sure if this exception is handled in front of my subflow. Thats the big problem.
What I can imagine is to create another flow which will do my work but I dont know how to inform this new flow about the rollback in the other one? Are there any functions to do this? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jul 14, 2009 4:41 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Maybe you should use Monitoring Events instead of trying to roll your own? |
|
Back to top |
|
 |
Base |
Posted: Tue Jul 14, 2009 4:52 am Post subject: |
|
|
Apprentice
Joined: 09 Apr 2009 Posts: 32
|
mqjeff wrote: |
Maybe you should use Monitoring Events instead of trying to roll your own? |
Sorry for explaining it wrong - I am using monitoring events. But how can emit such events in case of a rollback with the already mentioned restrictions? |
|
Back to top |
|
 |
Base |
Posted: Thu Jul 16, 2009 1:17 am Post subject: |
|
|
Apprentice
Joined: 09 Apr 2009 Posts: 32
|
|
Back to top |
|
 |
rekarm01 |
Posted: Thu Jul 16, 2009 3:10 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
Base wrote: |
Hm... no possibilities? |
No, it is not possible for a subflow to predict future events that may occur outside of the subflow.
It is possible to create a second message flow that consumes messages from the first message flow's backout queue, and emit events from there. |
|
Back to top |
|
 |
Base |
Posted: Thu Jul 16, 2009 7:26 am Post subject: |
|
|
Apprentice
Joined: 09 Apr 2009 Posts: 32
|
rekarm01 wrote: |
Base wrote: |
Hm... no possibilities? |
No, it is not possible for a subflow to predict future events that may occur outside of the subflow.
It is possible to create a second message flow that consumes messages from the first message flow's backout queue, and emit events from there. |
The Problem is that the second Subflow does not know on which target transport the origin flow is writing to (could be MQ, JMS ...).
The only thing I can do is that the main flow generates an evetn on which the second flow is listening. So the second flow knows in which flow a roll back might happen. But does Message Broker provide an API or something else where the second flow can look up which flow with which correlation id (from the event) was passed successfully? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jul 16, 2009 8:17 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You don't expect a Try/Catch node to respond differently if there is a second Try/Catch node downstream... Correct?
If your subflow is added at a given point in the flow, and a process is added further down to encapsulate and isolate errors and resolve them and then proceed successfully, and your subflow needs to generate events in that case - then your subflow needs to also be inserted at a second point in the flow. |
|
Back to top |
|
 |
|