public class AmqpInboundChannelAdapter extends MessageProducerSupport implements OrderlyShutdownCapable
Modifier and Type | Class and Description |
---|---|
protected class |
AmqpInboundChannelAdapter.BatchListener |
static class |
AmqpInboundChannelAdapter.BatchMode
Defines the payload type when the listener container is configured with consumerBatchEnabled.
|
protected class |
AmqpInboundChannelAdapter.Listener |
Modifier and Type | Field and Description |
---|---|
static String |
CONSOLIDATED_HEADERS
Header containing
List<Map<String, Object> headers when batch mode
is AmqpInboundChannelAdapter.BatchMode.EXTRACT_PAYLOADS_WITH_HEADERS . |
lifecycleCondition, lifecycleLock
EXPRESSION_PARSER, logger
DEFAULT_PHASE
Constructor and Description |
---|
AmqpInboundChannelAdapter(org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer listenerContainer) |
AmqpInboundChannelAdapter(org.springframework.amqp.rabbit.listener.MessageListenerContainer listenerContainer)
Construct an instance using the provided container.
|
Modifier and Type | Method and Description |
---|---|
int |
afterShutdown()
Called after normal shutdown of schedulers, executors etc,
and after the shutdown delay has elapsed, but before any
forced shutdown of any remaining active scheduler/executor
threads.Can optionally return the number of active messages
still in process.
|
int |
beforeShutdown()
Called before shutdown begins.
|
protected void |
doStart()
Take no action by default.
|
protected void |
doStop()
Take no action by default.
|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected AttributeAccessor |
getErrorMessageAttributes(Message<?> message)
Populate an
AttributeAccessor to be used when building an error message
with the errorMessageStrategy . |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setBatchingStrategy(org.springframework.amqp.rabbit.batch.BatchingStrategy batchingStrategy)
Set a batching strategy to use when de-batching messages created by a batching
producer (such as the BatchingRabbitTemplate).
|
void |
setBatchMode(AmqpInboundChannelAdapter.BatchMode batchMode)
When the listener container is configured with consumerBatchEnabled, set the payload
type for messages generated for the batches.
|
void |
setBindSourceMessage(boolean bindSourceMessage)
Set to true to bind the source message in the header named
IntegrationMessageHeaderAccessor.SOURCE_DATA . |
void |
setHeaderMapper(AmqpHeaderMapper headerMapper) |
void |
setMessageConverter(org.springframework.amqp.support.converter.MessageConverter messageConverter) |
void |
setRecoveryCallback(org.springframework.retry.RecoveryCallback<?> recoveryCallback)
Set a
RecoveryCallback when using retry within the adapter. |
void |
setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
Set a
RetryTemplate to use for retrying a message delivery within the
adapter. |
afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisher
destroy, doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, 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
public static final String CONSOLIDATED_HEADERS
List<Map<String, Object>
headers when batch mode
is AmqpInboundChannelAdapter.BatchMode.EXTRACT_PAYLOADS_WITH_HEADERS
.public AmqpInboundChannelAdapter(org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer listenerContainer)
public AmqpInboundChannelAdapter(org.springframework.amqp.rabbit.listener.MessageListenerContainer listenerContainer)
listenerContainer
- the container.public void setMessageConverter(org.springframework.amqp.support.converter.MessageConverter messageConverter)
public void setHeaderMapper(AmqpHeaderMapper headerMapper)
public void setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
RetryTemplate
to use for retrying a message delivery within the
adapter. Unlike adding retry at the container level, this can be used with an
ErrorMessageSendingRecoverer
RecoveryCallback
to publish to the
error channel after retries are exhausted. You generally should not configure an
error channel when using retry here, use a RecoveryCallback
instead.retryTemplate
- the template.setRecoveryCallback(RecoveryCallback)
public void setRecoveryCallback(org.springframework.retry.RecoveryCallback<?> recoveryCallback)
RecoveryCallback
when using retry within the adapter.recoveryCallback
- the callback.setRetryTemplate(RetryTemplate)
public void setBatchingStrategy(org.springframework.amqp.rabbit.batch.BatchingStrategy batchingStrategy)
SimpleBatchingStrategy
.batchingStrategy
- the strategy.public void setBindSourceMessage(boolean bindSourceMessage)
IntegrationMessageHeaderAccessor.SOURCE_DATA
.bindSourceMessage
- true to bind.public void setBatchMode(AmqpInboundChannelAdapter.BatchMode batchMode)
AmqpInboundChannelAdapter.BatchMode.MESSAGES
.batchMode
- the batch mode.public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
protected void onInit()
IntegrationObjectSupport
onInit
in class MessageProducerSupport
protected void doStart()
MessageProducerSupport
doStart
in class MessageProducerSupport
protected void doStop()
MessageProducerSupport
doStop
in class MessageProducerSupport
public int beforeShutdown()
OrderlyShutdownCapable
beforeShutdown
in interface OrderlyShutdownCapable
public int afterShutdown()
OrderlyShutdownCapable
afterShutdown
in interface OrderlyShutdownCapable
protected AttributeAccessor getErrorMessageAttributes(Message<?> message)
MessageProducerSupport
AttributeAccessor
to be used when building an error message
with the errorMessageStrategy
.getErrorMessageAttributes
in class MessageProducerSupport
message
- the message.