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
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
Get the MessageChannel to use for sending messages to clients, possibly a per-session wrapper when {@code preservePublishOrder=true}. @since 5.1
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<BrokerAvailabilityEvent>} to receive notifications when broker becomes available and unavailable.
Whether to ensure messages are received in the order of publication. @since 5.1
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.
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
Handle the given message. @param message the message to be handled @throws MessagingException if the handler failed to process the message
Abstract base class for a {@link MessageHandler} that broker messages to registered subscribers.
@author Rossen Stoyanchev @since 4.0