apache kafka – @KafkaListener idiomatic way of nack with retry counter

I have spring-kafka listener:

@KafkaListener(...)
public void consume(UpdateEvent message, Acknowledgment ack) {
    processor.process(message);
    ack.acknowledge();
}

Questions:

Questions:

  1. Since I have long-running requests, I want to be on the safe side and “fail fast” by sending a nack for every failed processing attempt. Is this an idiomatic approach in Kafka?
  2. I need a stateful counter per consumer group + partition. If I implement it myself, I would use ThreadLocal variables. Is there any built-in mechanism in Spring Kafka for this?

Read more here: Source link

apache kafka – @KafkaListener idiomatic way of nack with retry counter

I have spring-kafka listener:

@KafkaListener(...)
public void consume(UpdateEvent message, Acknowledgment ack) {
    processor.process(message);
    ack.acknowledge();
}

Questions:

Questions:

  1. Since I have long-running requests, I want to be on the safe side and “fail fast” by sending a nack for every failed processing attempt. Is this an idiomatic approach in Kafka?
  2. I need a stateful counter per consumer group + partition. If I implement it myself, I would use ThreadLocal variables. Is there any built-in mechanism in Spring Kafka for this?

Read more here: Source link