A discovery protocol builds a connection to a message broker in two steps, as follows:
Obtain a list of available broker endpoints (represented by URIs).
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, ? . |
Discovery | discovery://( DiscoveryAgentUri )? TransportOptions | 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 . |
Fanout | fanout://( DiscoveryAgentUri )? TransportOptions | Configure clients to connect to all of the broker endpoints from a dynamically discovered URI list. |
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 .
![]() | 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. |