-
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
Deserialization error for Acknowledgement in Spring Kafka Listener #3400
Comments
@purbarunc Thanks for the report. We will triage the issue soon and get back to you. |
The The issue has nothing to do with deserialziation. Just because the Perhaps we can improve the logic somehow to indicate such an illegal state and reject such a configuration when no manual ack mode is configured. |
@artembilan Is this the only change that is needed purbarunc/Spring-Boot-Kafka@e0ef274 or there should also be some change in Java Configuration since I am still getting |
That change would make sense if you rely on the Spring Boot auto-configuration, but apparently you create
Not sure, though, why would one use Spring Boot, but still creates all the beans manually. Please, also take a look closer to that stack trace. It has a message like this:
|
@artembilan the issue solved by adding this But I agree with you that I am not using the power of Spring Boot to any extent and hence I tried eliminating all the Java Config code purbarunc/Spring-Boot-Kafka@f2b5222 I see the below same error over again:
even after adding the below property:
Do you have any solution for the same. |
I'm not sure what Even if exception is the same but the reason is slightly different:
from original one in opposed to your new one:
Looks like that Try to add this property then |
@artembilan But do you mean this |
Right, but I cannot play with your application right now, but I think this is what you need over there:
See more info in docs: https://docs.spring.io/spring-boot/reference/messaging/kafka.html#messaging.kafka.additional-properties Not sure why you have commented out a Either way, this does not look like we use GitHub issues feature properly. I prefer to do support on StackOverflow. GH issues are for bugs and project improvement requests. Everything else sounds like issue hijacking. Thanks for understanding! |
Okay..We can probably close this thread right here. |
We will still use this issue to improve the exception. |
FWIW, this the correct configuration you need to run your app:
|
I am getting message deserialization exception when I attempt to acknowledge the message using
acknowledge()
. If I remove this part of acknowledgement everything is working i.e. messages are getting consumed without any error.Given below is the last exception in the stack trace.
Below is my Java based configuration where I have configured the listener and all that stuff:
I have tried JsonDeserializer of type
GenericMessage<OrderMessage>
but configuration seems to be not correct as per the requirement.Can anyone help to fix the same.
I have referred the code from https://github.com/spring-tips/kafka/blob/4d1d09caed751f94419b3229a3a65bef9a57ec0b/producer/src/main/java/com/example/analytics/ProducerApplication.java#L71
My code for producer and consumer is present in the given link:
https://github.com/purbarunc/Spring-Boot-Kafka
There is no reproduction steps as such. Just need to create the containers using docker compose and once producer and consumer app is up use the below curl to publish message to the Kafka Topic.
The text was updated successfully, but these errors were encountered: