public abstract class EmbeddedHeaderUtils extends 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 |
|---|
EmbeddedHeaderUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
decodeExceptionMessage(org.springframework.messaging.Message<?> requestMessage) |
static byte[] |
embedHeaders(MessageValues original,
String... headers)
Return a new message where some of the original headers of
original have
been embedded into the new message payload. |
static MessageValues |
extractHeaders(byte[] payload)
Return a message where headers, that were originally embedded into the payload,
have been promoted back to actual headers.
|
static 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.
|
static String[] |
headersToEmbed(String[] configuredHeaders) |
public static String decodeExceptionMessage(org.springframework.messaging.Message<?> requestMessage)
public static byte[] embedHeaders(MessageValues original, String... headers) throws Exception
original have
been embedded into the new message payload.Exceptionpublic static MessageValues extractHeaders(org.springframework.messaging.Message<byte[]> message, boolean copyRequestHeaders) throws Exception
message - the message to extract headerscopyRequestHeaders - boolean value to specify if the request headers should be
copiedExceptionpublic static MessageValues extractHeaders(byte[] payload) throws Exception
payload - the message payloadExceptionCopyright © 2018 Pivotal Software, Inc.. All rights reserved.