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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
onMessage(Message message)
Delivers a single message.void
onMessage(Message message, com.rabbitmq.client.Channel channel)
Callback for processing a received Rabbit message.default void
onMessageBatch(List<Message> messages, com.rabbitmq.client.Channel channel)
-
Methods inherited from interface org.springframework.amqp.core.MessageListener
containerAckMode, isAsyncReplies, onMessageBatch
-
-
-
-
Method Detail
-
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 (nevernull
)channel
- the underlying Rabbit Channel (nevernull
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 interfaceMessageListener
- Parameters:
message
- the message.
-
-