Class AbstractPulsarReaderEndpoint<K>
java.lang.Object
org.springframework.pulsar.config.AbstractPulsarReaderEndpoint<K>
- Type Parameters:
K
- Message payload type.
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,InitializingBean
,PulsarReaderEndpoint<PulsarMessageReaderContainer>
- Direct Known Subclasses:
MethodPulsarReaderEndpoint
public abstract class AbstractPulsarReaderEndpoint<K>
extends Object
implements PulsarReaderEndpoint<PulsarMessageReaderContainer>, BeanFactoryAware, InitializingBean
Base implementation for
PulsarListenerEndpoint
.- Author:
- Soby Chacko
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected abstract AbstractPulsarMessageToSpringMessageAdapter<K>
createReaderListener
(PulsarMessageReaderContainer container, MessageConverter messageConverter) protected BeanExpressionContext
protected BeanFactory
protected BeanResolver
getId()
Return the id of this endpoint.protected BeanExpressionResolver
org.apache.pulsar.common.schema.SchemaType
Return the schema type for this endpoint's container.org.apache.pulsar.client.api.MessageId
Return the topics for this endpoint's container.void
setAutoStartup
(Boolean autoStartup) void
setBeanFactory
(BeanFactory beanFactory) void
void
setSchemaType
(org.apache.pulsar.common.schema.SchemaType schemaType) void
setStartMessageId
(org.apache.pulsar.client.api.MessageId startMessageId) void
setSubscriptionName
(String subscriptionName) void
void
setupListenerContainer
(PulsarMessageReaderContainer listenerContainer, MessageConverter messageConverter) Setup the specified message listener container with the model defined by this endpoint.
-
Constructor Details
-
AbstractPulsarReaderEndpoint
public AbstractPulsarReaderEndpoint()
-
-
Method Details
-
setBeanFactory
- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Throws:
BeansException
-
getBeanFactory
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceInitializingBean
-
getResolver
-
getBeanExpressionContext
-
getBeanResolver
-
setSubscriptionName
-
setId
-
getId
Description copied from interface:PulsarReaderEndpoint
Return the id of this endpoint.- Specified by:
getId
in interfacePulsarReaderEndpoint<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:PulsarReaderEndpoint
Return the topics for this endpoint's container.- Specified by:
getTopics
in interfacePulsarReaderEndpoint<K>
- Returns:
- the topics.
-
getAutoStartup
- Specified by:
getAutoStartup
in interfacePulsarReaderEndpoint<K>
-
setAutoStartup
-
setupListenerContainer
public void setupListenerContainer(PulsarMessageReaderContainer listenerContainer, @Nullable MessageConverter messageConverter) Description copied from interface:PulsarReaderEndpoint
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 interfacePulsarReaderEndpoint<K>
- Parameters:
listenerContainer
- the listener container to configuremessageConverter
- message converter used
-
createReaderListener
protected abstract AbstractPulsarMessageToSpringMessageAdapter<K> createReaderListener(PulsarMessageReaderContainer container, @Nullable MessageConverter messageConverter) -
getSchemaType
public org.apache.pulsar.common.schema.SchemaType getSchemaType()Description copied from interface:PulsarReaderEndpoint
Return the schema type for this endpoint's container.- Specified by:
getSchemaType
in interfacePulsarReaderEndpoint<K>
- Returns:
- the schema type.
-
setSchemaType
public void setSchemaType(org.apache.pulsar.common.schema.SchemaType schemaType) -
getStartMessageId
public org.apache.pulsar.client.api.MessageId getStartMessageId()- Specified by:
getStartMessageId
in interfacePulsarReaderEndpoint<K>
-
setStartMessageId
public void setStartMessageId(org.apache.pulsar.client.api.MessageId startMessageId)
-