Interface RabbitListenerEndpoint

All Known Implementing Classes:
AbstractRabbitListenerEndpoint, MethodRabbitListenerEndpoint, MultiMethodRabbitListenerEndpoint, SimpleRabbitListenerEndpoint

public interface RabbitListenerEndpoint
Model for a Rabbit listener endpoint. Can be used against a RabbitListenerConfigurer to register endpoints programmatically.
Since:
1.4
  • Method Summary

    Modifier and Type
    Method
    Description
    default @Nullable org.springframework.amqp.core.AcknowledgeMode
    Override the container factory's AcknowledgeMode.
    @Nullable Boolean
    Override of the default autoStartup property.
    default @Nullable BatchingStrategy
    Return this endpoint's batching strategy, or null.
    @Nullable Boolean
    Whether this endpoint is for a batch listener.
    @Nullable String
     
    @Nullable String
     
    @Nullable String
     
    default @Nullable org.springframework.amqp.support.converter.MessageConverter
    Used by the container factory to check if this endpoint supports the preferred way for a container factory to pass a message converter to the endpoint's adapter.
    default @Nullable String
    Get the reply content type.
    default @Nullable org.springframework.amqp.listener.adapter.ReplyPostProcessor
    Return a ReplyPostProcessor to post process a reply message before it is sent.
    default @Nullable org.springframework.core.task.TaskExecutor
    Get the task executor to use it for this endpoint's listener container.
    default boolean
    Return whether the content type set by a converter prevails or not.
    default void
    Set a BatchingStrategy to use when debatching messages.
    default void
    setBatchListener(boolean batchListener)
    Called by the container factory with the factory's batchListener property.
    default void
    setMessageConverter(org.springframework.amqp.support.converter.MessageConverter converter)
    The preferred way for a container factory to pass a message converter to the endpoint's adapter.
    void
    setupListenerContainer(org.springframework.amqp.core.MessageListenerContainer listenerContainer)
    Set up the specified message listener container with the model defined by this endpoint.
  • Method Details

    • getId

      @Nullable String getId()
      Returns:
      the id of this endpoint. The id can be further qualified when the endpoint is resolved against its actual listener container.
      See Also:
    • getGroup

      @Nullable String getGroup()
      Returns:
      the group of these endpoints or null if not in a group.
      Since:
      1.5
    • getConcurrency

      @Nullable String getConcurrency()
      Returns:
      the concurrency of this endpoint.
      Since:
      2.0
    • getAutoStartup

      @Nullable Boolean getAutoStartup()
      Override of the default autoStartup property.
      Returns:
      the autoStartup.
      Since:
      2.0
    • setupListenerContainer

      void setupListenerContainer(org.springframework.amqp.core.MessageListenerContainer listenerContainer)
      Set up 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.

      Parameters:
      listenerContainer - the listener container to configure
    • setMessageConverter

      default void setMessageConverter(org.springframework.amqp.support.converter.MessageConverter converter)
      The preferred way for a container factory to pass a message converter to the endpoint's adapter.
      Parameters:
      converter - the converter.
      Since:
      2.0.8
    • getMessageConverter

      default @Nullable org.springframework.amqp.support.converter.MessageConverter getMessageConverter()
      Used by the container factory to check if this endpoint supports the preferred way for a container factory to pass a message converter to the endpoint's adapter. If null is returned, the factory will fall back to the legacy method of passing the converter via the container.
      Returns:
      the converter.
      Since:
      2.0.8
    • getTaskExecutor

      default @Nullable org.springframework.core.task.TaskExecutor getTaskExecutor()
      Get the task executor to use it for this endpoint's listener container. Overrides any executor set on the container factory.
      Returns:
      the executor.
      Since:
      2.2
    • setBatchListener

      default void setBatchListener(boolean batchListener)
      Called by the container factory with the factory's batchListener property.
      Parameters:
      batchListener - the batchListener to set.
      Since:
      2.2
    • getBatchListener

      @Nullable Boolean getBatchListener()
      Whether this endpoint is for a batch listener.
      Returns:
      Boolean.TRUE if batch.
      Since:
      3.0
    • setBatchingStrategy

      default void setBatchingStrategy(BatchingStrategy batchingStrategy)
      Set a BatchingStrategy to use when debatching messages.
      Parameters:
      batchingStrategy - the batching strategy.
      Since:
      2.2
      See Also:
    • getBatchingStrategy

      default @Nullable BatchingStrategy getBatchingStrategy()
      Return this endpoint's batching strategy, or null.
      Returns:
      the strategy.
      Since:
      2.4.7
    • getAckMode

      default @Nullable org.springframework.amqp.core.AcknowledgeMode getAckMode()
      Override the container factory's AcknowledgeMode.
      Returns:
      the acknowledgment mode.
      Since:
      2.2
    • getReplyPostProcessor

      default @Nullable org.springframework.amqp.listener.adapter.ReplyPostProcessor getReplyPostProcessor()
      Return a ReplyPostProcessor to post process a reply message before it is sent.
      Returns:
      the post-processor.
      Since:
      2.2.5
    • getReplyContentType

      default @Nullable String getReplyContentType()
      Get the reply content type.
      Returns:
      the content type.
      Since:
      2.3
    • isConverterWinsContentType

      default boolean isConverterWinsContentType()
      Return whether the content type set by a converter prevails or not.
      Returns:
      false to always apply the reply content type.
      Since:
      2.3