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#1879
It was not intuitive that configuration properties were not applied when
constructing (De)Serializers programmatically.
The producer and consumer factories now call the `configure()` method.
However, the JSON implementations cannot be configured with a mixture
of setters and configuration properties.
* Assert no mixed config; synchronize.
Starting with version 2.8, if you provide serializers as objects (in the constructor or via the setters), the factory will invoke the `configure()` method to configure them with the configuration properties.
533
+
532
534
[[replying-template]]
533
535
===== Using `ReplyingKafkaTemplate`
534
536
@@ -1133,6 +1135,8 @@ Defining `authorizationExceptionRetryInterval` should help the application to re
1133
1135
1134
1136
NOTE: By default, no interval is configured - authorization errors are considered fatal, which causes the container to stop.
1135
1137
1138
+
Starting with version 2.8, when creating the consumer factory, if you provide deserializers as objects (in the constructor or via the setters), the factory will invoke the `configure()` method to configure them with the configuration properties.
1139
+
1136
1140
[[using-ConcurrentMessageListenerContainer]]
1137
1141
====== Using `ConcurrentMessageListenerContainer`
1138
1142
@@ -3943,6 +3947,9 @@ You can revert to the previous behavior by setting the `removeTypeHeaders` prope
3943
3947
3944
3948
See also <<tip-json>>.
3945
3949
3950
+
IMPORTANT: Starting with version 2.8, if you construct the serializer or deserializer programmatically as shown in <<prog-json>>, the above properties will be applied by the factories, as long as you have not set any properties explicitly (using `set*()` methods or using the fluent API).
3951
+
Previously, when creating programmatically, the configuration properties were never applied; this is still the case if you explicitly set properties on the object directly.
3952
+
3946
3953
[[serdes-mapping-types]]
3947
3954
====== Mapping Types
3948
3955
@@ -4073,6 +4080,7 @@ public static JavaType thing1Thing2JavaTypeForTopic(String topic, byte[] data, H
4073
4080
----
4074
4081
====
4075
4082
4083
+
[[prog-json]]
4076
4084
====== Programmatic Construction
4077
4085
4078
4086
When constructing the serializer/deserializer programmatically for use in the producer/consumer factory, since version 2.3, you can use the fluent API, which simplifies configuration.
@@ -4122,6 +4130,8 @@ JsonDeserializer<Object> deser = new JsonDeserializer<>()
4122
4130
----
4123
4131
====
4124
4132
4133
+
Alternatively, as long as you don't use the fluent API to configure properties, or set them using `set*()` methods, the factories will configure the serializer/deserializer using the configuration properties; see <<serdes-json-config>>.
0 commit comments