Class AmqpMessageListenerContainerFactory
java.lang.Object
org.springframework.amqp.client.config.AmqpMessageListenerContainerFactory
- Direct Known Subclasses:
MethodAmqpMessageListenerContainerFactory
The configuration factory to produce
AmqpMessageListenerContainer instance
based on the provided AmqpListenerEndpoint.- Since:
- 4.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAmqpMessageListenerContainerFactory(AmqpConnectionFactory connectionFactory) Create an instance with the providedAmqpConnectionFactory. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureEndpoint(AmqpListenerEndpoint endpoint) createContainer(AmqpListenerEndpoint listenerEndpoint) Create aAmqpMessageListenerContainerinstance based on the providedAmqpListenerEndpoint.voidsetAdviceChain(org.aopalliance.aop.Advice... advices) Set The default advice chain for container instances created by this factory.voidsetAutoAccept(boolean autoAccept) The default auto accept flag for container instances created by this factory.voidsetAutoStartup(boolean autoStartup) The default auto startup flag for container instances created by this factory.voidsetConcurrency(int concurrency) The default concurrency for container instances created by this factory.voidsetErrorHandler(org.springframework.util.ErrorHandler errorHandler) TheErrorHandlerfor container instances created by this factory.voidsetGracefulShutdownPeriod(Duration gracefulShutdownPeriod) The defaultgracefulShutdownPeriodfor container instances created by this factory.voidsetInitialCredits(int initialCredits) The default initial credits value for container instances created by this factory.voidsetReceiveTimeout(Duration receiveTimeout) The defaultreceiveTimeoutfor container instances created by this factory.voidsetRecoveryBackOff(org.springframework.util.backoff.BackOff recoveryBackOff) The defaultBackOfffor a failed consumer recovery in container instances created by this factory.voidsetRecoveryInterval(Duration recoveryInterval) The default recovery interval for container instances created by this factory.voidsetTaskExecutor(Executor taskExecutor) The defaultExecutorfor container instances created by this factory.
-
Constructor Details
-
AmqpMessageListenerContainerFactory
Create an instance with the providedAmqpConnectionFactory.- Parameters:
connectionFactory- the connection factory to use.
-
-
Method Details
-
setConcurrency
public void setConcurrency(int concurrency) The default concurrency for container instances created by this factory. Can be overridden byAmqpListenerEndpoint.getConcurrency(). Each AMQP address runs in its own consumer; set this property to create multiple consumers for each AMQP address.- Parameters:
concurrency- the consumers per AMQP address.- See Also:
-
setAutoStartup
public void setAutoStartup(boolean autoStartup) The default auto startup flag for container instances created by this factory. Can be overridden byAmqpListenerEndpoint.getAutoStartup().- Parameters:
autoStartup- the auto startup flag.- See Also:
-
setAutoAccept
public void setAutoAccept(boolean autoAccept) The default auto accept flag for container instances created by this factory. Can be overridden byAmqpListenerEndpoint.getAutoAccept().- Parameters:
autoAccept- flag to use.- See Also:
-
setTaskExecutor
The defaultExecutorfor container instances created by this factory. Can be overridden byAmqpListenerEndpoint.getTaskExecutor().- Parameters:
taskExecutor- the task executor.- See Also:
-
setInitialCredits
public void setInitialCredits(int initialCredits) The default initial credits value for container instances created by this factory. Can be overridden byAmqpListenerEndpoint.getInitialCredits().- Parameters:
initialCredits- the initial credits.- See Also:
-
setReceiveTimeout
The defaultreceiveTimeoutfor container instances created by this factory. Can be overridden byAmqpListenerEndpoint.getReceiveTimeout().- Parameters:
receiveTimeout- the timeout for receiving messages.- See Also:
-
setGracefulShutdownPeriod
The defaultgracefulShutdownPeriodfor container instances created by this factory. Can be overridden byAmqpListenerEndpoint.getGracefulShutdownPeriod().- Parameters:
gracefulShutdownPeriod- the timeout for shutdown.- See Also:
-
setRecoveryInterval
The default recovery interval for container instances created by this factory.- Parameters:
recoveryInterval- the interval between consumer recovery attempts.- Since:
- 4.1.1
- See Also:
-
setRecoveryBackOff
public void setRecoveryBackOff(org.springframework.util.backoff.BackOff recoveryBackOff) The defaultBackOfffor a failed consumer recovery in container instances created by this factory.- Parameters:
recoveryBackOff- theBackOffto use for the consumer recovery.- Since:
- 4.1.1
- See Also:
-
setAdviceChain
public void setAdviceChain(org.aopalliance.aop.Advice... advices) Set The default advice chain for container instances created by this factory. Can be overridden byAmqpListenerEndpoint.getAdviceChain().- Parameters:
advices- the advice chain.
-
setErrorHandler
public void setErrorHandler(org.springframework.util.ErrorHandler errorHandler) TheErrorHandlerfor container instances created by this factory.- Parameters:
errorHandler- the error handler.
-
createContainer
Create aAmqpMessageListenerContainerinstance based on the providedAmqpListenerEndpoint.- Parameters:
listenerEndpoint- the endpoint to configure aAmqpMessageListenerContainerinstance.- Returns:
- the container instance.
-
configureEndpoint
-