Class ConcurrentPulsarListenerContainerFactory<T>
java.lang.Object
org.springframework.pulsar.config.AbstractPulsarListenerContainerFactory<ConcurrentPulsarMessageListenerContainer<T>,T>
org.springframework.pulsar.config.ConcurrentPulsarListenerContainerFactory<T>
- Type Parameters:
T
- message type in the listener.
- All Implemented Interfaces:
Aware
,ApplicationContextAware
,ApplicationEventPublisherAware
,ListenerContainerFactory<PulsarMessageListenerContainer,
,PulsarListenerEndpoint> PulsarListenerContainerFactory
public class ConcurrentPulsarListenerContainerFactory<T>
extends AbstractPulsarListenerContainerFactory<ConcurrentPulsarMessageListenerContainer<T>,T>
Concrete implementation for
PulsarListenerContainerFactory
.- Author:
- Soby Chacko, Chris Bono, Alexander Preuß
-
Field Summary
Fields inherited from class org.springframework.pulsar.config.AbstractPulsarListenerContainerFactory
logger
-
Constructor Summary
ConstructorDescriptionConcurrentPulsarListenerContainerFactory
(PulsarConsumerFactory<? super T> consumerFactory, PulsarContainerProperties containerProperties, io.micrometer.observation.ObservationRegistry observationRegistry) -
Method Summary
Modifier and TypeMethodDescriptioncreateContainer
(String... topics) Create and configure a container without a listener; used to create containers that are not used forPulsarListener
annotations.protected ConcurrentPulsarMessageListenerContainer<T>
protected void
initializeContainer
(ConcurrentPulsarMessageListenerContainer<T> instance, PulsarListenerEndpoint endpoint) void
setConcurrency
(Integer concurrency) Specify the container concurrency.Methods inherited from class org.springframework.pulsar.config.AbstractPulsarListenerContainerFactory
createListenerContainer, getConsumerFactory, getContainerProperties, getObservationRegistry, setApplicationContext, setApplicationEventPublisher, setAutoStartup, setBatchListener, setMessageConverter, setPhase
-
Constructor Details
-
ConcurrentPulsarListenerContainerFactory
public ConcurrentPulsarListenerContainerFactory(PulsarConsumerFactory<? super T> consumerFactory, PulsarContainerProperties containerProperties, @Nullable io.micrometer.observation.ObservationRegistry observationRegistry)
-
-
Method Details
-
setConcurrency
Specify the container concurrency.- Parameters:
concurrency
- the number of consumers to create.
-
createContainerInstance
protected ConcurrentPulsarMessageListenerContainer<T> createContainerInstance(PulsarListenerEndpoint endpoint) - Specified by:
createContainerInstance
in classAbstractPulsarListenerContainerFactory<ConcurrentPulsarMessageListenerContainer<T>,
T>
-
initializeContainer
protected void initializeContainer(ConcurrentPulsarMessageListenerContainer<T> instance, PulsarListenerEndpoint endpoint) - Overrides:
initializeContainer
in classAbstractPulsarListenerContainerFactory<ConcurrentPulsarMessageListenerContainer<T>,
T>
-
createContainer
Description copied from interface:ListenerContainerFactory
Create and configure a container without a listener; used to create containers that are not used forPulsarListener
annotations. Containers created using this method are not added to the listener endpoint registry.- Parameters:
topics
- the topics.- Returns:
- the container.
-