Package org.springframework.amqp.core
Interface MessageListener
-
- All Known Subinterfaces:
BatchMessageListener
,ChannelAwareBatchMessageListener
,ChannelAwareMessageListener
,StreamMessageListener
- All Known Implementing Classes:
AbstractAdaptableMessageListener
,AmqpInvokerServiceExporter
,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.
@FunctionalInterface public interface MessageListener
Listener interface to receive asynchronous delivery of Amqp Messages.- Author:
- Mark Pollack, Gary Russell
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
containerAckMode(AcknowledgeMode mode)
Called by the container to inform the listener of its acknowledgement mode.default boolean
isAsyncReplies()
Return true if this listener is request/reply and the replies are async.void
onMessage(Message message)
Delivers a single message.default void
onMessageBatch(List<Message> messages)
Delivers a batch of 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
- 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
-
-