Class SimpleRabbitListenerContainerFactory
- java.lang.Object
-
- org.springframework.amqp.rabbit.config.BaseRabbitListenerContainerFactory<C>
-
- org.springframework.amqp.rabbit.config.AbstractRabbitListenerContainerFactory<SimpleMessageListenerContainer>
-
- org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory
-
- All Implemented Interfaces:
RabbitListenerContainerFactory<SimpleMessageListenerContainer>
,Aware
,ApplicationContextAware
,ApplicationEventPublisherAware
public class SimpleRabbitListenerContainerFactory extends AbstractRabbitListenerContainerFactory<SimpleMessageListenerContainer>
ARabbitListenerContainerFactory
implementation to build a regularSimpleMessageListenerContainer
.This should be the default for most users and a good transition paths for those that are used to build such container definition manually.
- Since:
- 1.4
- Author:
- Stephane Nicoll, Gary Russell, Artem Bilan, Dustin Schultz
-
-
Field Summary
-
Fields inherited from class org.springframework.amqp.rabbit.config.AbstractRabbitListenerContainerFactory
counter, logger
-
-
Constructor Summary
Constructors Constructor Description SimpleRabbitListenerContainerFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SimpleMessageListenerContainer
createContainerInstance()
Create an empty container instance.protected void
initializeContainer(SimpleMessageListenerContainer instance, RabbitListenerEndpoint endpoint)
Further initialize the specified container.void
setBatchSize(Integer batchSize)
void
setConcurrentConsumers(Integer concurrency)
void
setConsecutiveActiveTrigger(Integer minConsecutiveActive)
void
setConsecutiveIdleTrigger(Integer minConsecutiveIdle)
void
setConsumerBatchEnabled(boolean consumerBatchEnabled)
Set to true to present a list of messages based on thesetBatchSize(Integer)
, if the listener supports it.void
setMaxConcurrentConsumers(Integer maxConcurrency)
void
setReceiveTimeout(Long receiveTimeout)
void
setStartConsumerMinInterval(Long minStartInterval)
void
setStopConsumerMinInterval(Long minStopInterval)
-
Methods inherited from class org.springframework.amqp.rabbit.config.AbstractRabbitListenerContainerFactory
createListenerContainer, getAdviceChain, setAcknowledgeMode, setAdviceChain, setAfterReceivePostProcessors, setApplicationContext, setApplicationEventPublisher, setAutoStartup, setBatchingStrategy, setBatchListener, setChannelTransacted, setConnectionFactory, setConsumerTagStrategy, setContainerCustomizer, setDeBatchingEnabled, setErrorHandler, setFailedDeclarationRetryInterval, setGlobalQos, setIdleEventInterval, setMessageConverter, setMismatchedQueuesFatal, setMissingQueuesFatal, setPhase, setPrefetchCount, setRecoveryBackOff, setRecoveryInterval, setTaskExecutor, setTransactionManager
-
Methods inherited from class org.springframework.amqp.rabbit.config.BaseRabbitListenerContainerFactory
applyCommonOverrides, getDefaultRequeueRejected, setBeforeSendReplyPostProcessors, setDefaultRequeueRejected, setReplyRecoveryCallback, setRetryTemplate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.amqp.rabbit.listener.RabbitListenerContainerFactory
createListenerContainer
-
-
-
-
Method Detail
-
setBatchSize
public void setBatchSize(Integer batchSize)
- Parameters:
batchSize
- the batch size.- Since:
- 2.2
- See Also:
SimpleMessageListenerContainer.setBatchSize(int)
-
setConcurrentConsumers
public void setConcurrentConsumers(Integer concurrency)
- Parameters:
concurrency
- the minimum number of consumers to create.- See Also:
SimpleMessageListenerContainer.setConcurrentConsumers(int)
-
setMaxConcurrentConsumers
public void setMaxConcurrentConsumers(Integer maxConcurrency)
- Parameters:
maxConcurrency
- the maximum number of consumers.- See Also:
SimpleMessageListenerContainer.setMaxConcurrentConsumers(int)
-
setStartConsumerMinInterval
public void setStartConsumerMinInterval(Long minStartInterval)
- Parameters:
minStartInterval
- The minimum interval between new consumer starts.- See Also:
SimpleMessageListenerContainer.setStartConsumerMinInterval(long)
-
setStopConsumerMinInterval
public void setStopConsumerMinInterval(Long minStopInterval)
- Parameters:
minStopInterval
- The minimum interval between consumer stops.- See Also:
SimpleMessageListenerContainer.setStopConsumerMinInterval(long)
-
setConsecutiveActiveTrigger
public void setConsecutiveActiveTrigger(Integer minConsecutiveActive)
- Parameters:
minConsecutiveActive
- The number of consecutive receives to trigger a new consumer.- See Also:
SimpleMessageListenerContainer.setConsecutiveActiveTrigger(int)
-
setConsecutiveIdleTrigger
public void setConsecutiveIdleTrigger(Integer minConsecutiveIdle)
- Parameters:
minConsecutiveIdle
- The number of consecutive timeouts to trigger stopping a consumer.- See Also:
SimpleMessageListenerContainer.setConsecutiveIdleTrigger(int)
-
setReceiveTimeout
public void setReceiveTimeout(Long receiveTimeout)
- Parameters:
receiveTimeout
- the timeout.- See Also:
SimpleMessageListenerContainer.setReceiveTimeout(long)
-
setConsumerBatchEnabled
public void setConsumerBatchEnabled(boolean consumerBatchEnabled)
Set to true to present a list of messages based on thesetBatchSize(Integer)
, if the listener supports it.- Parameters:
consumerBatchEnabled
- true to create message batches in the container.- Since:
- 2.2
- See Also:
setBatchSize(Integer)
-
createContainerInstance
protected SimpleMessageListenerContainer createContainerInstance()
Description copied from class:AbstractRabbitListenerContainerFactory
Create an empty container instance.- Specified by:
createContainerInstance
in classAbstractRabbitListenerContainerFactory<SimpleMessageListenerContainer>
- Returns:
- the new container instance.
-
initializeContainer
protected void initializeContainer(SimpleMessageListenerContainer instance, RabbitListenerEndpoint endpoint)
Description copied from class:AbstractRabbitListenerContainerFactory
Further initialize the specified container.Subclasses can inherit from this method to apply extra configuration if necessary.
- Overrides:
initializeContainer
in classAbstractRabbitListenerContainerFactory<SimpleMessageListenerContainer>
- Parameters:
instance
- the container instance to configure.endpoint
- the endpoint.
-
-