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
Resolves#1420
- detect and use `charset` in `contentType` when present
- allow Jackson to determine the decode `charset` via `ByteSourceJsonBootstrapper.detectEncoding()`
- allow configuration of the `MimeType` to use, which can include a `charset` parameter
**cherry-pick to main - will require what's new fix**
* Fix typo in doc.
# Conflicts:
# src/reference/asciidoc/whats-new.adoc
Copy file name to clipboardExpand all lines: spring-amqp/src/main/java/org/springframework/amqp/support/converter/AbstractJackson2MessageConverter.java
+79-14Lines changed: 79 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2018-2020 the original author or authors.
2
+
* Copyright 2018-2022 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.
Copy file name to clipboardExpand all lines: spring-amqp/src/test/java/org/springframework/amqp/support/converter/Jackson2JsonMessageConverterTests.java
+64-1Lines changed: 64 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2002-2020 the original author or authors.
2
+
* Copyright 2002-2022 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.
Copy file name to clipboardExpand all lines: src/reference/asciidoc/amqp.adoc
+23Lines changed: 23 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3938,11 +3938,34 @@ public DefaultClassMapper classMapper() {
3938
3938
Now, if the sending system sets the header to `thing1`, the converter creates a `Thing1` object, and so on.
3939
3939
See the <<spring-rabbit-json>> sample application for a complete discussion about converting messages from non-Spring applications.
3940
3940
3941
+
Starting with version 2.4.3, the converter will not add a `contentEncoding` message property if the `supportedMediaType` has a `charset` parameter; this is also used for the encoding.
3942
+
A new method `setSupportedMediaType` has been added:
Inbound messages are converted to objects according to the type information added to headers by the sending system.
3945
3956
3957
+
Starting with version 2.4.3, if there is no `contentEncoding` message property, the converter will attempt to detect a `charset` parameter in the `contentType` message property and use that.
3958
+
If neither exist, if the `supportedMediaType` has a `charset` parameter, it will be used for decoding, with a final fallback to the `defaultCharset` property.
3959
+
A new method `setSupportedMediaType` has been added:
0 commit comments