-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KafkaListener with property overrides: overridden properties are not applied to key- and value-deserializers #3526
Comments
@sjann0 Could you create a small sample application so we can quickly reproduce the issue? That way, the triaging will be faster. Thanks! |
Sample: There is a method with 2 KafkaListeners, each pointing to a different kafka-cluster..
Then we have a consumerFactory like so..
And here the override-properties for listener2 (yaml)
I was hoping, that the lazy initialized deserializers would use the override properties from listener-2 as well, but nope.. |
If you do
yourself, then behavior is expected.
In my opinion the logic is correct and it is better to not mutate an externally provided object.
Push these props to your
Closed as |
Thanks for your advice. The "configure" method on the Deserializer is actually called, but without the overridden properties from the listener. This makes the setup for two clusters (and two schema-registries) not impossible, but more complicated than necessary. |
Right. That is called from the
However I see your point and believe that we can fix it calling Reopening that it is really makes sense to do that after further investigation. |
In what version(s) of Spring for Apache Kafka are you seeing this issue?
3.2.1
Describe the bug
When @Listener is used with "properties" (consumer properties overrides) set as part of the annotation, those properties are not applied to configure the key- and value-deserializer.
This is relevant when the deserializers use a schema-registry, and we want to use different clusters and schema-registries for multiple @Listener's.
To Reproduce
Override the "schema.registry.url" property using properties field of listener annotation, check values that are applied in deserializer.
The configs map which is part of
public void configure(Map<String, ?> configs, boolean isKey)
in Deserializers does currently not contain overridden properties.Expected behavior
The overridden properties from Listener annotation should be part of the config map which is used to configure the deserializers.
The text was updated successfully, but these errors were encountered: