Contact Free trial Login

Reconnection Strategy Reference

This section describes the reconnection strategies you can configure by editing your Mule application’s XML configuration file.

Reconnect

A reconnection strategy that allows the user to configure how many times a reconnection should be attempted and how long to wait between attempts.

Attributes of reconnect

Name Type Required Default Description

blocking

boolean

no

true

If false, the reconnection strategy runs in a separate, non-blocking thread

frequency

long

no

2000

How often (in ms) to reconnect

count

integer

no

2

How many reconnection attempts to make

Child Elements of reconnect

Name Cardinality Description

abstract-reconnect-notifier

0..1

A placeholder for a reconnection notifier element. The RetryNotifier interface is a callback that allows actions to be performed after each reconnection attempt, for example, firing server notification events on success or failure.

For example:

<jms:activemq-connector name="AMQConnector">
    <reconnect count="5" frequency="1000"/>
</jms:activemq-connector>

Reconnect Forever

A reconnection strategy that retries an infinite number of times at the specified frequency.

Attributes of reconnect-forever

Name Type Required Default Description

blocking

boolean

no

true

If false, the reconnection strategy runs in a separate, non-blocking thread.

frequency

long

no

2000

How often (in ms) to reconnect.

Reconnect Custom Strategy

A user-defined reconnection strategy.

Attributes of <reconnect-custom-strategy…​>

Name Type Required Default Description

blocking

boolean

no

true

If false, the reconnection strategy runs in a separate, non-blocking thread.

class

A class that implements the RetryPolicyTemplate interface.

Child Elements of reconnect-custom-strategy

Name Cardinality Description

abstract-reconnect-notifier

0..1

A placeholder for a reconnection notifier element. The RetryNotifier interface is a callback that allows actions to be performed after each reconnection attempt, for example, firing server notification events on success or failure.

spring:property

0..*

For example:

<jms:activemq-connector name="AMQConnector">
    <reconnect-custom-strategy class="org.mule.retry.test.TestRetryPolicyTemplate">
        <spring:property name="fooBar" value="true"/>
        <spring:property name="revolutions" value="500"/>
    </reconnect-custom-strategy>
</jms:activemq-connector>

Reconnect Notifier

A reconnect notifier is called for each reconnection attempt and is also configurable. You can create a custom reconnect notifier that implements the org.mule.api.retry.RetryNotifier interface.

The Reconnector notifier element fires a ConnectionNotification upon each reconnection attempt. There are no attributes or child elements for the notifier element.

For example:

<jms:activemq-connector name="AMQConnector">
    <reconnect>
        <reconnect-notifier/>
    </reconnect>
</jms:activemq-connector>

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.