Reputation: 63
In Mule 4 is there any any way to run the Mule-Batch in synchronous Mode
I have done several projects using mule batch component. Now present case we have a situation where need to dependent on the output produced by the mule batch component.For my case it is creating a file in asynchronous mode which contains the below information.
studentId,Name,Status 1,bijoy,enrolled 2,hari,not_enrolled, 3,piyush,erolled
But as it is running in asynchronous mode could not rely on the data. My question is is there any way to run mule Batch (Mule 4) synchronously?
Upvotes: 2
Views: 684
Reputation: 25872
No, it is not possible to run a Batch synchronously within the flow it is called, by design.
As an alternative you could put the logic that you want to execute after the batch in a separate flow that listens to a VM queue. In the On Complete phase of the batch you can send a message to that VM queue. The listening flow can't receive batch data directly but for a file it should be OK.
Having said that, file exchange is not a very good method of exchanging information inside an application. I would recommend to explore alternatives like databases for transient data, unless you just need the file to send it elsewhere.
Upvotes: 2