Package org.apache.pulsar.client.api
Interface MessageListener<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidreachedEndOfTopic(Consumer<T> consumer)Get the notification when a topic is terminated.voidreceived(Consumer<T> consumer, Message<T> msg)This method is called whenever a new message is received.
-
-
-
Method Detail
-
received
void received(Consumer<T> consumer, Message<T> msg)
This method is called whenever a new message is received.Messages are guaranteed to be delivered in order and from the same thread for a single consumer
This method will only be called once for each message, unless either application or broker crashes.
Application is responsible for acking message by calling any of consumer acknowledgement methods.
Application is responsible of handling any exception that could be thrown while processing the message.
- Parameters:
consumer- the consumer that received the messagemsg- the message object
-
-