Interface MessageListener

All Known Subinterfaces:
BatchMessageListener, ChannelAwareBatchMessageListener, ChannelAwareMessageListener, StreamMessageListener
All Known Implementing Classes:
AbstractAdaptableMessageListener, AsyncRabbitTemplate, BatchingRabbitTemplate, BatchMessagingMessageListenerAdapter, BrokerEventListener, MessageListenerAdapter, MessagingMessageListenerAdapter, RabbitTemplate, StreamMessageListenerAdapter, TestRabbitTemplate
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MessageListener
Listener interface to receive asynchronous delivery of Amqp Messages.
Author:
Mark Pollack, Gary Russell
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Called by the container to inform the listener of its acknowledgement mode.
    default boolean
    Return true if this listener is request/reply and the replies are async.
    void
    onMessage(Message message)
    Delivers a single message.
    default void
    Delivers a batch of messages.
  • Method Details

    • onMessage

      void onMessage(Message message)
      Delivers a single message.
      Parameters:
      message - the message.
    • containerAckMode

      default void containerAckMode(AcknowledgeMode mode)
      Called by the container to inform the listener of its acknowledgement mode.
      Parameters:
      mode - the AcknowledgeMode.
      Since:
      2.1.4
    • isAsyncReplies

      default boolean isAsyncReplies()
      Return true if this listener is request/reply and the replies are async.
      Returns:
      true for async replies.
      Since:
      2.2.21
    • onMessageBatch

      default void onMessageBatch(List<Message> messages)
      Delivers a batch of messages.
      Parameters:
      messages - the messages.
      Since:
      2.2