Closed rnferreira closed 1 week ago
I can'r see what could have changed, but i just plugged in your sample and i see the same 2 bytes with 4.1.1 as I do with 4.1.2
GenericMessage [payload=byte[2],
Hi Oleg! Thank you for getting back to me so quickly. Your comment pointed me in the right direction. If I include the dependency org.springframework.cloud:spring-cloud-starter-contract-stub-runner
, the test passes when I use 2023.0.1
and fails on `2023.0.2'.
Was this always the behaviour? Should we now assume that the tombstone is transformed into those two bytes?
Please advise.
PS: I updated my original comment with more context.
I have to assume that contract is doing something, but what you can do is compile a simple project with a test and attach it as zip or push it to github so I can take a look
Here you go @olegz: https://github.com/rnferreira/gh-2971
Quick update: I dug deeper and found that the method org.springframework.cloud.function.context.config.JsonMessageConverter#convertToInternal
is converting the KafkaNull
payload into an empty JSON ({}
).
Please let me know whether you think this is worth "fixing" or not.
Greetings, everyone! I encountered an issue with the most recent release of Spring Cloud Stream + Kafka binder (release train 2023.0.2) when using KafkaNull (tombstone records) and TestBinder. With version 2023.0.1, all tests asserting the output of functions that returned KafkaNull passed, whereas, in this new version, they don't. The output is now transformed into
byte[]
, and the payload now has the byte equivalent of"{}"
.Here are the relevant snippets (extremely minimalist):
build.gradle:
Function configuration:
Test:
Application properties:
Expected Behavior:
The test passes.
Actual Behavior:
The test fails with the following message:
Additional context: Spring Cloud Stream version: 4.1.2 Kafka Binder version: 4.1.2 Test Binder: 4.1.2