When a Mule app starts, a connectivity test runs on components, such as the HTTP or FTP connector, that need to connect to an external server. If the test fails, the default behavior is to log a warning message and continue with the deployment of the app, instead of blocking the deployment.
You can modify this behavior by setting a number of reconnection attempts to try after an initial failure and by forcing the deployment to fail when all connection attempts fail.
Fail Deployment (
failsDeployment): Forces the deployment to fail if the connection fails and any configured reconnection attempts are exhausted.
reconnect): Limits the number of reconnection attempts and the interval at which to execute them. For example, you might set a
5reconnection attempts at a
4000milliseconds (ms). Defaults to
2reconnection attempts at a frequency of
2000ms.Example with that fails after
5reconnection attempts are exhausted:
<ftp:config name="FTP_Config" doc:name="FTP Config" > <ftp:connection host="ftp.someftphost.com" port="21" username="myusername" password="mypassword" > <reconnection failsDeployment="true" > <reconnect count="5"/> </reconnection> </ftp:connection> </ftp:config> <flow name="reconnectionsFlow" > <ftp:listener doc:name="On New or Updated File" config-ref="FTP_Config"> <scheduling-strategy > <fixed-frequency /> </scheduling-strategy> </ftp:listener> </flow>
Reconnect Forever (
reconnect-forever): Attempts to reconnect at a given interval, for example, every
4000ms for as long as the app runs. Defaults to every
2000ms.Example that does not set a limit on the number of reconnection attempts:
<ftp:connection host="ftp.someftphost.com" port="21" username="myusername" password="mypassword" > <reconnection> <reconnect-forever frequency="4000"/> </reconnection> </ftp:connection>