Interface ChannelAwareMessageListener
- All Superinterfaces:
org.springframework.amqp.core.MessageListener
- All Known Subinterfaces:
ChannelAwareBatchMessageListener
- All Known Implementing Classes:
AbstractAdaptableMessageListener,AsyncRabbitTemplate,BatchingRabbitTemplate,BatchMessagingMessageListenerAdapter,MessageListenerAdapter,MessagingMessageListenerAdapter,RabbitTemplate
- 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 org.springframework.amqp.core.MessageListener
A message listener that is aware of the Channel on which the message was received.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonMessage(org.springframework.amqp.core.Message message) voidonMessage(org.springframework.amqp.core.Message message, com.rabbitmq.client.Channel channel) Callback for processing a received Rabbit message.default voidonMessageBatch(List<org.springframework.amqp.core.Message> messages, com.rabbitmq.client.Channel channel) Methods inherited from interface org.springframework.amqp.core.MessageListener
containerAckMode, isAsyncReplies, onMessageBatch
-
Method Details
-
onMessage
void onMessage(org.springframework.amqp.core.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 (nevernullunless called by the stream listener container).- Throws:
Exception- Any.
-
onMessage
default void onMessage(org.springframework.amqp.core.Message message) - Specified by:
onMessagein interfaceorg.springframework.amqp.core.MessageListener
-
onMessageBatch
default void onMessageBatch(List<org.springframework.amqp.core.Message> messages, com.rabbitmq.client.Channel channel)
-