I have a Producer that sends messages in Avro format and a Consumer which listens to those messages.
I have also implemented non-blocking retries by using @RetryableTopic in my Consumer for handling errors.
When the Consumer is unable to deserialize a message (due to schema change or whatever reasons), it does not put that message in the -retry topic. It directly sends it to the -dlt topic instead.
I want DeserializationExceptions to be retried as well. Reason is that by the time these errors are retried, I can deploy a fix in my Consumer so that the retries could eventually succeed.
I tried the include option in @RetryableTopic but it doesn't seem to work for DeserializationException.
@RetryableTopic(
attempts = "${app.consumer.retry.topic.count:5}",
backoff = @Backoff(delayExpression = "${app.consumer.retry.topic.back-off:2000}"),
fixedDelayTopicStrategy = FixedDelayStrategy.SINGLE_TOPIC,
include = {DeserializationException.class} // does not work
)
Is it a bug in @RetryableTopic or is there another way to achieve this?