Spring Integration

org.springframework.integration.core
Interface MessageHandler

All Known Implementing Classes:
AbstractCorrelatingMessageHandler, AbstractInternetProtocolSendingMessageHandler, AbstractMappingMessageRouter, AbstractMessageHandler, AbstractMessageRouter, AbstractMessageSplitter, AbstractRemoteFileOutboundGateway, AbstractReplyProducingMessageHandler, AbstractResponseValidator, AbstractWebServiceOutboundGateway, AbstractXmppConnectionAwareMessageHandler, AggregatingMessageHandler, AmqpOutboundEndpoint, ApplicationEventPublishingMessageHandler, BridgeHandler, ByteStreamWritingMessageHandler, CacheWritingMessageHandler, CharacterStreamWritingMessageHandler, ChatMessageSendingMessageHandler, ContentEnricher, CorrelatingMessageBarrier, DefaultMessageSplitter, DelayHandler, DirectMessageSendingMessageHandler, ErrorMessageExceptionTypeRouter, ExpressionEvaluatingMessageHandler, ExpressionEvaluatingRouter, ExpressionEvaluatingSplitter, FileTransferringMessageHandler, FileWritingMessageHandler, FtpOutboundGateway, HeaderValueRouter, HttpRequestExecutingMessageHandler, JdbcMessageHandler, JdbcOutboundGateway, JmsOutboundGateway, JmsSendingMessageHandler, LoggingHandler, MailSendingMessageHandler, MarshallingWebServiceOutboundGateway, MessageFilter, MessageHandlerChain, MessageTransformingHandler, MessageValidator, MethodInvokingMessageHandler, MethodInvokingRouter, MethodInvokingSplitter, MulticastSendingMessageHandler, NotificationPublishingMessageHandler, OperationInvokingMessageHandler, PayloadTypeRouter, PayloadValidator, PresenceSendingMessageHandler, RecipientListRouter, RedisPublishingMessageHandler, ResequencingMessageHandler, RmiOutboundGateway, ServiceActivatingHandler, SftpOutboundGateway, SimpleWebServiceOutboundGateway, StatusUpdatingMessageHandler, StoredProcMessageHandler, StoredProcOutboundGateway, TcpOutboundGateway, TcpSendingMessageHandler, UnicastSendingMessageHandler, XPathMessageSplitter, XPathRouter

public interface MessageHandler

Base interface for any component that handles Messages.

Author:
Mark Fisher, Iwein Fuld

Method Summary
 void handleMessage(Message<?> message)
          Handles the message if possible.
 

Method Detail

handleMessage

void handleMessage(Message<?> message)
                   throws MessagingException
Handles the message if possible. If the handler cannot deal with the message this will result in a 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.

Parameters:
message - the message to be handled
Throws:
MessageRejectedException - if the handler doesn't accept the message
MessageHandlingException - when something fails during the handling
MessageDeliveryException - when this handler failed to deliver the reply related to the handling of the message
MessagingException

Spring Integration