public class PollingConsumer extends AbstractPollingEndpoint implements IntegrationConsumer
MessageHandler
implementation
to a PollableChannel
.Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_RECEIVE_TIMEOUT
A default receive timeout as 1000L milliseconds.
|
DEFAULT_POLLING_PERIOD
lifecycleCondition, lifecycleLock
EXPRESSION_PARSER, logger
DEFAULT_PHASE
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.
|
MessageHandler |
getHandler()
Return the consumer's handler.
|
MessageChannel |
getInputChannel()
Return the input channel.
|
MessageChannel |
getOutputChannel()
Return the output channel (may be null).
|
protected Object |
getReceiveMessageSource() |
protected String |
getResourceKey()
Return the key under which the resource will be made available as an
attribute on the
IntegrationResourceHolder . |
protected Object |
getResourceToBind()
Return a resource (MessageSource etc) to bind when using transaction
synchronization.
|
protected void |
handleMessage(Message<?> message)
Handle a message.
|
protected boolean |
isReactive() |
protected Message<?> |
receiveMessage()
Obtain the next message (if one is available).
|
protected void |
setReceiveMessageSource(Object source) |
void |
setReceiveTimeout(long receiveTimeout) |
applyReceiveOnlyAdviceChain, getBeanClassLoader, getDefaultErrorChannel, getPollingFlux, getTaskExecutor, isReceiveOnlyAdvice, isSyncExecutor, onInit, setAdviceChain, setBeanClassLoader, setErrorHandler, setMaxMessagesPerPoll, setTaskExecutor, setTransactionSynchronizationFactory, setTrigger
destroy, doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBeanName, getComponentName, getComponentType
public static final long DEFAULT_RECEIVE_TIMEOUT
public PollingConsumer(PollableChannel inputChannel, MessageHandler handler)
public void setReceiveTimeout(long receiveTimeout)
public MessageChannel getInputChannel()
IntegrationConsumer
getInputChannel
in interface IntegrationConsumer
public MessageChannel getOutputChannel()
IntegrationConsumer
getOutputChannel
in interface IntegrationConsumer
public MessageHandler getHandler()
IntegrationConsumer
getHandler
in interface IntegrationConsumer
protected Object getReceiveMessageSource()
getReceiveMessageSource
in class AbstractPollingEndpoint
protected void setReceiveMessageSource(Object source)
setReceiveMessageSource
in class AbstractPollingEndpoint
protected boolean isReactive()
isReactive
in class AbstractPollingEndpoint
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 Object getResourceToBind()
AbstractPollingEndpoint
getResourceToBind
in class AbstractPollingEndpoint
protected String getResourceKey()
AbstractPollingEndpoint
IntegrationResourceHolder
. The default
ExpressionEvaluatingTransactionSynchronizationProcessor
makes this attribute available as a variable in SpEL expressions.getResourceKey
in class AbstractPollingEndpoint