in spring cloud stream 3.2.3, how to Manually Handle Null Payload manually
And @StreamListener annotation is deprecated
How to handle it, without changing any versions
Answers
-
Hi @Kitrakrev,
As you've probably seen, a Spring Message does not allow for a null payload. Because of this exact issue we added support in our Binder in v3.3.0 of the "Solace Spring Cloud Stream Starter" (back in March 2022) where the payload is empty but a header is marked as null. Unfortunately, without upgrading to v3.3.0 or newer I'm not sure there is much you can do. I would recommend upgrading to 3.3.0 or even 3.5.0 which is the latest minor version upgrade. With a minor version upgrade you should not see backwards breaking changes.
You can find releases here:
Once you upgrade you can identify null payloads as defined in the docs here: https://github.com/SolaceProducts/solace-spring-cloud/tree/master/solace-spring-cloud-starters/solace-spring-cloud-stream-starter#empty-payload-vs-null-payload
0