97008 48403
+91 40-27177600


How to hold a message in Mule ESB flow for a specific time?


From the technical center of excellence of Massil Technologies, our technology leaders make it easy to understand the complex situations you come across in Mule ESB from the experience of Massil Technologies to have countered them in their experience of working on client projects in real time. This blog talks about .xml that use groovy to hold or freeze a message in Mule ESB flow for a specific interval of time before passing to next message processor. This blog is a part of series of blogs being authored and published by Massil Technologies for the benefit of the IT community globally.

We describe the solution in a step by step approach:


In The Anypoint studio, in the top left click on the file => New => Mule Project

Click on the Mule Project enter your project name and click finish.


Drag and drop the connectors you required from the Mule Palette to the canvas. Below flow shows the requirement to freeze a Mule message for a specific period of time.

Groovy flow:

The most viable solution is to use sleep() method to hold or freeze message for certain time. Below is the example snippet. In the above mule flow, take new variables named first message and the second message with two different payload data in the groovy component I use the sleep(5000) method to hold the payload data from one processor to another processor with 5sec this is the freeze time.

Console Output:

The output will come back from the first message to the second message with 5seconds time gap. The 5 seconds in the desired time or freeze time.

The above console shows the 5seconds time gap from one processor to another processor. Hence, we have gone through the step by step process to depict the way Massil Technologies team has addressed the scenario mentioned above. Hope this article from Massil Technologies was useful for you. If you have any further queries on this topic, please reach out to info@massil.tech.

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Get in touch with us

Scroll to top