-
Notifications
You must be signed in to change notification settings - Fork 631
Description
Describe the issue
Im trying to use Spring Cloud Stream test binder to speed up my integration tests (I'm currently using Testcontainers and everything is working fine, but the startup time is slow). However, when using the test binder there is a weird behavior when serializing the output message, because even if it's well generated and everything seems to work well, the byte array with the payload only contains part of the message. I provide you a link to my GitHub repository with the sample code to reproduce the issue.
It seems that, when building the byte array from the response message, for a reason I'm not able to find the outgoing byte array misses data, because the incoming payload is correct but the written bytes don't match it.
Can you help me in solving this issue, or point me in the right direction to fix it? As soon as you provide me clues about where is the root cause, I'm happy to contribute with the fix to it if needed, but for now I only was able to find where the problem comes from, but not how can I fix it.
Thank you very much for your time!
To Reproduce
Steps to reproduce the behavior:
- If you run
GreeterTestcontainersTestclass, the test will work well - If you run
GreeterTestbindersTest, you will currently see an error because of a bad header when decoding the response. As you can see in the logs, the received payload only contains the value insidemessagefield on the response object with an unknown prefix byte instead of the complete response object, causing the decoding error.
Version of the framework
4.3.0
Expected behavior
When receiving the response payload as a byte array, I should be able to build my output object by using
Screenshots
Additional context
GitHub repository with code sample to reproduce the issue: https://github.com/tamamico/poc-spring-cloud-stream-native.git