Class StreamListenerContainer
java.lang.Object
org.springframework.rabbit.stream.listener.StreamListenerContainer
- All Implemented Interfaces:
org.springframework.amqp.rabbit.listener.MessageListenerContainer,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
public class StreamListenerContainer
extends Object
implements org.springframework.amqp.rabbit.listener.MessageListenerContainer, org.springframework.beans.factory.BeanNameAware
A listener container for RabbitMQ Streams.
- Since:
- 2.4
-
Field Summary
FieldsFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionStreamListenerContainer(com.rabbitmq.stream.Environment environment) Construct an instance using the provided environment.StreamListenerContainer(com.rabbitmq.stream.Environment environment, com.rabbitmq.stream.Codec codec) Construct an instance using the provided environment and codec. -
Method Summary
Modifier and TypeMethodDescriptionReturn the bean name.The 'id' attribute of the listener.booleanbooleanvoidsetAdviceChain(org.aopalliance.aop.Advice... advices) Set an advice chain to apply to the listener.voidsetAutoStartup(boolean autoStart) voidsetBeanName(String beanName) voidsetConsumerCustomizer(ConsumerCustomizer consumerCustomizer) Customize the consumer builder before it is built.voidsetListenerId(String listenerId) voidsetQueueNames(String... queueNames) voidsetStreamConverter(StreamMessageConverter messageConverter) voidsetupMessageListener(org.springframework.amqp.core.MessageListener messageListener) voidstart()voidstop()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.MessageListenerContainer
afterPropertiesSet, isConsumerBatchEnabled, lazyLoadMethods inherited from interface org.springframework.context.SmartLifecycle
getPhase, stop
-
Field Details
-
logger
protected org.apache.commons.logging.Log logger
-
-
Constructor Details
-
StreamListenerContainer
public StreamListenerContainer(com.rabbitmq.stream.Environment environment) Construct an instance using the provided environment.- Parameters:
environment- the environment.
-
StreamListenerContainer
public StreamListenerContainer(com.rabbitmq.stream.Environment environment, @Nullable com.rabbitmq.stream.Codec codec) Construct an instance using the provided environment and codec.- Parameters:
environment- the environment.codec- the codec used to create reply messages.
-
-
Method Details
-
setQueueNames
- Specified by:
setQueueNamesin interfaceorg.springframework.amqp.rabbit.listener.MessageListenerContainer
-
getStreamConverter
- Returns:
- the converter.
-
setStreamConverter
- Parameters:
messageConverter- the converter.
-
setConsumerCustomizer
Customize the consumer builder before it is built.- Parameters:
consumerCustomizer- the customizer.
-
getListenerId
The 'id' attribute of the listener.- Returns:
- the id (or the container bean name if no id set).
-
setListenerId
- Specified by:
setListenerIdin interfaceorg.springframework.amqp.rabbit.listener.MessageListenerContainer
-
getBeanName
Return the bean name.- Returns:
- the bean name.
-
setBeanName
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
setAutoStartup
public void setAutoStartup(boolean autoStart) - Specified by:
setAutoStartupin interfaceorg.springframework.amqp.rabbit.listener.MessageListenerContainer
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
setAdviceChain
public void setAdviceChain(org.aopalliance.aop.Advice... advices) Set an advice chain to apply to the listener.- Parameters:
advices- the advice chain.- Since:
- 2.4.5
-
getMessageListener
- Specified by:
getMessageListenerin interfaceorg.springframework.amqp.rabbit.listener.MessageListenerContainer
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
setupMessageListener
public void setupMessageListener(org.springframework.amqp.core.MessageListener messageListener) - Specified by:
setupMessageListenerin interfaceorg.springframework.amqp.rabbit.listener.MessageListenerContainer
-