Class ConcurrentPulsarMessageListenerContainer<T>
java.lang.Object
org.springframework.pulsar.core.AbstractPulsarMessageContainer
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, consumerBuilderCustomizer, deadLetterPolicy, lifecycleLock, negativeAckRedeliveryBackoff, pulsarConsumerErrorHandler
Fields inherited from class org.springframework.pulsar.core.AbstractPulsarMessageContainer
autoStartup, logger, running
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ConstructorDescriptionConcurrentPulsarMessageListenerContainer
(PulsarConsumerFactory<? super T> pulsarConsumerFactory, PulsarContainerProperties pulsarContainerProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoid
doPause()
void
doResume()
void
doStart()
void
doStop()
int
void
setConcurrency
(int concurrency) The maximum number of concurrentDefaultPulsarMessageListenerContainer
s running.Methods inherited from class org.springframework.pulsar.listener.AbstractPulsarMessageListenerContainer
getAckTimeoutkRedeliveryBackoff, getConsumerBuilderCustomizer, getContainerProperties, getDeadLetterPolicy, getNegativeAckRedeliveryBackoff, getPulsarConsumerErrorHandler, getPulsarConsumerFactory, isAutoStartup, isPaused, isRunning, pause, resume, setAckTimeoutRedeliveryBackoff, setAutoStartup, setConsumerCustomizer, setDeadLetterPolicy, setNegativeAckRedeliveryBackoff, setPaused, setPulsarConsumerErrorHandler, setRunning, setupMessageListener, start, stop
Methods inherited from class org.springframework.pulsar.core.AbstractPulsarMessageContainer
getApplicationContext, getApplicationEventPublisher, getBeanName, getPhase, setApplicationContext, setApplicationEventPublisher, setBeanName, setPhase
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.pulsar.listener.MessageListenerContainer
destroy
Methods inherited from interface org.springframework.context.SmartLifecycle
getPhase, stop
-
Constructor Details
-
ConcurrentPulsarMessageListenerContainer
public ConcurrentPulsarMessageListenerContainer(PulsarConsumerFactory<? super T> pulsarConsumerFactory, PulsarContainerProperties pulsarContainerProperties)
-
-
Method Details
-
getConcurrency
public int getConcurrency() -
setConcurrency
public void setConcurrency(int concurrency) The maximum number of concurrentDefaultPulsarMessageListenerContainer
s 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:
doStart
in classAbstractPulsarMessageContainer
-
doStop
public void doStop()- Specified by:
doStop
in classAbstractPulsarMessageContainer
-
getContainers
-
doPause
public void doPause()- Specified by:
doPause
in classAbstractPulsarMessageListenerContainer<T>
-
doResume
public void doResume()- Specified by:
doResume
in classAbstractPulsarMessageListenerContainer<T>
-