Class AbstractPulsarListenerEndpoint<K>
java.lang.Object
org.springframework.pulsar.config.AbstractPulsarListenerEndpoint<K>
- Type Parameters:
K- Message payload type.
- All Implemented Interfaces:
Aware,BeanFactoryAware,InitializingBean,ListenerEndpoint<PulsarMessageListenerContainer>,PulsarListenerEndpoint
- Direct Known Subclasses:
MethodPulsarListenerEndpoint
public abstract class AbstractPulsarListenerEndpoint<K>
extends Object
implements PulsarListenerEndpoint, BeanFactoryAware, InitializingBean
Base implementation for
PulsarListenerEndpoint.- Author:
- Soby Chacko, Alexander Preuß
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected abstract PulsarMessagingMessageListenerAdapter<K>createMessageListener(PulsarMessageListenerContainer container, MessageConverter messageConverter) Return the autoStartup for this endpoint's container.protected BeanExpressionContextprotected BeanFactoryprotected BeanResolverReturn the concurrency for this endpoint's container.getId()Return the id of this endpoint.protected BeanExpressionResolverorg.apache.pulsar.common.schema.SchemaTypeReturn the schema type for this endpoint's container.Return the subscription name for this endpoint's container.org.apache.pulsar.client.api.SubscriptionTypeReturn the subscription type for this endpoint's container.Return the topic pattern for this endpoint's container.Return the topics for this endpoint's container.booleanvoidsetAckMode(AckMode ackMode) voidsetAutoStartup(Boolean autoStartup) voidsetBatchListener(boolean batchListener) voidsetBeanFactory(BeanFactory beanFactory) voidsetConcurrency(Integer concurrency) Set the concurrency for this endpoint's container.voidsetConsumerProperties(Properties consumerProperties) voidvoidsetSchemaType(org.apache.pulsar.common.schema.SchemaType schemaType) voidsetSubscriptionName(String subscriptionName) voidsetSubscriptionType(org.apache.pulsar.client.api.SubscriptionType subscriptionType) voidsetTopicPattern(String topicPattern) voidvoidsetupListenerContainer(PulsarMessageListenerContainer listenerContainer, MessageConverter messageConverter) Setup the specified message listener container with the model defined by this endpoint.
-
Constructor Details
-
AbstractPulsarListenerEndpoint
public AbstractPulsarListenerEndpoint()
-
-
Method Details
-
setBeanFactory
- Specified by:
setBeanFactoryin interfaceBeanFactoryAware- Throws:
BeansException
-
getBeanFactory
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceInitializingBean
-
getResolver
-
getBeanExpressionContext
-
getBeanResolver
-
setSubscriptionName
-
getSubscriptionName
Description copied from interface:ListenerEndpointReturn the subscription name for this endpoint's container.- Specified by:
getSubscriptionNamein interfaceListenerEndpoint<K>- Returns:
- the subscription name.
-
setId
-
getId
Description copied from interface:ListenerEndpointReturn the id of this endpoint.- Specified by:
getIdin interfaceListenerEndpoint<K>- Returns:
- the id of this endpoint. The id can be further qualified when the endpoint is resolved against its actual listener container.
- See Also:
-
setTopics
-
getTopics
Description copied from interface:ListenerEndpointReturn the topics for this endpoint's container.- Specified by:
getTopicsin interfaceListenerEndpoint<K>- Returns:
- the topics.
-
setTopicPattern
-
getTopicPattern
Description copied from interface:ListenerEndpointReturn the topic pattern for this endpoint's container.- Specified by:
getTopicPatternin interfaceListenerEndpoint<K>- Returns:
- the topic pattern.
-
getAutoStartup
Description copied from interface:ListenerEndpointReturn the autoStartup for this endpoint's container.- Specified by:
getAutoStartupin interfaceListenerEndpoint<K>- Returns:
- the autoStartup.
-
setAutoStartup
-
setupListenerContainer
public void setupListenerContainer(PulsarMessageListenerContainer listenerContainer, @Nullable MessageConverter messageConverter) Description copied from interface:ListenerEndpointSetup the specified message listener container with the model defined by this endpoint.This endpoint must provide the requested missing option(s) of the specified container to make it usable. Usually, this is about setting the
queuesand themessageListenerto use but an implementation may override any default setting that was already set.- Specified by:
setupListenerContainerin interfaceListenerEndpoint<K>- Parameters:
listenerContainer- the listener container to configuremessageConverter- the message converter - can be null
-
createMessageListener
protected abstract PulsarMessagingMessageListenerAdapter<K> createMessageListener(PulsarMessageListenerContainer container, @Nullable MessageConverter messageConverter) -
setConsumerProperties
-
getConsumerProperties
- Specified by:
getConsumerPropertiesin interfacePulsarListenerEndpoint
-
getBatchListener
-
setBatchListener
public void setBatchListener(boolean batchListener) -
isBatchListener
public boolean isBatchListener()- Specified by:
isBatchListenerin interfacePulsarListenerEndpoint
-
getSubscriptionType
public org.apache.pulsar.client.api.SubscriptionType getSubscriptionType()Description copied from interface:ListenerEndpointReturn the subscription type for this endpoint's container.- Specified by:
getSubscriptionTypein interfaceListenerEndpoint<K>- Returns:
- the subscription type.
-
setSubscriptionType
public void setSubscriptionType(org.apache.pulsar.client.api.SubscriptionType subscriptionType) -
getSchemaType
public org.apache.pulsar.common.schema.SchemaType getSchemaType()Description copied from interface:ListenerEndpointReturn the schema type for this endpoint's container.- Specified by:
getSchemaTypein interfaceListenerEndpoint<K>- Returns:
- the schema type.
-
setSchemaType
public void setSchemaType(org.apache.pulsar.common.schema.SchemaType schemaType) -
getConcurrency
Description copied from interface:ListenerEndpointReturn the concurrency for this endpoint's container.- Specified by:
getConcurrencyin interfaceListenerEndpoint<K>- Returns:
- the concurrency.
-
setConcurrency
Set the concurrency for this endpoint's container.- Parameters:
concurrency- the concurrency.
-
getAckMode
- Specified by:
getAckModein interfacePulsarListenerEndpoint
-
setAckMode
-