Processing Strategies in Mule ESB | Synchronous verses Asynchronous Processing Strategy

A flow processing strategy determines how Mule implements message processing for a given flow. All Mule flows have an implicit processing strategy which Mule applies automatically: either synchronous or queued-asynchronous.

Even if you do not configure a processing strategy for your flow, the flow follows a processing strategy automatically applied by Mule. The processing strategy can be:

  • Synchronous Flow Strategy : Mule processes messages in a single thread.
  • Queued-Asynchronous Flow Processing Strategy : Mule uses a queue to decouple the receiver thread from the rest of the flow.
The following table summarizes how Mule chooses a flow processing strategy:

Synchronous Flow Processing Strategy: This is used  to process messages in the same thread that initially received the message. After the flow receives a message, all processing, including the processing of the response, is done in that same thread.
Non-Blocking Processing StrategyThis uses an evented non-blocking processing model to process requests. A single thread still handles each incoming request, but non-blocking components return this thread to the listener thread pool. Only upon obtaining and using a new thread, can processing continue.

The following Non-Blocking strategy limitations:
  • Only Message Source that supports non-blocking is the HTTP Connector Listener.
  • Only Message Processor that supports non-blocking is the HTTP Connector Request.
  • Only Message Exchange Pattern currently supported is Request-Response.
  • Only a limited set of components are fully supported for use in non-blocking flows
Synchronous FallbackIf an unsupported component is configured in a flow that is using the non-blocking processing strategy, then the flow reverts to the synchronous processing from the point in the flow. There may be advanced cases where this is desirable to take advantage of non-blocking for part of the flow, but typically it is best to stick with the synchronous processing strategy.


Lets build a flow and specify a Non-blocking processing strategy, if processing strategy isn't set flow will default it to synchronous flow strategy
Choose the message flow and choose appropriate processing strategy from processing strategy, as shown
Processing Strategy Ref option allow use to define the thread setting and pool exhaust behaviors.
Queued-Asynchronous Flow Processing Strategy: This uses a queue to decouple the flow’s receiver from the rest of the steps in the flow.

Test and verify the behavior.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.