public class DirectRabbitListenerContainerFactory extends AbstractRabbitListenerContainerFactory<DirectMessageListenerContainer>
RabbitListenerContainerFactory implementation to build a regular
DirectMessageListenerContainer.counter, logger| Constructor and Description |
|---|
DirectRabbitListenerContainerFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected DirectMessageListenerContainer |
createContainerInstance()
Create an empty container instance.
|
protected void |
initializeContainer(DirectMessageListenerContainer instance,
RabbitListenerEndpoint endpoint)
Further initialize the specified container.
|
void |
setConsumersPerQueue(Integer consumersPerQueue)
Each queue runs in its own consumer; set this property to create multiple
consumers for each queue.
|
void |
setMonitorInterval(long monitorInterval)
Set how often to run a task to check for failed consumers and idle containers.
|
void |
setTaskScheduler(org.springframework.scheduling.TaskScheduler taskScheduler)
Set the task scheduler to use for the task that monitors idle containers and
failed consumers.
|
createListenerContainer, getAdviceChain, setAcknowledgeMode, setAdviceChain, setAfterReceivePostProcessors, setApplicationContext, setApplicationEventPublisher, setAutoStartup, setChannelTransacted, setConnectionFactory, setConsumerTagStrategy, setDefaultRequeueRejected, setErrorHandler, setFailedDeclarationRetryInterval, setIdleEventInterval, setMessageConverter, setMismatchedQueuesFatal, setMissingQueuesFatal, setPhase, setPrefetchCount, setRecoveryBackOff, setRecoveryInterval, setTaskExecutor, setTransactionManagerpublic DirectRabbitListenerContainerFactory()
public void setTaskScheduler(org.springframework.scheduling.TaskScheduler taskScheduler)
taskScheduler - the scheduler.public void setMonitorInterval(long monitorInterval)
monitorInterval - the interval; default 10000 but it will be adjusted down
to the smallest of this, idleEventInterval / 2
(if configured) or
failedDeclarationRetryInterval.public void setConsumersPerQueue(Integer consumersPerQueue)
consumersPerQueue - the consumers per queue.protected DirectMessageListenerContainer createContainerInstance()
AbstractRabbitListenerContainerFactorycreateContainerInstance in class AbstractRabbitListenerContainerFactory<DirectMessageListenerContainer>protected void initializeContainer(DirectMessageListenerContainer instance, RabbitListenerEndpoint endpoint)
AbstractRabbitListenerContainerFactorySubclasses can inherit from this method to apply extra configuration if necessary.
initializeContainer in class AbstractRabbitListenerContainerFactory<DirectMessageListenerContainer>instance - the container instance to configure.endpoint - the endpoint.