-
Notifications
You must be signed in to change notification settings - Fork 1.6k
NullPointerException in AbstractJavaTypeMapper #652
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
We can (and will) fix the NPE but since Kafka Streams doesn't support headers, we won't be able to convey the type information in the record so the consumer Serde will need to be configured with the |
Thanks for fixing the NPE. Regarding the target type you're right and that should be done. However in current situation that won't fix the problem (I'm configuring the Serde for consumer just like the one on producer/group operation). private <T> Serde<T> createJsonSerde(Class<T> targetType, ObjectMapper objectMapper) {
JsonSerializer<T> jsonSerializer = new JsonSerializer<>(objectMapper);
jsonSerializer.setAddTypeInfo(false);
JsonDeserializer<T> jsonDeserializer = new JsonDeserializer<>(targetType, objectMapper);
return
new JsonSerde<>(
jsonSerializer,
jsonDeserializer
);
} |
Good; I'm glad you have a work-around. |
Fixes: spring-projects#652 Kafka Streams `ChangedSerializer` calls the `Serde` with `null` in `headers`. **cherry-pick to 2.1.x, 2.0.x, 1.3.x**
Fixes: spring-projects#652 Kafka Streams `ChangedSerializer` calls the `Serde` with `null` in `headers`. **cherry-pick to 2.1.x, 2.0.x, 1.3.x**
Fixes: #652 Kafka Streams `ChangedSerializer` calls the `Serde` with `null` in `headers`. **cherry-pick to 2.1.x, 2.0.x, 1.3.x**
Fixes: spring-projects/spring-kafka#652 Kafka Streams `ChangedSerializer` calls the `Serde` with `null` in `headers`. **cherry-pick to 2.1.x, 2.0.x, 1.3.x**
I'm using the spring-kafka 2.1.5 with kafka-streams 1.0.1 and I'm facing a null pointer with following stack:
my streams setup is to re-key incomming messages and group them by new key something like:
after examining the stack, it is clear that Kafka Streams passes
null
as value for headers (ChangedSerializer.java:83) and you don't account for it being null on AbstractJavaTypeMapper.java:146.The text was updated successfully, but these errors were encountered: