C - the container type.public abstract class AbstractRabbitListenerContainerFactory<C extends AbstractMessageListenerContainer> extends java.lang.Object implements RabbitListenerContainerFactory<C>, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationEventPublisherAware
RabbitListenerContainerFactory for Spring's base container implementation.AbstractMessageListenerContainer| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.atomic.AtomicInteger |
counter |
protected org.apache.commons.logging.Log |
logger |
| Constructor and Description |
|---|
AbstractRabbitListenerContainerFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract C |
createContainerInstance()
Create an empty container instance.
|
C |
createListenerContainer(RabbitListenerEndpoint endpoint)
Create a
MessageListenerContainer for the given
RabbitListenerEndpoint. |
org.aopalliance.aop.Advice[] |
getAdviceChain() |
protected void |
initializeContainer(C instance,
RabbitListenerEndpoint endpoint)
Further initialize the specified container.
|
void |
setAcknowledgeMode(org.springframework.amqp.core.AcknowledgeMode acknowledgeMode) |
void |
setAdviceChain(org.aopalliance.aop.Advice... adviceChain) |
void |
setAfterReceivePostProcessors(org.springframework.amqp.core.MessagePostProcessor... postProcessors)
Set post processors which will be applied after the Message is received.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) |
void |
setAutoStartup(java.lang.Boolean autoStartup) |
void |
setBatchingStrategy(BatchingStrategy batchingStrategy)
Set a
BatchingStrategy to use when debatching messages. |
void |
setBatchListener(boolean isBatch)
Set to true to receive a list of debatched messages that were created by a
BatchingRabbitTemplate. |
void |
setBeforeSendReplyPostProcessors(org.springframework.amqp.core.MessagePostProcessor... postProcessors)
Set post processors that will be applied before sending replies; added to each
message listener adapter.
|
void |
setChannelTransacted(java.lang.Boolean channelTransacted) |
void |
setConnectionFactory(ConnectionFactory connectionFactory) |
void |
setConsumerTagStrategy(org.springframework.amqp.support.ConsumerTagStrategy consumerTagStrategy) |
void |
setContainerCustomizer(ContainerCustomizer<C> containerCustomizer)
Set a
ContainerCustomizer that is invoked after a container is created and
configured to enable further customization of the container. |
void |
setDeBatchingEnabled(java.lang.Boolean deBatchingEnabled)
Determine whether or not the container should de-batch batched
messages (true) or call the listener with the batch (false).
|
void |
setDefaultRequeueRejected(java.lang.Boolean requeueRejected) |
void |
setErrorHandler(org.springframework.util.ErrorHandler errorHandler) |
void |
setFailedDeclarationRetryInterval(java.lang.Long failedDeclarationRetryInterval) |
void |
setIdleEventInterval(java.lang.Long idleEventInterval)
How often to publish idle container events.
|
void |
setMessageConverter(org.springframework.amqp.support.converter.MessageConverter messageConverter) |
void |
setMismatchedQueuesFatal(java.lang.Boolean mismatchedQueuesFatal) |
void |
setMissingQueuesFatal(java.lang.Boolean missingQueuesFatal) |
void |
setPhase(int phase) |
void |
setPrefetchCount(java.lang.Integer prefetch) |
void |
setRecoveryBackOff(org.springframework.util.backoff.BackOff recoveryBackOff) |
void |
setRecoveryInterval(java.lang.Long recoveryInterval) |
void |
setReplyRecoveryCallback(org.springframework.retry.RecoveryCallback<?> recoveryCallback)
Set a
RecoveryCallback to invoke when retries are exhausted. |
void |
setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
Set a
RetryTemplate to use when sending replies; added to each message
listener adapter. |
void |
setTaskExecutor(java.util.concurrent.Executor taskExecutor) |
void |
setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateListenerContainerprotected final org.apache.commons.logging.Log logger
protected final java.util.concurrent.atomic.AtomicInteger counter
public AbstractRabbitListenerContainerFactory()
public void setConnectionFactory(ConnectionFactory connectionFactory)
connectionFactory - The connection factory.RabbitAccessor.setConnectionFactory(ConnectionFactory)public void setErrorHandler(org.springframework.util.ErrorHandler errorHandler)
errorHandler - The error handler.AbstractMessageListenerContainer.setErrorHandler(org.springframework.util.ErrorHandler)public void setMessageConverter(org.springframework.amqp.support.converter.MessageConverter messageConverter)
messageConverter - the message converter to useRabbitListenerEndpoint.setMessageConverter(MessageConverter)public void setAcknowledgeMode(org.springframework.amqp.core.AcknowledgeMode acknowledgeMode)
acknowledgeMode - the acknowledge mode to set. Defaults to AcknowledgeMode.AUTOAbstractMessageListenerContainer.setAcknowledgeMode(AcknowledgeMode)public void setChannelTransacted(java.lang.Boolean channelTransacted)
channelTransacted - the flag value to setRabbitAccessor.setChannelTransacted(boolean)public void setTaskExecutor(java.util.concurrent.Executor taskExecutor)
taskExecutor - the Executor to use.AbstractMessageListenerContainer.setTaskExecutor(java.util.concurrent.Executor)public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
transactionManager - the PlatformTransactionManager to use.AbstractMessageListenerContainer.setTransactionManager(org.springframework.transaction.PlatformTransactionManager)public void setPrefetchCount(java.lang.Integer prefetch)
prefetch - the prefetch countAbstractMessageListenerContainer.setPrefetchCount(int)public void setDefaultRequeueRejected(java.lang.Boolean requeueRejected)
requeueRejected - true to reject by default.AbstractMessageListenerContainer.setDefaultRequeueRejected(boolean)@Nullable public org.aopalliance.aop.Advice[] getAdviceChain()
null.public void setAdviceChain(org.aopalliance.aop.Advice... adviceChain)
adviceChain - the advice chain to set.AbstractMessageListenerContainer.setAdviceChain(org.aopalliance.aop.Advice...)public void setRecoveryInterval(java.lang.Long recoveryInterval)
recoveryInterval - The recovery interval.AbstractMessageListenerContainer.setRecoveryInterval(long)public void setRecoveryBackOff(org.springframework.util.backoff.BackOff recoveryBackOff)
recoveryBackOff - The BackOff to recover.AbstractMessageListenerContainer.setRecoveryBackOff(BackOff)public void setMissingQueuesFatal(java.lang.Boolean missingQueuesFatal)
missingQueuesFatal - the missingQueuesFatal to set.AbstractMessageListenerContainer.setMissingQueuesFatal(boolean)public void setMismatchedQueuesFatal(java.lang.Boolean mismatchedQueuesFatal)
mismatchedQueuesFatal - the mismatchedQueuesFatal to set.AbstractMessageListenerContainer.setMismatchedQueuesFatal(boolean)public void setConsumerTagStrategy(org.springframework.amqp.support.ConsumerTagStrategy consumerTagStrategy)
consumerTagStrategy - the consumerTagStrategy to setAbstractMessageListenerContainer.setConsumerTagStrategy(ConsumerTagStrategy)public void setIdleEventInterval(java.lang.Long idleEventInterval)
idleEventInterval - the interval.public void setFailedDeclarationRetryInterval(java.lang.Long failedDeclarationRetryInterval)
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAwarepublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void setAutoStartup(java.lang.Boolean autoStartup)
autoStartup - true for auto startup.AbstractMessageListenerContainer.setAutoStartup(boolean)public void setPhase(int phase)
phase - The phase.AbstractMessageListenerContainer.setPhase(int)public void setAfterReceivePostProcessors(org.springframework.amqp.core.MessagePostProcessor... postProcessors)
postProcessors - the post processors.AbstractMessageListenerContainer.setAfterReceivePostProcessors(MessagePostProcessor...)public void setBeforeSendReplyPostProcessors(org.springframework.amqp.core.MessagePostProcessor... postProcessors)
postProcessors - the post processors.AbstractAdaptableMessageListener.setBeforeSendReplyPostProcessors(MessagePostProcessor...)public void setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
RetryTemplate to use when sending replies; added to each message
listener adapter.retryTemplate - the template.setReplyRecoveryCallback(RecoveryCallback),
AbstractAdaptableMessageListener.setRetryTemplate(RetryTemplate)public void setReplyRecoveryCallback(org.springframework.retry.RecoveryCallback<?> recoveryCallback)
RecoveryCallback to invoke when retries are exhausted. Added to each
message listener adapter. Only used if a retryTemplate is provided.recoveryCallback - the recovery callback.setRetryTemplate(RetryTemplate),
AbstractAdaptableMessageListener.setRecoveryCallback(RecoveryCallback)public void setContainerCustomizer(ContainerCustomizer<C> containerCustomizer)
ContainerCustomizer that is invoked after a container is created and
configured to enable further customization of the container.containerCustomizer - the customizer.public void setBatchListener(boolean isBatch)
BatchingRabbitTemplate.isBatch - true for a batch listener.setBatchingStrategy(BatchingStrategy)public void setBatchingStrategy(BatchingStrategy batchingStrategy)
BatchingStrategy to use when debatching messages.batchingStrategy - the batching strategy.setBatchListener(boolean)public void setDeBatchingEnabled(java.lang.Boolean deBatchingEnabled)
deBatchingEnabled - whether or not to disable de-batching of messages.AbstractMessageListenerContainer.setDeBatchingEnabled(boolean)public C createListenerContainer(RabbitListenerEndpoint endpoint)
RabbitListenerContainerFactoryMessageListenerContainer for the given
RabbitListenerEndpoint.createListenerContainer in interface RabbitListenerContainerFactory<C extends AbstractMessageListenerContainer>endpoint - the endpoint to configure.protected abstract C createContainerInstance()
protected void initializeContainer(C instance, RabbitListenerEndpoint endpoint)
Subclasses can inherit from this method to apply extra configuration if necessary.
instance - the container instance to configure.endpoint - the endpoint.