C - the container type.public abstract class AbstractRabbitListenerContainerFactory<C extends AbstractMessageListenerContainer> extends Object implements RabbitListenerContainerFactory<C>, ApplicationContextAware, ApplicationEventPublisherAware
RabbitListenerContainerFactory for Spring's base container implementation.AbstractMessageListenerContainer| Modifier and Type | Field and Description |
|---|---|
protected AtomicInteger |
counter |
protected 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. |
Advice[] |
getAdviceChain() |
protected void |
initializeContainer(C instance,
RabbitListenerEndpoint endpoint)
Further initialize the specified container.
|
void |
setAcknowledgeMode(AcknowledgeMode acknowledgeMode) |
void |
setAdviceChain(Advice... adviceChain) |
void |
setAfterReceivePostProcessors(MessagePostProcessor... postProcessors)
Set post processors which will be applied after the Message is received.
|
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) |
void |
setAutoStartup(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(MessagePostProcessor... postProcessors)
Set post processors that will be applied before sending replies; added to each
message listener adapter.
|
void |
setChannelTransacted(Boolean channelTransacted) |
void |
setConnectionFactory(ConnectionFactory connectionFactory) |
void |
setConsumerTagStrategy(ConsumerTagStrategy consumerTagStrategy) |
void |
setContainerConfigurer(Consumer<C> configurer)
A
Consumer that is invoked to enable setting other container properties not
exposed by this container factory. |
void |
setDeBatchingEnabled(Boolean deBatchingEnabled)
Determine whether or not the container should de-batch batched
messages (true) or call the listener with the batch (false).
|
void |
setDefaultRequeueRejected(Boolean requeueRejected) |
void |
setErrorHandler(ErrorHandler errorHandler) |
void |
setFailedDeclarationRetryInterval(Long failedDeclarationRetryInterval) |
void |
setIdleEventInterval(Long idleEventInterval)
How often to publish idle container events.
|
void |
setMessageConverter(MessageConverter messageConverter) |
void |
setMismatchedQueuesFatal(Boolean mismatchedQueuesFatal) |
void |
setMissingQueuesFatal(Boolean missingQueuesFatal) |
void |
setPhase(int phase) |
void |
setPrefetchCount(Integer prefetch) |
void |
setRecoveryBackOff(BackOff recoveryBackOff) |
void |
setRecoveryInterval(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(Executor taskExecutor) |
void |
setTransactionManager(PlatformTransactionManager transactionManager) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateListenerContainerprotected final Log logger
protected final AtomicInteger counter
public AbstractRabbitListenerContainerFactory()
public void setConnectionFactory(ConnectionFactory connectionFactory)
connectionFactory - The connection factory.RabbitAccessor.setConnectionFactory(ConnectionFactory)public void setErrorHandler(ErrorHandler errorHandler)
errorHandler - The error handler.AbstractMessageListenerContainer.setErrorHandler(org.springframework.util.ErrorHandler)public void setMessageConverter(MessageConverter messageConverter)
messageConverter - the message converter to useRabbitListenerEndpoint.setMessageConverter(MessageConverter)public void setAcknowledgeMode(AcknowledgeMode acknowledgeMode)
acknowledgeMode - the acknowledge mode to set. Defaults to AcknowledgeMode.AUTOAbstractMessageListenerContainer.setAcknowledgeMode(AcknowledgeMode)public void setChannelTransacted(Boolean channelTransacted)
channelTransacted - the flag value to setRabbitAccessor.setChannelTransacted(boolean)public void setTaskExecutor(Executor taskExecutor)
taskExecutor - the Executor to use.AbstractMessageListenerContainer.setTaskExecutor(java.util.concurrent.Executor)public void setTransactionManager(PlatformTransactionManager transactionManager)
transactionManager - the PlatformTransactionManager to use.AbstractMessageListenerContainer.setTransactionManager(org.springframework.transaction.PlatformTransactionManager)public void setPrefetchCount(Integer prefetch)
prefetch - the prefetch countAbstractMessageListenerContainer.setPrefetchCount(int)public void setDefaultRequeueRejected(Boolean requeueRejected)
requeueRejected - true to reject by default.AbstractMessageListenerContainer.setDefaultRequeueRejected(boolean)@Nullable public Advice[] getAdviceChain()
null.public void setAdviceChain(Advice... adviceChain)
adviceChain - the advice chain to set.AbstractMessageListenerContainer.setAdviceChain(org.aopalliance.aop.Advice...)public void setRecoveryInterval(Long recoveryInterval)
recoveryInterval - The recovery interval.AbstractMessageListenerContainer.setRecoveryInterval(long)public void setRecoveryBackOff(BackOff recoveryBackOff)
recoveryBackOff - The BackOff to recover.AbstractMessageListenerContainer.setRecoveryBackOff(BackOff)public void setMissingQueuesFatal(Boolean missingQueuesFatal)
missingQueuesFatal - the missingQueuesFatal to set.AbstractMessageListenerContainer.setMissingQueuesFatal(boolean)public void setMismatchedQueuesFatal(Boolean mismatchedQueuesFatal)
mismatchedQueuesFatal - the mismatchedQueuesFatal to set.AbstractMessageListenerContainer.setMismatchedQueuesFatal(boolean)public void setConsumerTagStrategy(ConsumerTagStrategy consumerTagStrategy)
consumerTagStrategy - the consumerTagStrategy to setAbstractMessageListenerContainer.setConsumerTagStrategy(ConsumerTagStrategy)public void setIdleEventInterval(Long idleEventInterval)
idleEventInterval - the interval.public void setFailedDeclarationRetryInterval(Long failedDeclarationRetryInterval)
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface ApplicationEventPublisherAwarepublic void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext in interface ApplicationContextAwareBeansExceptionpublic void setAutoStartup(Boolean autoStartup)
autoStartup - true for auto startup.AbstractMessageListenerContainer.setAutoStartup(boolean)public void setPhase(int phase)
phase - The phase.AbstractMessageListenerContainer.setPhase(int)public void setAfterReceivePostProcessors(MessagePostProcessor... postProcessors)
postProcessors - the post processors.AbstractMessageListenerContainer.setAfterReceivePostProcessors(MessagePostProcessor...)public void setBeforeSendReplyPostProcessors(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 setContainerConfigurer(Consumer<C> configurer)
Consumer that is invoked to enable setting other container properties not
exposed by this container factory.configurer - the configurer;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(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.