Skip to content

Remove Arrays.toString() from JsonDeserializer #2838

@garyrussell

Description

@garyrussell

Discussed in #2837

Originally posted by ccrafael October 11, 2023
Actually in the class org.springframework.kafka.support.serializer.JsonDeserializer when an error happen it is handled like this:

catch (IOException e) {
		throw new SerializationException("Can't deserialize data [" + Arrays.toString(data) +
				"] from topic [" + topic + "]", e);
	}

which I think is very inefficient as each byte of the payload is duplicated as a long array of numbers written as a String in the exception message. In my humble opinion the Arrays.toString(data) should be removed from the message and the original data[] object should be added to the SerializationException class.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions