How to programmatically start and stop apache pulsar consumer?
Solution 1:
Messages received from the broker are buffered in the consumer receiverQueue
. The pause
method of the consumer will make it stop asking for more messages from the broker. So the messages you get are probably the ones buffered into the receiverQueue. From your application perspective, you'll stop receiving messages once the receiver queue is drained.