SpringSpring Kafka Error Handling
How does Spring Kafka's @RetryableTopic differ from Spring Retry's @Retryable?
Reference answer
@Retryable (Spring Retry): synchronous retry within the same thread, holding the consumer partition. Other partitions can still be processed but the failed partition is blocked during retry sleeps. This can cause consumer lag and even session timeouts if retry delays are long. @RetryableTopic (Spring Kafka): non-blocking retry using separate retry topics. The failed message is sent to a retry topic with a delay header. A separate consumer group reads retry topics with @KafkaListener, pausing for the delay. The main consumer continues processing without blocking. @RetryableTopic is strongly preferred for any retry with delay.
Expected key concepts: @Retryable, @RetryableTopic, synchronous, blocking, retry topics, delay header, non-blocking, consumer lag, session timeout, separate consumer group