public abstract class AbstractMessageListenerContainerSpec<S extends AbstractMessageListenerContainerSpec<S,C>,C extends AbstractMessageListenerContainer> extends IntegrationComponentSpec<S,C>
logger, PARSER, targetDEFAULT_PHASE| Constructor and Description |
|---|
AbstractMessageListenerContainerSpec(C listenerContainer) |
| Modifier and Type | Method and Description |
|---|---|
S |
acknowledgeMode(AcknowledgeMode acknowledgeMode) |
S |
addQueueNames(String... queueName) |
S |
addQueues(Queue... queues) |
S |
adviceChain(Advice... adviceChain) |
S |
afterReceivePostProcessors(MessagePostProcessor... afterReceivePostProcessors)
Set
MessagePostProcessors that will be applied after message reception, before
invoking the MessageListener. |
S |
alwaysRequeueWithTxManagerRollback(boolean alwaysRequeueWithTxManagerRollback)
Set to true to always requeue on transaction rollback with an external TransactionManager.
|
S |
autoDeclare(boolean autoDeclare)
Set to true to automatically declare elements (queues, exchanges, bindings)
in the application context during container start().
|
S |
channelTransacted(boolean transactional) |
S |
consumerArguments(Map<String,Object> args)
Set consumer arguments.
|
S |
consumerTagStrategy(ConsumerTagStrategy consumerTagStrategy)
Set the implementation of
ConsumerTagStrategy to generate consumer tags. |
S |
deBatchingEnabled(boolean deBatchingEnabled)
Determine whether or not the container should de-batch batched
messages (true) or call the listener with the batch (false).
|
S |
defaultRequeueRejected(boolean defaultRequeueRejected) |
S |
errorHandler(ErrorHandler errorHandler) |
S |
exclusive(boolean exclusive) |
S |
exclusiveConsumerExceptionLogger(ConditionalExceptionLogger exclusiveConsumerExceptionLogger)
Set a
ConditionalExceptionLogger for logging exclusive consumer failures. |
S |
failedDeclarationRetryInterval(long failedDeclarationRetryInterval)
Set the interval between passive queue declaration attempts in milliseconds.
|
S |
id(String id)
Configure the component identifier.
|
S |
idleEventInterval(long idleEventInterval)
How often to emit
ListenerContainerIdleEvents
in milliseconds. |
S |
lookupKeyQualifier(String lookupKeyQualifier)
Set a qualifier that will prefix the connection factory lookup key; default none.
|
S |
messagePropertiesConverter(MessagePropertiesConverter messagePropertiesConverter)
Set the
MessagePropertiesConverter for this listener container. |
S |
mismatchedQueuesFatal(boolean mismatchedQueuesFatal)
Prevent the container from starting if any of the queues defined in the context have
mismatched arguments (TTL etc).
|
S |
missingQueuesFatal(boolean missingQueuesFatal)
If all of the configured queue(s) are not available on the broker, this setting
determines whether the condition is fatal.
|
S |
prefetchCount(int prefetchCount) |
S |
recoveryBackOff(BackOff recoveryBackOff)
Specify the
BackOff for interval between recovery attempts. |
S |
recoveryInterval(long recoveryInterval) |
S |
shutdownTimeout(long shutdownTimeout) |
S |
statefulRetryFatalWithNullMessageId(boolean statefulRetryFatalWithNullMessageId)
Set whether a message with a null messageId is fatal for the consumer
when using stateful retry.
|
S |
taskExecutor(Executor taskExecutor)
Configure an
Executor used to invoke the message listener. |
S |
transactionAttribute(TransactionAttribute transactionAttribute)
Set the transaction attribute to use when using an external transaction manager.
|
S |
transactionManager(PlatformTransactionManager transactionManager)
Configure a
PlatformTransactionManager; used to synchronize the rabbit transaction
with some other transaction(s). |
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stopafterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingletonpublic AbstractMessageListenerContainerSpec(C listenerContainer)
public S id(String id)
IntegrationComponentSpecbeanName to register the
bean in the application context for this component.id in class IntegrationComponentSpec<S extends AbstractMessageListenerContainerSpec<S,C>,C extends AbstractMessageListenerContainer>id - the id.public S acknowledgeMode(AcknowledgeMode acknowledgeMode)
acknowledgeMode - the acknowledgeMode.AbstractMessageListenerContainer.setAcknowledgeMode(AcknowledgeMode)public S addQueueNames(String... queueName)
queueName - a vararg list of queue names to add.AbstractMessageListenerContainer.addQueueNames(String...)public S addQueues(Queue... queues)
queues - a vararg list of queues to add.AbstractMessageListenerContainer.addQueueNames(String...)public S errorHandler(ErrorHandler errorHandler)
errorHandler - the errorHandler.AbstractMessageListenerContainer.setErrorHandler(ErrorHandler)public S channelTransacted(boolean transactional)
transactional - true for transactional channels.RabbitAccessor.setChannelTransacted(boolean)public S adviceChain(Advice... adviceChain)
adviceChain - the adviceChain.AbstractMessageListenerContainer.setAdviceChain(Advice[])public S recoveryInterval(long recoveryInterval)
recoveryInterval - the recoveryIntervalAbstractMessageListenerContainer.setRecoveryInterval(long)public S exclusive(boolean exclusive)
exclusive - true for exclusive.AbstractMessageListenerContainer.setExclusive(boolean)public S shutdownTimeout(long shutdownTimeout)
shutdownTimeout - the shutdownTimeout.AbstractMessageListenerContainer.setShutdownTimeout(long)public S taskExecutor(Executor taskExecutor)
Executor used to invoke the message listener.taskExecutor - the taskExecutor.public S prefetchCount(int prefetchCount)
prefetchCount - the prefetchCount.AbstractMessageListenerContainer.setPrefetchCount(int)public S transactionManager(PlatformTransactionManager transactionManager)
PlatformTransactionManager; used to synchronize the rabbit transaction
with some other transaction(s).transactionManager - the transactionManager.public S defaultRequeueRejected(boolean defaultRequeueRejected)
defaultRequeueRejected - the defaultRequeueRejected.AbstractMessageListenerContainer.setDefaultRequeueRejected(boolean)public S deBatchingEnabled(boolean deBatchingEnabled)
deBatchingEnabled - the deBatchingEnabled to set.AbstractMessageListenerContainer.setDeBatchingEnabled(boolean)public S afterReceivePostProcessors(MessagePostProcessor... afterReceivePostProcessors)
MessagePostProcessors that will be applied after message reception, before
invoking the MessageListener.
Often used to decompress data. Processors are invoked in order,
depending on PriorityOrder, Order and finally unordered.afterReceivePostProcessors - the post processor.AbstractMessageListenerContainer.setAfterReceivePostProcessors(MessagePostProcessor...)public S lookupKeyQualifier(String lookupKeyQualifier)
lookupKeyQualifier - the qualifierAbstractMessageListenerContainer.setLookupKeyQualifier(String)public S consumerTagStrategy(ConsumerTagStrategy consumerTagStrategy)
ConsumerTagStrategy to generate consumer tags.
By default, the RabbitMQ server generates consumer tags.consumerTagStrategy - the consumerTagStrategy to set.AbstractMessageListenerContainer.setConsumerTagStrategy(ConsumerTagStrategy)public S consumerArguments(Map<String,Object> args)
args - the arguments.AbstractMessageListenerContainer.setConsumerArguments(Map)public S idleEventInterval(long idleEventInterval)
ListenerContainerIdleEvents
in milliseconds.idleEventInterval - the interval.AbstractMessageListenerContainer.setIdleEventInterval(long)public S transactionAttribute(TransactionAttribute transactionAttribute)
transactionAttribute - the transaction attribute to setAbstractMessageListenerContainer.setTransactionAttribute(TransactionAttribute)public S recoveryBackOff(BackOff recoveryBackOff)
BackOff for interval between recovery attempts.
The default is 5000 ms, that is, 5 seconds.
With the BackOff you can supply the maxAttempts for recovery before
the stop() will be performed.recoveryBackOff - The BackOff to recover.AbstractMessageListenerContainer.setRecoveryBackOff(BackOff)public S messagePropertiesConverter(MessagePropertiesConverter messagePropertiesConverter)
MessagePropertiesConverter for this listener container.messagePropertiesConverter - The properties converter.AbstractMessageListenerContainer.setMessagePropertiesConverter(MessagePropertiesConverter)public S missingQueuesFatal(boolean missingQueuesFatal)
When false, the condition is not considered fatal and the container will continue to attempt to start the consumers.
missingQueuesFatal - the missingQueuesFatal to set.AbstractMessageListenerContainer.setMissingQueuesFatal(boolean)public S mismatchedQueuesFatal(boolean mismatchedQueuesFatal)
mismatchedQueuesFatal - true to fail initialization when this condition occurs.AbstractMessageListenerContainer.setMismatchedQueuesFatal(boolean)public S autoDeclare(boolean autoDeclare)
autoDeclare - the boolean flag to indicate an declaration operation.AbstractMessageListenerContainer.setAutoDeclare(boolean)public S failedDeclarationRetryInterval(long failedDeclarationRetryInterval)
failedDeclarationRetryInterval - the interval, default 5000.AbstractMessageListenerContainer.setFailedDeclarationRetryInterval(long)public S statefulRetryFatalWithNullMessageId(boolean statefulRetryFatalWithNullMessageId)
statefulRetryFatalWithNullMessageId - true for fatal.AbstractMessageListenerContainer.setStatefulRetryFatalWithNullMessageId(boolean)public S exclusiveConsumerExceptionLogger(ConditionalExceptionLogger exclusiveConsumerExceptionLogger)
ConditionalExceptionLogger for logging exclusive consumer failures. The
default is to log such failures at WARN level.exclusiveConsumerExceptionLogger - the conditional exception logger.AbstractMessageListenerContainer.setExclusiveConsumerExceptionLogger(ConditionalExceptionLogger)public S alwaysRequeueWithTxManagerRollback(boolean alwaysRequeueWithTxManagerRollback)
alwaysRequeueWithTxManagerRollback - true to always requeue on rollback.AbstractMessageListenerContainer.setAlwaysRequeueWithTxManagerRollback(boolean)