0

We just started using Mule a month back and so far it's been a good learning. Right now, we have quite a few flows implemented that integrates our disparate systems. One of the requirements for us is to execute at the end of each flow some clean-up code. More like a finalizer construct.

I am looking for a generic approach that I can follow for all our flows.

Note - If i add a step (where i can execute the clean-up code) to the end of a flow - there is no guarantee that that step will be executed after the completion of all previous steps (as some of the steps are run on different threads; and we don't want to run the entire flow on one synchronous thread). Is there any eventing mechanism in Mule that notifies subscribers at the completion of all steps in a flow? I am also unsure if mule flow life-cycle will be a right fit here. Please help.

Thanks.

Arun
  • 1

1 Answers1

1

Probably a good candidate for this are Mule Server Notifications: http://www.mulesoft.org/documentation/display/current/Mule+Server+Notifications

Seba
  • 2,319
  • 15
  • 14
  • Thanks Seba for your suggestion. I checked the link your provided - could not see any notification for a flow completion. Basically I want to execute a piece of static code after a flow (all steps) gets completed; note - as I mentioned in the question, I would not be knowing which step executes the last, as these steps gets executed on different threads. – Arun Apr 17 '13 at 19:41
  • Check this notification: org.mule.context.notification.PipelineMessageNotification – Seba Apr 17 '13 at 23:22
  • Thanks @Seba. Looked into the PipelineMessageNotification. But I don't understand how that will help here. We don't have anything chained. Maybe my understanding of PipelineMessageNotification is wrong. Our typical flow looks like the following: ----. Now as we don't have a synchronous processing strategy, FTP is run on a separate thread and Cleanup stage is called in parallel to that of FTP on a different thread, which is what our issue is. We basically want to run run post completion of all other steps. – Arun Apr 18 '13 at 12:53