Class StreamRabbitListenerContainerFactory
java.lang.Object
org.springframework.amqp.rabbit.config.BaseRabbitListenerContainerFactory<StreamListenerContainer>
org.springframework.rabbit.stream.config.StreamRabbitListenerContainerFactory
- All Implemented Interfaces:
RabbitListenerContainerFactory<StreamListenerContainer>
,Aware
,ApplicationContextAware
public class StreamRabbitListenerContainerFactory
extends BaseRabbitListenerContainerFactory<StreamListenerContainer>
Factory for StreamListenerContainer.
- Since:
- 2.4
- Author:
- Gary Russell
-
Constructor Summary
ConstructorDescriptionStreamRabbitListenerContainerFactory
(com.rabbitmq.stream.Environment environment) Construct an instance using the provided environment. -
Method Summary
Modifier and TypeMethodDescriptionprotected StreamListenerContainer
Create an instance of the listener container.Create aMessageListenerContainer
for the givenRabbitListenerEndpoint
.void
setConsumerCustomizer
(ConsumerCustomizer consumerCustomizer) Customize the consumer builder before it is built.void
setContainerCustomizer
(ContainerCustomizer<StreamListenerContainer> containerCustomizer) Set aContainerCustomizer
that is invoked after a container is created and configured to enable further customization of the container.void
setNativeListener
(boolean nativeListener) Set to true to create a container supporting a native RabbitMQ Stream message.void
setStreamListenerObservationConvention
(RabbitStreamListenerObservationConvention streamListenerObservationConvention) Set aRabbitStreamListenerObservationConvention
that is used when receiving native stream messages.Methods inherited from class org.springframework.amqp.rabbit.config.BaseRabbitListenerContainerFactory
applyCommonOverrides, getAdviceChain, getApplicationContext, getDefaultRequeueRejected, getMicrometerEnabled, getObservationEnabled, setAdviceChain, setApplicationContext, setBeforeSendReplyPostProcessors, setDefaultRequeueRejected, setMicrometerEnabled, setObservationEnabled, setReplyPostProcessorProvider, 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
-
Constructor Details
-
StreamRabbitListenerContainerFactory
public StreamRabbitListenerContainerFactory(com.rabbitmq.stream.Environment environment) Construct an instance using the provided environment.- Parameters:
environment
- the environment.
-
-
Method Details
-
setNativeListener
public void setNativeListener(boolean nativeListener) Set to true to create a container supporting a native RabbitMQ Stream message.- Parameters:
nativeListener
- true for native listeners.
-
setConsumerCustomizer
Customize the consumer builder before it is built.- Parameters:
consumerCustomizer
- the customizer.
-
setContainerCustomizer
public void setContainerCustomizer(ContainerCustomizer<StreamListenerContainer> containerCustomizer) Set aContainerCustomizer
that is invoked after a container is created and configured to enable further customization of the container.- Parameters:
containerCustomizer
- the customizer.
-
setStreamListenerObservationConvention
public void setStreamListenerObservationConvention(RabbitStreamListenerObservationConvention streamListenerObservationConvention) Set aRabbitStreamListenerObservationConvention
that is used when receiving native stream messages.- Parameters:
streamListenerObservationConvention
- the convention.- Since:
- 3.0.5
-
createListenerContainer
Description copied from interface:RabbitListenerContainerFactory
Create aMessageListenerContainer
for the givenRabbitListenerEndpoint
.- Specified by:
createListenerContainer
in interfaceRabbitListenerContainerFactory<StreamListenerContainer>
- Specified by:
createListenerContainer
in classBaseRabbitListenerContainerFactory<StreamListenerContainer>
- Parameters:
endpoint
- the endpoint to configure.- Returns:
- the created container.
-
createContainerInstance
Create an instance of the listener container.- Returns:
- the container.
-