Interface ChannelAwareMessageListener

All Superinterfaces:
MessageListener
All Known Subinterfaces:
ChannelAwareBatchMessageListener
All Known Implementing Classes:
AbstractAdaptableMessageListener, AsyncRabbitTemplate, BatchingRabbitTemplate, BatchMessagingMessageListenerAdapter, 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 ChannelAwareMessageListener extends MessageListener
A message listener that is aware of the Channel on which the message was received.
Author:
Mark Pollack, Gary Russell
  • Method Details

    • onMessage

      void onMessage(Message message, @Nullable com.rabbitmq.client.Channel channel) throws Exception
      Callback for processing a received Rabbit message.

      Implementors are supposed to process the given Message, typically sending reply messages through the given Session.

      Parameters:
      message - the received AMQP message (never null)
      channel - the underlying Rabbit Channel (never null unless called by the stream listener container).
      Throws:
      Exception - Any.
    • onMessage

      default void onMessage(Message message)
      Description copied from interface: MessageListener
      Delivers a single message.
      Specified by:
      onMessage in interface MessageListener
      Parameters:
      message - the message.
    • onMessageBatch

      default void onMessageBatch(List<Message> messages, com.rabbitmq.client.Channel channel)