kafka_ex icon indicating copy to clipboard operation
kafka_ex copied to clipboard

Enable graceful shutdown of a GenConsumer

Open b1az opened this issue 2 years ago • 2 comments

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 avatar Aug 30 '22 08:08 b1az

@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.)

b1az avatar Feb 28 '23 13:02 b1az

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

Argonus avatar Mar 20 '23 08:03 Argonus