public abstract class AbstractMessageHandler extends IntegrationObjectSupport implements MessageHandler, TrackableComponent, Orderable
MessagingException
s.logger
Constructor and Description |
---|
AbstractMessageHandler() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
int |
getOrder() |
void |
handleMessage(Message<?> message)
Handles the message if possible.
|
protected abstract void |
handleMessageInternal(Message<?> message) |
void |
setOrder(int order)
Set the order for this component.
|
void |
setShouldTrack(boolean shouldTrack) |
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getTaskScheduler, onInit, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponentName
public void setOrder(int order)
Orderable
public int getOrder()
getOrder
in interface org.springframework.core.Ordered
public java.lang.String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
public void setShouldTrack(boolean shouldTrack)
setShouldTrack
in interface TrackableComponent
public final void handleMessage(Message<?> message)
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 handledprotected abstract void handleMessageInternal(Message<?> message) throws java.lang.Exception
java.lang.Exception