Class AbstractPulsarListenerEndpoint<K>

java.lang.Object
org.springframework.pulsar.config.AbstractPulsarListenerEndpoint<K>
Type Parameters:
K - Message payload type.
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, ListenerEndpoint<PulsarMessageListenerContainer>, PulsarListenerEndpoint
Direct Known Subclasses:
MethodPulsarListenerEndpoint

public abstract class AbstractPulsarListenerEndpoint<K> extends Object implements PulsarListenerEndpoint, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean
Base implementation for PulsarListenerEndpoint.
  • Constructor Details

    • AbstractPulsarListenerEndpoint

      public AbstractPulsarListenerEndpoint()
  • Method Details

    • setBeanFactory

      public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
      Specified by:
      setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
      Throws:
      org.springframework.beans.BeansException
    • getBeanFactory

      @Nullable protected org.springframework.beans.factory.BeanFactory getBeanFactory()
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • getResolver

      @Nullable protected org.springframework.beans.factory.config.BeanExpressionResolver getResolver()
    • getBeanExpressionContext

      @Nullable protected org.springframework.beans.factory.config.BeanExpressionContext getBeanExpressionContext()
    • getBeanResolver

      @Nullable protected org.springframework.expression.BeanResolver getBeanResolver()
    • setSubscriptionName

      public void setSubscriptionName(String subscriptionName)
    • getSubscriptionName

      @Nullable public String getSubscriptionName()
      Description copied from interface: ListenerEndpoint
      Return the subscription name for this endpoint's container.
      Specified by:
      getSubscriptionName in interface ListenerEndpoint<K>
      Returns:
      the subscription name.
    • setId

      public void setId(String id)
    • getId

      public String getId()
      Description copied from interface: ListenerEndpoint
      Return the id of this endpoint.
      Specified by:
      getId in interface ListenerEndpoint<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

      public void setTopics(String... topics)
    • getTopics

      public Collection<String> getTopics()
      Description copied from interface: ListenerEndpoint
      Return the topics for this endpoint's container.
      Specified by:
      getTopics in interface ListenerEndpoint<K>
      Returns:
      the topics.
    • setTopicPattern

      public void setTopicPattern(String topicPattern)
    • getTopicPattern

      public String getTopicPattern()
      Description copied from interface: ListenerEndpoint
      Return the topic pattern for this endpoint's container.
      Specified by:
      getTopicPattern in interface ListenerEndpoint<K>
      Returns:
      the topic pattern.
    • getAutoStartup

      @Nullable public Boolean getAutoStartup()
      Description copied from interface: ListenerEndpoint
      Return the autoStartup for this endpoint's container.
      Specified by:
      getAutoStartup in interface ListenerEndpoint<K>
      Returns:
      the autoStartup.
    • setAutoStartup

      public void setAutoStartup(Boolean autoStartup)
    • 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 the messageListener to use but an implementation may override any default setting that was already set.

      Specified by:
      setupListenerContainer in interface ListenerEndpoint<K>
      Parameters:
      listenerContainer - the listener container to configure
      messageConverter - the message converter - can be null
    • createMessageListener

      protected abstract AbstractPulsarMessageToSpringMessageAdapter<K> createMessageListener(PulsarMessageListenerContainer container, @Nullable MessageConverter messageConverter)
    • setConsumerProperties

      public void setConsumerProperties(Properties consumerProperties)
    • getConsumerProperties

      public Properties getConsumerProperties()
      Specified by:
      getConsumerProperties in interface PulsarListenerEndpoint
    • getBatchListener

      @Nullable public Boolean getBatchListener()
    • setBatchListener

      public void setBatchListener(boolean batchListener)
    • isBatchListener

      public boolean isBatchListener()
      Specified by:
      isBatchListener in interface PulsarListenerEndpoint
    • 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 interface ListenerEndpoint<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 interface ListenerEndpoint<K>
      Returns:
      the schema type.
    • setSchemaType

      public void setSchemaType(org.apache.pulsar.common.schema.SchemaType schemaType)
    • getConcurrency

      @Nullable public Integer getConcurrency()
      Description copied from interface: ListenerEndpoint
      Return the concurrency for this endpoint's container.
      Specified by:
      getConcurrency in interface ListenerEndpoint<K>
      Returns:
      the concurrency.
    • setConcurrency

      public void setConcurrency(Integer concurrency)
      Set the concurrency for this endpoint's container.
      Parameters:
      concurrency - the concurrency.
    • getAckMode

      public AckMode getAckMode()
      Specified by:
      getAckMode in interface PulsarListenerEndpoint
    • setAckMode

      public void setAckMode(AckMode ackMode)