Until Successful Scope With Mule ESB

Scope is basically known as a wrappers. Until successful scope process the message until the process succeeds. By default, until successful scope runs asynchronously but you can always configure as synchronous. For example, If parent flow is calling child flow in until successful scope, the main flow will not halt for child flow to complete, it will immediately regains control of thread.

There are various scenarios where you can use until unsuccessful scope.

  • When you are calling web service and there is always chance that web service is not available for few seconds or minutes.
  • Subflow execution, performing various tasks and it keep re-executing until it succeeds.
  • During database call, it is always chance the database server is not available for few seconds or minutes due to high traffic.
  • Any other message processor, to perform complex activities.

Basic Attributes With Until Successful Scope

  • Object Store Ref is used to store events pending to process or reprocess.
  • Max Retries is maximum number of times retries attempted.
  • Milliseconds Between Retries is specify the minimum interval between two attempts to process, in milliseconds.
  • Failure Expression is specify an expression that, when it evaluated to true, determines that the processing of one route was a failure. If no expression is provided, only an exception is treated as a processing failure.
  • Ack Expression specify expression that, when evaluated to true, determines the synchronous response of until-successful.
  • Dead Letter Queue Ref is the endpoint or message processor to which undeliverable messages are sent after all retries have been executed unsuccessfully.

Place the http listener in message source region and configure it.
Drag and drop http requestor in message processor region and wrap with until successful scope.
Configure http requestor and provide rest webservice url that you need to call.
Configure the until successful scope. Provide Max Retries, Milliseconds Between Retries and Failure expression.

Above expression means till response code 200 is not received, message will retry for 5 times after time interval of 10 seconds. This is how you can use until successful scope in mule flow.

Here is the tutorial video.

Add a Comment

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