public class MessageBrokerRegistry extends Object
Constructor and Description |
---|
MessageBrokerRegistry(SubscribableChannel clientInboundChannel,
MessageChannel clientOutboundChannel) |
Modifier and Type | Method and Description |
---|---|
ChannelRegistration |
configureBrokerChannel()
Customize the channel used to send messages from the application to the message
broker.
|
SimpleBrokerRegistration |
enableSimpleBroker(String... destinationPrefixes)
Enable a simple message broker and configure one or more prefixes to filter
destinations targeting the broker (e.g.
|
StompBrokerRelayRegistration |
enableStompBrokerRelay(String... destinationPrefixes)
Enable a STOMP broker relay and configure the destination prefixes supported by the
message broker.
|
protected Collection<String> |
getApplicationDestinationPrefixes() |
protected ChannelRegistration |
getBrokerChannelRegistration() |
protected SimpleBrokerMessageHandler |
getSimpleBroker(SubscribableChannel brokerChannel) |
protected StompBrokerRelayMessageHandler |
getStompBrokerRelay(SubscribableChannel brokerChannel) |
protected String |
getUserDestinationPrefix() |
MessageBrokerRegistry |
setApplicationDestinationPrefixes(String... prefixes)
Configure one or more prefixes to filter destinations targeting application
annotated methods.
|
MessageBrokerRegistry |
setUserDestinationPrefix(String destinationPrefix)
Configure the prefix used to identify user destinations.
|
public MessageBrokerRegistry(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel)
public SimpleBrokerRegistration enableSimpleBroker(String... destinationPrefixes)
public StompBrokerRelayRegistration enableStompBrokerRelay(String... destinationPrefixes)
public ChannelRegistration configureBrokerChannel()
protected ChannelRegistration getBrokerChannelRegistration()
public MessageBrokerRegistry setApplicationDestinationPrefixes(String... prefixes)
When messages are processed, the matching prefix is removed from the destination in order to form the lookup path. This means annotations should not contain the destination prefix.
Prefixes that do not have a trailing slash will have one automatically appended.
protected Collection<String> getApplicationDestinationPrefixes()
public MessageBrokerRegistry setUserDestinationPrefix(String destinationPrefix)
For example when a user attempts to subscribe to "/user/queue/position-updates", the destination may be translated to "/queue/position-updatesi9oqdfzo" yielding a unique queue name that does not collide with any other user attempting to do the same. Subsequently when messages are sent to "/user/{username}/queue/position-updates", the destination is translated to "/queue/position-updatesi9oqdfzo".
The default prefix used to identify such destinations is "/user/".
protected String getUserDestinationPrefix()
protected SimpleBrokerMessageHandler getSimpleBroker(SubscribableChannel brokerChannel)
protected StompBrokerRelayMessageHandler getStompBrokerRelay(SubscribableChannel brokerChannel)