AbstractBrokerMessageHandler

Abstract base class for a {@link MessageHandler} that broker messages to registered subscribers.

@author Rossen Stoyanchev @since 4.0

Constructors

this
this(SubscribableChannel inboundChannel, MessageChannel outboundChannel, SubscribableChannel brokerChannel)

Constructor with no destination prefixes (matches all destinations). @param inboundChannel the channel for receiving messages from clients (e.g. WebSocket clients) @param outboundChannel the channel for sending messages to clients (e.g. WebSocket clients) @param brokerChannel the channel for the application to send messages to the broker

this
this(SubscribableChannel inboundChannel, MessageChannel outboundChannel, SubscribableChannel brokerChannel, string[] destinationPrefixes)

Constructor with destination prefixes to match to destinations of messages. @param inboundChannel the channel for receiving messages from clients (e.g. WebSocket clients) @param outboundChannel the channel for sending messages to clients (e.g. WebSocket clients) @param brokerChannel the channel for the application to send messages to the broker @param destinationPrefixes prefixes to use to filter out messages

Members

Functions

checkDestinationPrefix
bool checkDestinationPrefix(string destination)
Undocumented in source. Be warned that the author may not have intended to support it.
getApplicationEventPublisher
ApplicationEventPublisher getApplicationEventPublisher()
Undocumented in source. Be warned that the author may not have intended to support it.
getBrokerChannel
SubscribableChannel getBrokerChannel()
Undocumented in source. Be warned that the author may not have intended to support it.
getClientInboundChannel
SubscribableChannel getClientInboundChannel()
Undocumented in source. Be warned that the author may not have intended to support it.
getClientOutboundChannel
MessageChannel getClientOutboundChannel()
Undocumented in source. Be warned that the author may not have intended to support it.
getClientOutboundChannelForSession
MessageChannel getClientOutboundChannelForSession(string sessionId)

Get the MessageChannel to use for sending messages to clients, possibly a per-session wrapper when {@code preservePublishOrder=true}. @since 5.1

getDestinationPrefixes
string[] getDestinationPrefixes()
Undocumented in source. Be warned that the author may not have intended to support it.
getPhase
int getPhase()
Undocumented in source. Be warned that the author may not have intended to support it.
handleMessage
void handleMessage(MessageBase message)
Undocumented in source. Be warned that the author may not have intended to support it.
handleMessageInternal
void handleMessageInternal(MessageBase message)
Undocumented in source.
isAutoStartup
bool isAutoStartup()
Undocumented in source. Be warned that the author may not have intended to support it.
isBrokerAvailable
bool isBrokerAvailable()

Whether the message broker is currently available and able to process messages. <p>Note that this is in addition to the {@link #isRunning()} flag, which indicates whether this message handler is running. In other words the message handler must first be running and then the {@code #isBrokerAvailable()} flag may still independently alternate between being on and off depending on the concrete sub-class implementation. <p>Application components may implement {@code hunt.framework.context.ApplicationListener&lt;BrokerAvailabilityEvent&gt;} to receive notifications when broker becomes available and unavailable.

isPreservePublishOrder
bool isPreservePublishOrder()

Whether to ensure messages are received in the order of publication. @since 5.1

isRunning
bool isRunning()

Check whether this message handler is currently running. <p>Note that even when this message handler is running the {@link #isBrokerAvailable()} flag may still independently alternate between being on and off depending on the concrete sub-class implementation.

publishBrokerAvailableEvent
void publishBrokerAvailableEvent()
Undocumented in source. Be warned that the author may not have intended to support it.
publishBrokerUnavailableEvent
void publishBrokerUnavailableEvent()
Undocumented in source. Be warned that the author may not have intended to support it.
setApplicationEventPublisher
void setApplicationEventPublisher(ApplicationEventPublisher publisher)
Undocumented in source. Be warned that the author may not have intended to support it.
setAutoStartup
void setAutoStartup(bool autoStartup)
Undocumented in source. Be warned that the author may not have intended to support it.
setPreservePublishOrder
void setPreservePublishOrder(bool preservePublishOrder)

Whether the client must receive messages in the order of publication. <p>By default messages sent to the {@code "clientOutboundChannel"} may not be processed in the same order because the channel is backed by a ThreadPoolExecutor that in turn does not guarantee processing in order. <p>When this flag is set to {@code true} messages within the same session will be sent to the {@code "clientOutboundChannel"} one at a time in order to preserve the order of publication. Enable this only if needed since there is some performance overhead to keep messages in order. @param preservePublishOrder whether to publish in order @since 5.1

start
void start()
Undocumented in source. Be warned that the author may not have intended to support it.
startInternal
void startInternal()
Undocumented in source. Be warned that the author may not have intended to support it.
stop
void stop()
Undocumented in source. Be warned that the author may not have intended to support it.
stop
void stop(Runnable callback)
Undocumented in source. Be warned that the author may not have intended to support it.
stopInternal
void stopInternal()
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From MessageHandler

handleMessage
void handleMessage(MessageBase message)

Handle the given message. @param message the message to be handled @throws MessagingException if the handler failed to process the message

opCmp
int opCmp(MessageHandler o)
Undocumented in source.

Meta