Re: Kafka consumer ensure offsets committed before partition rebalance to avoid duplicates

2022-09-20 Thread Pushkar Deole
Hi Luke, Thanks for the details... so from explanation above, it seems that both of these scenarios, I won't be able to avoid duplicates processing, which is main purpose that I was looking to achieve scenario 1: consumer shuts down, and doesn't commit offsets of already polled and processed batc

Re: Kafka consumer ensure offsets committed before partition rebalance to avoid duplicates

2022-09-20 Thread Luke Chen
Hi 1. I was under impression, from documentation, that close method waits for 30 seconds to complete processing of any in-flight events and then commits offsets of last poll. Isn't that true? what does timeout of 30 seconds mean? -> 30 seconds timeout is to have a buffer for graceful closing, ex:

Re: Kafka consumer ensure offsets committed before partition rebalance to avoid duplicates

2022-09-20 Thread Pushkar Deole
Thanks Luke.. 1. I was under impression, from documentation, that close method waits for 30 seconds to complete processing of any in-flight events and then commits offsets of last poll. Isn't that true? what does timeout of 30 seconds mean? 2. How does CoperativeStickyAssignor solve my problem wh

Re: Kafka consumer ensure offsets committed before partition rebalance to avoid duplicates

2022-09-15 Thread Luke Chen
Hi Pushkar, Here's the answer to your questions: > 1. During scale-down operation, I am adding a shutdown hook to the Java Runtime, and calling close on the consumer. As per kafka docs, close provides 30 sec to commit current offsets if auto.commit is enabled: so, i assume that it will process th

Kafka consumer ensure offsets committed before partition rebalance to avoid duplicates

2022-09-14 Thread Pushkar Deole
Hi All, I am hosting kafka consumers inside microservice hosted as kubernetes pods, 3 consumers in a consumer group. There is a requirement to add auto-scaling where there will be a single pod which will be auto-scaled out or scaled-in based on the load on microservice. So, 1 pod can be scaled out