Interface MessageListener

  • All Known Subinterfaces:
    BatchMessageListener
    All Known Implementing Classes:
    AmqpInvokerServiceExporter
    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.
    • Method Detail

      • 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​(java.util.List<Message> messages)
        Delivers a batch of messages.
        Parameters:
        messages - the messages.
        Since:
        2.2