Hi, Jie One option is you can try to call consumer.pause() first. Then the consumer will not increase flow permits. No new messages will be dispatched to this consumer.
And you can continue to receive messages from the buffer of the consumer. After all cached messages consumed. You can close the consumer. Thanks, Penghui On Thu, Dec 8, 2022 at 3:02 AM 丛搏 <bog...@apache.org> wrote: > Hi, Jie: > I think it's better to leave it to user handle. We try not to add APIs that > users can handle themselves. And I don't think there are many scenarios > using this API, which brings about higher complexity. I tend to add a new > interface beforeClose() in ConsumerInterceptor to allow users to customiz. > Thanks, > bo > > Jie crossover <crossover...@gmail.com>于2022年12月7日 周三20:05写道: > > > Hi, pulsar community, > > > > I’ve opened a PIP to discuss: PIP-227: New API for closing the consumer > > after waiting for the job to complete. > > > > The PIP link: https://github.com/apache/pulsar/issues/18799 > > > > Thanks. > > -- > > Best Regards! > > crossoverJie > > >