Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End of topic event. #710

Closed
SergeyFromHell opened this issue Apr 24, 2020 · 2 comments
Closed

End of topic event. #710

SergeyFromHell opened this issue Apr 24, 2020 · 2 comments

Comments

@SergeyFromHell
Copy link

Is your feature request related to a problem? Please describe.
I have some finish logic running when all currently pushed data has been processed (some stats update and external backpressure). Right now I use idle timeout (wait some minutes, and if no messages received, conclude topic end has been reached). But it is a very fragile way.

Describe the solution you'd like
It would be much better to have some (instrumentation?) event fired when consumer reaches end of topic (for all partitions simultaneously).

@tulios
Copy link
Owner

tulios commented Apr 28, 2020

Hi @SergeyFromHell, you can implement this feature without new code. You can listen to the END_BATCH_PROCESS instrumentation event and compare the highWatermark with your current offset, if they are off by one you can emit an event saying that you reached the end of the topic. To cater to all partitions you will have to keep some state, but it's also possible.

@Nevon
Copy link
Collaborator

Nevon commented Aug 14, 2020

See #825 (comment) for an example of this.

@Nevon Nevon closed this as completed Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants