'SeekToCurrentBatchErrorHandler deprecated but suggested in the Kafka Binder Reference Guide

The Spring Cloud Stream Kafka Binder Reference Guide states that, in a batch consumer, a SeekToCurrentBatchErrorHandler can be configured to implement a retry functionality. SeekToCurrentBatchErrorHandler, however, is deprecated in favor of DefaultErrorHandler. So what is the correct way to get a repeat behavior in a batch consumer of Spring Cloud Stream Kafka?



Solution 1:[1]

See Legacy Error Handlers and Their Replacements.

SeekToCurrentBatchErrorHandler

No replacement, use DefaultErrorHandler with an infinite BackOff.

However, there are better ways to handle errors with batch listeners; see https://docs.spring.io/spring-kafka/docs/current/reference/html/#annotation-error-handling

The SCSt documentation should be updated; I suggest you open an issue there https://github.com/spring-cloud/spring-cloud-stream/issues

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gary Russell