Red Hat DocumentationFuse Message BrokerToggle FramesPrintFeedback

Peer Protocol

Overview

The peer protocol enables you to set up a peer-to-peer network by creating an embedded broker inside each peer endpoint. Figure 10 illustrates the peer-to-peer network topology for a simple two-peer network.

Figure 10. Peer Protocol Endpoints with Embedded Brokers

Peer Protocol Endpoints with Embedded Brokers

In this topology, a standalone broker is not required, because each peer instantiates its own embedded broker. As shown in Figure 10 , the producer sends messages to its embedded broker, broker1, by connecting to the local VM endpoint, vm://broker1—see ???? . The embedded brokers, broker1 and broker2, are linked together using a network connector, which allows messages to flow in either direction between the brokers. When the producer sends a message to the queue, TEST.FOO, the first embedded broker, broker1, automatically pushes the message across the network connector and on to the remote embedded broker, broker2. The consumer can then receive the message from its embedded broker, broker2.

Discovering peer endpoints

Implicitly, the peer protocol uses multicast discovery to locate active peers on the network. In order for this to work, you must ensure that the IP multicast protocol is enabled on your operating system. See ???? for details.

URI syntax

A peer URI must conform to the following syntax:

peer://PeerGroup/BrokerName?BrokerOptions

Where the group name, PeerGroup, identifies the set of peers that can communicate with each other. That is, a given peer can connect only to the set of peers that specify the same PeerGroup name in their URLs. The BrokerName specifies the broker name for the embedded broker. The broker options, BrokerOptions, are specified in the form of a query list (for example, ?persistent=true).

Broker options

The peer URL supports the broker options described in Table 17.

Table 17. Broker Options

OptionDescription
useJmx If true, enables JMX. Default is true.
persistent If true, the broker uses persistent storage. Default is true.
populateJMSXUserID If true, the broker populates the JMSXUserID message property with the sender’s authenticated username. Default is false.
useShutdownHook If true, the broker installs a shutdown hook, so that it can shut down properly when it receives a JVM kill. Default is true.
brokerName Specifies the broker name. Default is localhost.
deleteAllMessagesOnStartup If true, deletes all the messages in the persistent store as the broker starts up. Default is false.
enableStatistics If true, enables statistics gathering in the broker. Default is true.

Sample URI

The following is an example of a peer URL that belongs to the peer group, groupA, and creates an embedded broker with broker name, broker1:

peer://groupA/broker1?persistent=false
Comments powered by Disqus