Class BaseRabbitListenerContainerFactory<C extends MessageListenerContainer>
java.lang.Object
org.springframework.amqp.rabbit.config.BaseRabbitListenerContainerFactory<C>
- Type Parameters:
C- the container type that the factory creates.
- All Implemented Interfaces:
RabbitListenerContainerFactory<C>
- Direct Known Subclasses:
AbstractRabbitListenerContainerFactory,StreamRabbitListenerContainerFactory
public abstract class BaseRabbitListenerContainerFactory<C extends MessageListenerContainer>
extends Object
implements RabbitListenerContainerFactory<C>
Base abstract class for listener container factories.
- Since:
- 2.4
- Author:
- Gary Russell
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyCommonOverrides(RabbitListenerEndpoint endpoint, C instance) abstract CCreate aMessageListenerContainerfor the givenRabbitListenerEndpoint.Advice[]protected BooleanReturn the defaultRequeueRejected.voidsetAdviceChain(Advice... adviceChain) voidsetBeforeSendReplyPostProcessors(MessagePostProcessor... postProcessors) Set post processors that will be applied before sending replies; added to each message listener adapter.voidsetDefaultRequeueRejected(Boolean requeueRejected) voidsetReplyRecoveryCallback(org.springframework.retry.RecoveryCallback<?> recoveryCallback) Set aRecoveryCallbackto invoke when retries are exhausted.voidsetRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate) Set aRetryTemplateto use when sending replies; added to each message listener adapter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.amqp.rabbit.listener.RabbitListenerContainerFactory
createListenerContainer
-
Constructor Details
-
BaseRabbitListenerContainerFactory
public BaseRabbitListenerContainerFactory()
-
-
Method Details
-
createListenerContainer
Description copied from interface:RabbitListenerContainerFactoryCreate aMessageListenerContainerfor the givenRabbitListenerEndpoint.- Specified by:
createListenerContainerin interfaceRabbitListenerContainerFactory<C extends MessageListenerContainer>- Parameters:
endpoint- the endpoint to configure.- Returns:
- the created container.
-
setDefaultRequeueRejected
- Parameters:
requeueRejected- true to reject by default.- See Also:
-
getDefaultRequeueRejected
Return the defaultRequeueRejected.- Returns:
- the defaultRequeueRejected.
-
setBeforeSendReplyPostProcessors
Set post processors that will be applied before sending replies; added to each message listener adapter.- Parameters:
postProcessors- the post processors.- See Also:
-
setRetryTemplate
public void setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate) Set aRetryTemplateto use when sending replies; added to each message listener adapter.- Parameters:
retryTemplate- the template.- See Also:
-
setReplyRecoveryCallback
public void setReplyRecoveryCallback(org.springframework.retry.RecoveryCallback<?> recoveryCallback) Set aRecoveryCallbackto invoke when retries are exhausted. Added to each message listener adapter. Only used if aretryTemplateis provided.- Parameters:
recoveryCallback- the recovery callback.- See Also:
-
applyCommonOverrides
-
getAdviceChain
- Returns:
- the advice chain that was set. Defaults to
null. - Since:
- 1.7.4
-
setAdviceChain
- Parameters:
adviceChain- the advice chain to set.- See Also:
-