public class PollingConsumer extends AbstractPollingEndpoint
MessageHandler
implementation
to a PollableChannel
.logger
Constructor and Description |
---|
PollingConsumer(PollableChannel inputChannel,
MessageHandler handler) |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart()
Subclasses must implement this method with the start behavior.
|
protected void |
doStop()
Subclasses must implement this method with the stop behavior.
|
protected java.lang.String |
getResourceKey()
Return the key under which the resource will be made available as an
attribute on the
IntegrationResourceHolder . |
protected java.lang.Object |
getResourceToBind()
Return a resource (MessageSource etc) to bind when using transaction
synchronization.
|
protected void |
handleMessage(Message<?> message)
Handle a message.
|
protected Message<?> |
receiveMessage()
Obtain the next message (if one is available).
|
void |
setReceiveTimeout(long receiveTimeout) |
onInit, setAdviceChain, setBeanClassLoader, setErrorHandler, setMaxMessagesPerPoll, setTaskExecutor, setTransactionSynchronizationFactory, setTrigger
getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getComponentType, getConversionService, getIntegrationProperties, getIntegrationProperty, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, toString
public PollingConsumer(PollableChannel inputChannel, MessageHandler handler)
public void setReceiveTimeout(long receiveTimeout)
protected void doStart()
AbstractEndpoint
AbstractEndpoint.lifecycleLock
.doStart
in class AbstractPollingEndpoint
protected void doStop()
AbstractEndpoint
AbstractEndpoint.lifecycleLock
.doStop
in class AbstractPollingEndpoint
protected void handleMessage(Message<?> message)
AbstractPollingEndpoint
handleMessage
in class AbstractPollingEndpoint
message
- The message.protected Message<?> receiveMessage()
AbstractPollingEndpoint
receiveMessage
in class AbstractPollingEndpoint
protected java.lang.Object getResourceToBind()
AbstractPollingEndpoint
getResourceToBind
in class AbstractPollingEndpoint
protected java.lang.String getResourceKey()
AbstractPollingEndpoint
IntegrationResourceHolder
. The default
ExpressionEvaluatingTransactionSynchronizationProcessor
makes this attribute available as a variable in SpEL expressions.getResourceKey
in class AbstractPollingEndpoint