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 TypeMethodDescriptionvoid
protected abstract AbstractPulsarMessageToSpringMessageAdapter<K>
createMessageListener
(PulsarMessageListenerContainer container, MessageConverter messageConverter) Return the autoStartup for this endpoint's container.protected BeanExpressionContext
protected BeanFactory
protected BeanResolver
Return the concurrency for this endpoint's container.getId()
Return the id of this endpoint.protected BeanExpressionResolver
org.apache.pulsar.common.schema.SchemaType
Return the schema type for this endpoint's container.Return the subscription name for this endpoint's container.org.apache.pulsar.client.api.SubscriptionType
Return 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.boolean
void
setAckMode
(AckMode ackMode) void
setAutoStartup
(Boolean autoStartup) void
setBatchListener
(boolean batchListener) void
setBeanFactory
(BeanFactory beanFactory) void
setConcurrency
(Integer concurrency) Set the concurrency for this endpoint's container.void
setConsumerProperties
(Properties consumerProperties) void
void
setSchemaType
(org.apache.pulsar.common.schema.SchemaType schemaType) void
setSubscriptionName
(String subscriptionName) void
setSubscriptionType
(org.apache.pulsar.client.api.SubscriptionType subscriptionType) void
setTopicPattern
(String topicPattern) void
void
setupListenerContainer
(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:
setBeanFactory
in interfaceBeanFactoryAware
- Throws:
BeansException
-
getBeanFactory
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceInitializingBean
-
getResolver
-
getBeanExpressionContext
-
getBeanResolver
-
setSubscriptionName
-
getSubscriptionName
Description copied from interface:ListenerEndpoint
Return the subscription name for this endpoint's container.- Specified by:
getSubscriptionName
in interfaceListenerEndpoint<K>
- Returns:
- the subscription name.
-
setId
-
getId
Description copied from interface:ListenerEndpoint
Return the id of this endpoint.- Specified by:
getId
in 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:ListenerEndpoint
Return the topics for this endpoint's container.- Specified by:
getTopics
in interfaceListenerEndpoint<K>
- Returns:
- the topics.
-
setTopicPattern
-
getTopicPattern
Description copied from interface:ListenerEndpoint
Return the topic pattern for this endpoint's container.- Specified by:
getTopicPattern
in interfaceListenerEndpoint<K>
- Returns:
- the topic pattern.
-
getAutoStartup
Description copied from interface:ListenerEndpoint
Return the autoStartup for this endpoint's container.- Specified by:
getAutoStartup
in interfaceListenerEndpoint<K>
- Returns:
- the autoStartup.
-
setAutoStartup
-
setupListenerContainer
public void setupListenerContainer(PulsarMessageListenerContainer listenerContainer, @Nullable MessageConverter messageConverter) Description copied from interface:ListenerEndpoint
Setup 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
queues
and themessageListener
to use but an implementation may override any default setting that was already set.- Specified by:
setupListenerContainer
in interfaceListenerEndpoint<K>
- Parameters:
listenerContainer
- the listener container to configuremessageConverter
- the message converter - can be null
-
createMessageListener
protected abstract AbstractPulsarMessageToSpringMessageAdapter<K> createMessageListener(PulsarMessageListenerContainer container, @Nullable MessageConverter messageConverter) -
setConsumerProperties
-
getConsumerProperties
- Specified by:
getConsumerProperties
in interfacePulsarListenerEndpoint
-
getBatchListener
-
setBatchListener
public void setBatchListener(boolean batchListener) -
isBatchListener
public boolean isBatchListener()- Specified by:
isBatchListener
in interfacePulsarListenerEndpoint
-
getSubscriptionType
public org.apache.pulsar.client.api.SubscriptionType getSubscriptionType()Description copied from interface:ListenerEndpoint
Return the subscription type for this endpoint's container.- Specified by:
getSubscriptionType
in 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:ListenerEndpoint
Return the schema type for this endpoint's container.- Specified by:
getSchemaType
in interfaceListenerEndpoint<K>
- Returns:
- the schema type.
-
setSchemaType
public void setSchemaType(org.apache.pulsar.common.schema.SchemaType schemaType) -
getConcurrency
Description copied from interface:ListenerEndpoint
Return the concurrency for this endpoint's container.- Specified by:
getConcurrency
in interfaceListenerEndpoint<K>
- Returns:
- the concurrency.
-
setConcurrency
Set the concurrency for this endpoint's container.- Parameters:
concurrency
- the concurrency.
-
getAckMode
- Specified by:
getAckMode
in interfacePulsarListenerEndpoint
-
setAckMode
-