eric.ng
06/28/2024, 8:51 AMRunLLM
06/28/2024, 8:51 AMpause method on the consumer.
For example, in Java, you can pause a consumer using the pause method:
ConsumerString consumer = pulsarClient.newConsumer(Schema.STRING)
.topic("myTopic")
.subscriptionName("mySub")
.subscribe();
consumer.pause();
However, it's important to note that pausing a consumer does not immediately stop the receipt of messages if there are already available permits. The consumer will continue to receive messages until the available permits are exhausted, as discussed in this GitHub issue.
Would you like more detail on this topic?
Sources:
- GitHub Issue: consumer.pause is not working as expected
- GitHub Pull Request: improve java-client check consumer pause status before consumer receive/batchReceive 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.