public class EmbeddedHeadersMessageConverter
extends java.lang.Object
0xff, n(1), [ [lenHdr(1), hdr, lenValue(4), value] ... ]
.
The 0xff indicates this new format; n is number of headers (max 255); for
each header, the name length (1 byte) is followed by the name, followed by
the value length (int) followed by the value (json).
Previously, there was no leading 0xff; the value length was 1 byte and only String header values were supported (no JSON conversion).
Constructor and Description |
---|
EmbeddedHeadersMessageConverter() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
decodeExceptionMessage(org.springframework.messaging.Message<?> requestMessage) |
byte[] |
embedHeaders(MessageValues original,
java.lang.String... headers)
Return a new message where some of the original headers of
original
have been embedded into the new message payload. |
MessageValues |
extractHeaders(org.springframework.messaging.Message<byte[]> message,
boolean copyRequestHeaders)
Return a message where headers, that were originally embedded into the payload, have been promoted
back to actual headers.
|
public static java.lang.String decodeExceptionMessage(org.springframework.messaging.Message<?> requestMessage)
public byte[] embedHeaders(MessageValues original, java.lang.String... headers) throws java.lang.Exception
original
have been embedded into the new message payload.java.lang.Exception
public MessageValues extractHeaders(org.springframework.messaging.Message<byte[]> message, boolean copyRequestHeaders) throws java.lang.Exception
message
- the message to extract headerscopyRequestHeaders
- boolean value to specify if original headers should be copiedjava.lang.Exception