Pritesh Patel
Pritesh Patel

Reputation: 39

How to programmatically start and stop apache pulsar consumer?

Is there any way you can programmatically control to start/stop apache consumer?

There are pause and resume but looks like it is not working as expected

Upvotes: 1

Views: 759

Answers (1)

Christophe Bornet
Christophe Bornet

Reputation: 1127

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.

Upvotes: 2

Related Questions