kafkaex / kafka_ex

Kafka client library for Elixir
MIT License
596 stars 162 forks source link

Enable graceful shutdown of a GenConsumer #474

Closed b1az closed 3 months ago

b1az commented 2 years ago

Add a user-configurable :shutdown to GenConsumer's child_spec.

Addresses #434, if do_some_job, from the referred issue, is either synchronous or async. Not sure if the change covers the case of a cluster rebalance.

b1az commented 1 year ago

@Argonus and @joshuawscott, I've been already using the proposed change, as the worker's (default) :shutdown value of 5 s is, in my use, not long enough to let all messages in a message_set be processed in time. Even though the proposed change is likely the smallest possible/needed to achieve a graceful shutdown, I might have missed something.

If you'll find time, any feedback, either affirmative or dismissive, would be much appreciated. (Especially given that I already went ahead and use this in production.)

Argonus commented 1 year ago

@joshuawscott I've tested that on my own setup, it works well with different shutdowns time.