public class SimpleBrokerMessageHandler extends java.lang.Object implements MessageHandler
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.String> |
destinationPrefixes |
private static Log |
logger |
private MessageChannel |
messageChannel |
private SubscriptionRegistry |
subscriptionRegistry |
Constructor and Description |
---|
SimpleBrokerMessageHandler(MessageChannel messageChannel) |
Modifier and Type | Method and Description |
---|---|
private boolean |
checkDestinationPrefix(java.lang.String destination) |
java.util.List<java.lang.String> |
getDestinationPrefixes() |
SubscriptionRegistry |
getSubscriptionRegistry() |
void |
handleMessage(Message<?> message)
Handles the message if possible.
|
private void |
preProcessMessage(Message<?> message) |
protected void |
sendMessageToSubscribers(java.lang.String destination,
Message<?> message) |
void |
setDestinationPrefixes(java.util.List<java.lang.String> destinationPrefixes) |
void |
setSubscriptionRegistry(SubscriptionRegistry subscriptionRegistry) |
private static final Log logger
private final MessageChannel messageChannel
private java.util.List<java.lang.String> destinationPrefixes
private SubscriptionRegistry subscriptionRegistry
public SimpleBrokerMessageHandler(MessageChannel messageChannel)
messageChannel
- the channel to broadcast messages topublic void setDestinationPrefixes(java.util.List<java.lang.String> destinationPrefixes)
public java.util.List<java.lang.String> getDestinationPrefixes()
public void setSubscriptionRegistry(SubscriptionRegistry subscriptionRegistry)
public SubscriptionRegistry getSubscriptionRegistry()
public void handleMessage(Message<?> message) throws MessagingException
MessageHandler
MessageRejectedException
e.g.
in case of a Selective Consumer. When a consumer tries to handle a
message, but fails to do so, a MessageHandlingException
is
thrown. In the last case it is recommended to treat the message as tainted
and go into an error scenario.
When the handling results in a failure of another message being sent
(e.g. a "reply" message), that failure will trigger a
MessageDeliveryException
.
handleMessage
in interface MessageHandler
message
- the message to be handled
reply related to the handling of the messageMessagingException
private boolean checkDestinationPrefix(java.lang.String destination)
private void preProcessMessage(Message<?> message)
protected void sendMessageToSubscribers(java.lang.String destination, Message<?> message)