Skip to content

Cannot use JsonSerde for both key and value serialization in a stream #561

@elliotkennedy

Description

@elliotkennedy

Am I correct in thinking I should be able to use a JsonSerde for both the key and value in a stream?

Deserialization fails when using JsonSerde to serialize both the key and value of a topic.

The key and value are both given the same header value here:

So when deserializing, the key and value header chosen is simply the first header in the list. This results in attempting to deserialize the value as the key type.

classId = new String(headerValue.value(), StandardCharsets.UTF_8);

I've created a test to demonstrate the issue here:

elliotkennedy@ff15715

I might be able to attempt a fix using different headers soon if people think that would be appropriate?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions