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
ConstructorsConstructorDescriptionConcurrentPulsarListenerContainerFactory(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 forPulsarListenerannotations.protected ConcurrentPulsarMessageListenerContainer<T>protected voidinitializeContainer(ConcurrentPulsarMessageListenerContainer<T> instance, PulsarListenerEndpoint endpoint) voidsetConcurrency(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:
createContainerInstancein classAbstractPulsarListenerContainerFactory<ConcurrentPulsarMessageListenerContainer<T>,T>
-
initializeContainer
protected void initializeContainer(ConcurrentPulsarMessageListenerContainer<T> instance, PulsarListenerEndpoint endpoint) - Overrides:
initializeContainerin classAbstractPulsarListenerContainerFactory<ConcurrentPulsarMessageListenerContainer<T>,T>
-
createContainer
Description copied from interface:ListenerContainerFactoryCreate and configure a container without a listener; used to create containers that are not used forPulsarListenerannotations. Containers created using this method are not added to the listener endpoint registry.- Parameters:
topics- the topics.- Returns:
- the container.
-