-
Notifications
You must be signed in to change notification settings - Fork 1.6k
KafkaListener doesnt respect containerFactory after upgrading from spring kafka 2.7.9 to 2.8.0 #2050
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
Comments
I think the problem comes from this fix: 852c447. So, since you have that in your config:
The
We probably just need to check for As a workaround I suggestion you to extend that
|
Fixes spring-projects#2050 The application can have several consumer factories when one fully relies on the configuration properties for its deserializers and other configures them programmatically. The consumer factory now calls `configure()` on the `Deserializer` independently of its origins. See spring-projects#1879 In this case the `ErrorHandlingDeserializer` consults `spring.deserializer.key.delegate.class` or `spring.deserializer.value.delegate.class` for its delegate overriding provided explicitly programmatically * Fix `ErrorHandlingDeserializer` to check it `delegate` and `failedDeserializationFunction` for null before taking their values from the respective configuration properties * Add `spring.deserializer.value.delegate.class` property to `testJsonSerDeIgnoreTypeHeadersInbound()` configuration to ensure that it does not override an explicit `JsonDeserializer` delegate * Fix warning in the `EmbeddedKafkaBroker` about `this.` prefix for a `static logger` property
I proposed the fix here: #2051 |
Thank you @artembilan for your fast response + confirmation + proposed fix. |
Fixes #2050 The application can have several consumer factories when one fully relies on the configuration properties for its deserializers and other configures them programmatically. The consumer factory now calls `configure()` on the `Deserializer` independently of its origins. See #1879 In this case the `ErrorHandlingDeserializer` consults `spring.deserializer.key.delegate.class` or `spring.deserializer.value.delegate.class` for its delegate overriding provided explicitly programmatically * Fix `ErrorHandlingDeserializer` to check it `delegate` and `failedDeserializationFunction` for null before taking their values from the respective configuration properties * Add `spring.deserializer.value.delegate.class` property to `testJsonSerDeIgnoreTypeHeadersInbound()` configuration to ensure that it does not override an explicit `JsonDeserializer` delegate * Fix warning in the `EmbeddedKafkaBroker` about `this.` prefix for a `static logger` property
Uh oh!
There was an error while loading. Please reload this page.
Affects Version(s): 2.8.0
After upgrading from Spring Boot 2.5.6 to 2.6.1 we noticed, that the
@KafkaListener
doesnt respect the containerFactory setting anymore.In the particular case, we werent able to consume non schema registry topics anymore as the ContainerFactory with the overwritten Deserializer werent used and instead the Default Deserializer (AvroDeSerializer) was used.
I werent able to pinpoint the issue exactly, but was able to make a small demo project with which you are able to reproduce the issue.
curl -X POST localhost:8080/show
KafkaConsumerConfig#showPublishedConsumerFactory
which is used by the@KafkaListener
annotationIf you change spring boot version to 2.5.7 (or switch to
working
branch), everything works as expected and in step 4. instead of an exception, the show is logged to console.I hope my description is clear enough, to reproduce the issue.
The text was updated successfully, but these errors were encountered: