Skip to content

ByteArrayLengthHeaderSerializer headerSize Enhancement #2780

Closed
@ehudtavor

Description

@ehudtavor

Affects Version(s): 5.X


Enhancement

ByteArrayLengthHeaderSerializer maintains headerSize, but it seems an inclusive/exclusive indicator is missing.

Some TCP clients would set the payload size - in the headerSize - inclusive the header size, while other TCP clients would set the payload size exclusive the header size.

ByteArrayLengthHeaderSerializer current implementation assumes exclusive mode, which results with wrong serialization/deserialization if the client uses inclusive mode.

Example:
TCP client sends a stream of 108 bytes, with headerSize = 2. Spring assumes that headerSize value would be 106, while our TCP client (3rd party, we cant control) sends headerSize value set to 108. As a result Spring applies wrong ser/des.

Thanks !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions