public class SimpleBrokerMessageHandler extends AbstractBrokerMessageHandler
SimpMessageType
, keeps track of subscriptions with the help of a
SubscriptionRegistry
and sends messages to subscribers.Modifier and Type | Field and Description |
---|---|
private SubscribableChannel |
brokerChannel |
private SubscribableChannel |
clientInboundChannel |
private MessageChannel |
clientOutboundChannel |
private static byte[] |
EMPTY_PAYLOAD |
private SubscriptionRegistry |
subscriptionRegistry |
logger
Constructor and Description |
---|
SimpleBrokerMessageHandler(SubscribableChannel clientInboundChannel,
MessageChannel clientOutboundChannel,
SubscribableChannel brokerChannel,
java.util.Collection<java.lang.String> destinationPrefixes)
Create a SimpleBrokerMessageHandler instance with the given message channels
and destination prefixes.
|
Modifier and Type | Method and Description |
---|---|
SubscribableChannel |
getBrokerChannel() |
SubscribableChannel |
getClientInboundChannel() |
MessageChannel |
getClientOutboundChannel() |
SubscriptionRegistry |
getSubscriptionRegistry() |
protected void |
handleMessageInternal(Message<?> message) |
protected void |
sendMessageToSubscribers(java.lang.String destination,
Message<?> message) |
void |
setSubscriptionRegistry(SubscriptionRegistry subscriptionRegistry) |
void |
startInternal() |
void |
stopInternal() |
checkDestinationPrefix, getApplicationEventPublisher, getDestinationPrefixes, getPhase, handleMessage, isAutoStartup, isBrokerAvailable, isRunning, publishBrokerAvailableEvent, publishBrokerUnavailableEvent, setApplicationEventPublisher, setAutoStartup, start, stop, stop
private static final byte[] EMPTY_PAYLOAD
private final SubscribableChannel clientInboundChannel
private final MessageChannel clientOutboundChannel
private final SubscribableChannel brokerChannel
private SubscriptionRegistry subscriptionRegistry
public SimpleBrokerMessageHandler(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel, SubscribableChannel brokerChannel, java.util.Collection<java.lang.String> destinationPrefixes)
clientInboundChannel
- the channel for receiving messages from clients (e.g. WebSocket clients)clientOutboundChannel
- the channel for sending messages to clients (e.g. WebSocket clients)brokerChannel
- the channel for the application to send messages to the brokerpublic SubscribableChannel getClientInboundChannel()
public MessageChannel getClientOutboundChannel()
public SubscribableChannel getBrokerChannel()
public void setSubscriptionRegistry(SubscriptionRegistry subscriptionRegistry)
public SubscriptionRegistry getSubscriptionRegistry()
public void startInternal()
startInternal
in class AbstractBrokerMessageHandler
public void stopInternal()
stopInternal
in class AbstractBrokerMessageHandler
protected void handleMessageInternal(Message<?> message)
handleMessageInternal
in class AbstractBrokerMessageHandler
protected void sendMessageToSubscribers(java.lang.String destination, Message<?> message)