The Fanout Transport

The Fanout transport layers reconnect and replication logic on top of any of the other transports. It utilizes the Discovery transport to discover brokers and replicates commands to those brokers.

Configuration Syntax


Transport Options

Option Name

Default Value




How long to wait before the first reconnect attempt



The maximum amount of time we ever wait between reconnect attempts



Should an exponential backoff be used btween reconnect attempts



The exponent used in the exponential backoff attempts



If not 0, then this is the maximum number of reconnect attempts before an error is sent back to the client



If set to 'true', commands are replicated to queues as well as topics



The minimum number of brokers to which connections must be established

The 'fanOutQueues' option is specific to the fanout transport. By default, the fanout does not replicate commands to queues; only topics. Therefore, if you'd like to fanout a message send command to multiple queues on multiple brokers, you'll have to set this option to 'true'.

By default, a client's fanout transport waits for connections to be established to 2 brokers, or the number of static TCP URIs configured (if more than 2). Until this number of connections is established, the client's call to Connection.createSession() does not return. For example, a producer that uses the fanout connector listed below will wait until 2 brokers are running, and connections are established to those two brokers.

Another example would be a producer using the following fanout connector.

In this case, three broker connections are needed. However, this required number of connections can be overridden by using the minAckCount transport option. For example, this fanout connector allows the producer to run after connecting to just one broker.


It is not recommended that you use the fanout URI for consumers. Also, if a producer fans out across multiple brokers, who happen to be inter-connected, then there is a very high likelihood that a consumer on one of those brokers will get duplicate messages.

Example URI

Applying parameters to discovered transports

Because the Discovery transport is utilized for broker discovery, transport parameters are applied to discovered brokers. See Discovery Transport Reference.

© 2004-2011 The Apache Software Foundation.
Apache ActiveMQ, ActiveMQ, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram