Feature: Add ability to specify on_assign, on_revoke, and on_lost callbacks for a Confluent subscriber #1676
Labels
Confluent
Issues related to `faststream.confluent` module
enhancement
New feature or request
good first issue
Good for newcomers
Is your feature request related to a problem? Please describe.
Yes, I want to know when my confluent Consumer gets topic partitions assigned and removed.
Currently, I reach through FastStream into confluent_kafka.Consumer.assignment() every time my k8s liveness probe runs, but its noisy and most notably, not right when it happens.
I may even, at times, want to do something with the informaiton beyond logging. Potentially clear some cached state, cancel some running threads/processes, etc...
Describe the solution you'd like
I want to specify at the subscriber registration level the callbacks that I want called, and for FastStream to pass them into the
confluent_kafka.Consumer.subscribe() call inside AsyncConfluentConsumer.
Feature code example
Describe alternatives you've considered
I monkey patch AsyncConfluentConsumer at import time in the FastStream library.
Obviously, this is ideal for no one.
Additional context
The text was updated successfully, but these errors were encountered: