<flow name="untilsuccessfulFlow"> <scheduler doc:name="Scheduler" > <scheduling-strategy > <fixed-frequency frequency="30" timeUnit="SECONDS"/> </scheduling-strategy> </scheduler> <until-successful maxRetries="5" doc:name="Until Successful"> <!-- A single processor here --> <http:request method="GET" doc:name="Request" config-ref="HTTP_Request_configuration" url="https://jsonplaceholder.typicode.com/users"/> </until-successful> <logger level="INFO" doc:name="Logger" /> </flow>
Until Successful Scope
Standard Support for Mule 4.1 ended on November 2, 2020, and this version of Mule reached its End of Life on November 2, 2022, when Extended Support ended. Deployments of new applications to CloudHub that use this version of Mule are no longer allowed. Only in-place updates to applications are permitted. MuleSoft recommends that you upgrade to the latest version of Mule 4 that is in Standard Support so that your applications run with the latest fixes and security enhancements. |
The Until Successful scope processes the components within it, in order, until they succeed or exhaust the maximum number of retries. Like all Core components other than Async, Until Successful runs synchronously. If a component within the scope fails to connect or produce a successful result, Until Successful retries the failed task until all configured retries are exhausted. If a retry succeeds, the scope proceeds to the next component. If the final retry does not succeed, Until Successful produces an error.
Common processes that use Until Successful include:
-
Dispatching to outbound endpoints, for example, when calling a remote web service that might have availability issues.
-
Executing a component method, for example, when executing on a Spring bean that may depend on unreliable resources.
-
Using a sub-flow to re-execute several actions until they all succeed.
The Until Successful scope provides fields described in this table:
Attribute | Description |
---|---|
Max Retries ( |
Specifies the maximum number of retries that are attempted. An error message looks like this: |
Milliseconds Between Retries ( |
Specifies the minimum interval between two attempts to process, in milliseconds. The actual interval depends on the previous execution, but should not exceed twice this number. The default value is 60000 milliseconds (one minute). |
This XML example allows for up to five retries each second, the default. Note
that doc:id
attributes are removed to make the example more readable.