-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Infinite loop with malformed message to Avro formatted topic with Retry and DLT configuration #2415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Publishing a serialization exception should not be using a producer configured with the Avro serializer; it must use a ByteArraySerializer since the raw, undeserialized One work around would be a custom serializer that looks at the
|
Actually, we already have the We will document that it should be used with an |
In what version(s) of Spring for Apache Kafka are you seeing this issue?
version: 2.8.8
Describe the bug
I am using Avro schema for the kafka messages and the consumer is setup with Spring RetryTopic and DLT.
When consumer encounters an exception during the process of a message and the message goes into the retry topic and then the DLT topic for handling as expected.
When later, it receives a malformed message that cannot be processed correctly, Spring Kafka infinitely retries the message in DLT. Then the application needs to be stopped and the topic cleared before starting again.
The log message is as follows:
To Reproduce
Expected behavior
Spring Kafka should not retry a message in the same DLT indefinitely.
It would be desirable to configure a special dead letter topic for Deseralization exception, so they can be handled separately then other type of exceptions. If the Avro prevents a topic not tied to a schema, then allowing to configure a handler function would be the next option and ideally the handler would be provided with the binary content of the message, topic name, offset, partition, key, headers and exception information.
Sample
Here's a link to a sample code with instructions to reproduce problem:
https://github.com/clbtrain/spring-kafka-avro-dlt-infinite
The text was updated successfully, but these errors were encountered: