Class ConcurrentPulsarMessageListenerContainer<T>
java.lang.Object
org.springframework.pulsar.listener.AbstractPulsarMessageListenerContainer<T>
org.springframework.pulsar.listener.ConcurrentPulsarMessageListenerContainer<T>
- Type Parameters:
T- the payload type.
- All Implemented Interfaces:
Aware,BeanNameAware,DisposableBean,ApplicationContextAware,ApplicationEventPublisherAware,Lifecycle,Phased,SmartLifecycle,MessageListenerContainer,PulsarMessageListenerContainer
public class ConcurrentPulsarMessageListenerContainer<T>
extends AbstractPulsarMessageListenerContainer<T>
Creates a concurrent execution context of
DefaultPulsarMessageListenerContainer
instances based on the concurrency. Concurrency > 1 is not
allowed for exclusive subscriptions.- Author:
- Soby Chacko, Alexander Preuß, Chris Bono
-
Field Summary
Fields inherited from class org.springframework.pulsar.listener.AbstractPulsarMessageListenerContainer
ackTimeoutRedeliveryBackoff, deadLetterPolicy, lifecycleMonitor, logger, negativeAckRedeliveryBackoff, pulsarConsumerErrorHandlerFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionConcurrentPulsarMessageListenerContainer(PulsarConsumerFactory<? super T> pulsarConsumerFactory, PulsarContainerProperties pulsarContainerProperties, io.micrometer.observation.ObservationRegistry observationRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoiddoStart()voiddoStop()intvoidsetConcurrency(int concurrency) The maximum number of concurrentDefaultPulsarMessageListenerContainers running.Methods inherited from class org.springframework.pulsar.listener.AbstractPulsarMessageListenerContainer
getAckTimeoutkRedeliveryBackoff, getApplicationContext, getApplicationEventPublisher, getBeanName, getContainerProperties, getDeadLetterPolicy, getNegativeAckRedeliveryBackoff, getObservationRegistry, getPhase, getPulsarConsumerErrorHandler, getPulsarConsumerFactory, isAutoStartup, isRunning, setAckTimeoutRedeliveryBackoff, setApplicationContext, setApplicationEventPublisher, setAutoStartup, setBeanName, setDeadLetterPolicy, setNegativeAckRedeliveryBackoff, setPhase, setPulsarConsumerErrorHandler, setRunning, setupMessageListener, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.pulsar.listener.MessageListenerContainer
destroyMethods inherited from interface org.springframework.context.SmartLifecycle
stop
-
Constructor Details
-
ConcurrentPulsarMessageListenerContainer
public ConcurrentPulsarMessageListenerContainer(PulsarConsumerFactory<? super T> pulsarConsumerFactory, PulsarContainerProperties pulsarContainerProperties, @Nullable io.micrometer.observation.ObservationRegistry observationRegistry)
-
-
Method Details
-
getConcurrency
public int getConcurrency() -
setConcurrency
public void setConcurrency(int concurrency) The maximum number of concurrentDefaultPulsarMessageListenerContainers running. Messages from within the same partition will be processed sequentially. Concurrency > 1 is not allowed for exclusive subscriptions.- Parameters:
concurrency- the concurrency.
-
doStart
public void doStart()- Specified by:
doStartin classAbstractPulsarMessageListenerContainer<T>
-
doStop
public void doStop()- Specified by:
doStopin classAbstractPulsarMessageListenerContainer<T>
-
getContainers
-