In static failover a client is configured to use a failover IRU that lists the URIs of the broker connections the client can use. When establishing a connection, the client randomly chooses a URI from the list and attempts to establish a connection to it. If the connection does not succeed, the client chooses a new URI from the list and tries again. The client will continue cycling through the list until a connection attempt succeeds.
If a client's connection to a broker fails after it has been established, the client will attempt to reconnect to a different broker in the list. Once a connection to a new broker is established, the client will continue to use the new broker until the connection to the new broker is severed.
A failover URI is a composite URI that uses one of the following syntaxes:
failover://
uri1,...,uriNfailover://(
uri1,...,uriN)?TransportOptions
The URI list()
is a comma-separated list containing the list of broker endpoint URIs to which the client can
connect. The transport options(uri1,...,uriN?)
specified in the form of a query list, allow you to configure some of the failoiver
behaviors.TransportOptions
The failover protocol supports the transport options described in Table 1.
Table 1. Failover Transport Options
Example 1 shows a failover URI that can connect to one of two message brokers.
Example 1. Simple Failover URI
failover://(tcp://localhost:61616,tcp://remotehost:61616)?initialReconnectDelay=100








