You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-integration-core/src/main/java/org/springframework/integration/support/json/EmbeddedJsonHeadersMessageMapper.java
+24-21Lines changed: 24 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2017-2022 the original author or authors.
2
+
* Copyright 2017-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -42,15 +42,16 @@
42
42
/**
43
43
* For outbound messages, uses a message-aware Jackson object mapper to render the message
44
44
* as JSON. For messages with {@code byte[]} payloads, if rendered as JSON, Jackson
45
-
* performs Base64 conversion on the bytes. If the {@link #setRawBytes(boolean) rawBytes}
46
-
* property is true (default), the result has the form
47
-
* <headersLen><headers><payloadLen><payload>; with the headers
45
+
* performs Base64 conversion on the bytes. If payload is {@code byte[]} and
46
+
* the {@link #setRawBytes(boolean) rawBytes} property is true (default), the result has the form
47
+
* {@code [headersLen][headers][payloadLen][payload]}; with the headers
48
48
* rendered in JSON and the payload unchanged.
49
+
* Otherwise, message is fully serialized and deserialized with Jackson object mapper.
49
50
* <p>
50
51
* By default, all headers are included; you can provide simple patterns to specify a
51
52
* subset of headers.
52
53
* <p>
53
-
* If neither expected format is detected, or an error occurs during conversion, the
54
+
* If neither expected format is detected, nor an error occurs during conversion, the
54
55
* payload of the message is the original {@code byte[]}.
55
56
* <p>
56
57
* <b>IMPORTANT</b>
@@ -63,7 +64,9 @@
63
64
* "org.springframework.messaging.support",
64
65
* "org.springframework.integration.support",
65
66
* "org.springframework.integration.message",
66
-
* "org.springframework.integration.store"
67
+
* "org.springframework.integration.store",
68
+
* "org.springframework.integration.history",
69
+
* "org.springframework.integration.handler"
67
70
* </pre>
68
71
* <p>
69
72
* To add more packages, create an object mapper using
@@ -133,19 +136,19 @@ public EmbeddedJsonHeadersMessageMapper(ObjectMapper objectMapper, String... hea
133
136
/**
134
137
* For messages with {@code byte[]} payloads, if rendered as JSON, Jackson performs
135
138
* Base64 conversion on the bytes. If this property is true (default), the result has
136
-
* the form <headersLen><headers><payloadLen><payload>; with
137
-
* the headers rendered in JSON and the payload unchanged. Set to false to render
138
-
* the bytes as base64.
139
+
* the form {@code [headersLen][headers][payloadLen][payload]}; with
140
+
* the headers rendered in JSON and the payload unchanged.
141
+
* Set to {@code false} to render the bytes as base64.
139
142
* @param rawBytes false to encode as base64.
140
143
*/
141
144
publicvoidsetRawBytes(booleanrawBytes) {
142
145
this.rawBytes = rawBytes;
143
146
}
144
147
145
148
/**
146
-
* Set to true to make the header name pattern match casesensitive.
149
+
* Set to true to make the header name pattern match case-sensitive.
147
150
* Default false.
148
-
* @param caseSensitive true to make casesensitive.
151
+
* @param caseSensitive true to make case-sensitive.
Copy file name to clipboardExpand all lines: spring-integration-core/src/test/java/org/springframework/integration/support/json/EmbeddedJsonHeadersMessageMapperTests.java
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2017-2022 the original author or authors.
2
+
* Copyright 2017-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
0 commit comments