A discovery protocol builds a connection to a message broker in two steps:
Obtain a list of available broker endpoints.
Connect to one or more endpoints from the discovered list, according to some selection algorithm.
Discovery protocols are particularly useful for clients that connect to a cluster of message brokers.
Table 1.2 describes the discovery protocols that clients can use.
Table 1.2. Summary of Discovery Protocols
Protocol | Sample URL | Description |
---|---|---|
Failover | failover://( uri1 ,..., uriN )? TransportOptions | Configure clients to connect to one of the broker endpoints from the URI list,
uri1 ,..., uriN .
The transport options,
? TransportOptions , are specified in
the form of a query list. If no transport options are required, you can omit the
parentheses and the question mark, ? . For more information
see Failover Protocol in Fault Tolerant Messaging. |
Discovery | discovery://( | Configure clients to connect to one of the broker endpoints from a URI list
that is dynamically discovered at runtime, using a discovery agent. The discovery
agent URI, DiscoveryAgentUri , is normally a multicast
discovery agent—for example, multicast://default . For more information
see Dynamic Discovery Protocol in Using Networks of Brokers. |
Fanout | fanout://( | Configure clients to connect to all of the broker endpoints from a dynamically discovered URI list. For more information see Fanout Protocol in Using Networks of Brokers. |
The discovery protocol supports a number of discovery agents, which are also specified in the form of a URI. For details of the supported discovery agents, see Discovery Agents in Using Networks of Brokers.
![]() | Note |
---|---|
Although discovery agent URIs look superficially like transport URIs, they are not the same thing. A discovery agent URI can only be used in certain contexts and cannot be used directly in place of a transport URI. |