-
Notifications
You must be signed in to change notification settings - Fork 106
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
Kafka Streams and Jackson Serialization results in CodecException when calling Health endpoint #1026
Comments
The workaround of adding |
We are facing the same issue, we face the issue when upgrading Not sure where the bug originates from but perhaps the bug would be best reported in the kafka project: https://github.com/micronaut-projects/micronaut-kafka/issues |
## Summary This pull request addresses issue #1026 by implementing a custom `Serde<TaskId>` to kafka-streams module. This avoid a serialization error when calling the `/health` endpoint, which throws in turn a: ``` No serializable introspection present for type TaskId. Consider adding Serdeable. Serializable annotate to type TaskId. Alternatively if you are not in control of the project's source code, you can use @SerdeImport(TaskId.class) to enable serialization of this type. ``` ## Changes Made - Added serde processor as `annotationProcessor`, and serde api as `compileOnly` to load in the annotation. - Created a class dedicated to adding annotation for external classes that need serialising as part of the health result ## Related Issues - Fixes #1026
Expected Behavior
The health endpoint returns health status and health details
Actual Behaviour
An exception:
Unexpected error occurred: Error encoding object [io.micronaut.management.health.indicator.DefaultHealthResult@69164ed1] to JSON: No serializable introspection present for type TaskId. Consider adding Serdeable. Serializable annotate to type TaskId. Alternatively if you are not in control of the project's source code, you can use @SerdeImport(TaskId.class) to enable serialization of this type. io.micronaut.http.codec.CodecException: Error encoding object [io.micronaut.management.health.indicator.DefaultHealthResult@69164ed1] to JSON: No serializable introspection present for type TaskId. Consider adding Serdeable. Serializable annotate to type TaskId. Alternatively if you are not in control of the project's source code, you can use @SerdeImport(TaskId.class) to enable serialization of this type.
Steps To Reproduce
git clone git@github.com:JacksonFraser/health-demo.git && cd health-demo && ./gradlew run
curl http://localhost:8081/health
Environment Information
Example Application
https://github.com/JacksonFraser/health-demo
Version
4.0.4
The text was updated successfully, but these errors were encountered: