Package org.springframework.amqp.core
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.
Listener interface to receive asynchronous delivery of Amqp Messages.
- Author:
- Mark Pollack, Gary Russell
-
Method Summary
Modifier and TypeMethodDescriptiondefault 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
Delivers a single message.default void
onMessageBatch
(List<Message> messages) Delivers a batch of messages.
-
Method Details
-
onMessage
Delivers a single message.- Parameters:
message
- the message.
-
containerAckMode
Called by the container to inform the listener of its acknowledgement mode.- Parameters:
mode
- theAcknowledgeMode
.- 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
Delivers a batch of messages.- Parameters:
messages
- the messages.- Since:
- 2.2
-