Give the client a chance to save offset on graceful shutdown #396
ppou-novibet
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
Hi @ppou-novibet, |
Beta Was this translation helpful? Give feedback.
0 replies
-
We have the very same requirment and resolved it by registering a StoreOffset delegate in
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using a stream with
IsSingleActiveConsumer=true
and I am tracking the offset as messages are being consumed, periodically saving the offset by callingconsumer.StoreOffset
as described in the documentation.However I haven't found a clean way of saving the last consumed offset just before shutting down my application.
One nice way of doing that is if I could provide a callback to
Consumer.Create
that would be called just before the consumer is closed. The callback would receive theRawConsumer
and it would be able to callconsumer.StoreOffset
to save last offset to stream.Beta Was this translation helpful? Give feedback.
All reactions