Skip to content

RetryableTopic system breaks message on deserialization errors causes it to grow unboundedly  #2000

@mh-dev

Description

@mh-dev

🐞 Bug report
Version: 2.7.8

We did run into an issue that a message did grow unboundedly on a deserialization issue when using the RetryableTopic system with a DltHandler. After hours of troubleshooting and code deep dive we identified the issue in how the message data gets re-published in that case. What is happening is that the original message gets stored as byte array in DeserializationException.java#L40. This data block gets then forwarded to the KafkaTemplate which is then using the JsonSerializer. This serializer is internally using writer.writeValueAsBytes(data).
The behavior of this is that the data grows and for every pass through this continues to grow further and end up in a endless spiral with RecordTooLargeException.

See the following repo to force the message corruption.

Edit replaced the example with a repo that reproduces the issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions