-
Notifications
You must be signed in to change notification settings - Fork 603
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
ArrayList payloads lose their elements #1112
Comments
@carolmorneau When specifying collection types (batch mode), you must use a concrete type in the function signature. You cannot use generics or wildcard types when running in batch mode. If you change your function signature to the following, it will work.
You must also enable batch mode on the consumer binding when running with a binder that supports the batch mode (for example, the Kafka binder). You can enable batch-mode using the property - |
Thank you @sobychacko for looking into the issue. In our use case, the Spring Message may have different payload types which is why we use The issue occurs specifically when the Spring Message has a payload of type ArrayList. For instance:
The above I was able to pinpoint when the issue was introduced. It appears to be with this change |
Ok, that appears to be a regression issue in Spring Cloud Function. Transferring the issue over there. cc @olegz |
FYI, since this issue was opened, we found two workarounds in order to avoid loosing payload elements:
Also, I created another reproduction sample app based on the function-composition-rabbit sample to showcase the issue. Reproduction steps:
As a side note, for our specific use-case, #1144 is deemed more important than this issue. |
I believe this issue has been addressed with #1145, but i will recheck |
I confirm on my end that it was fixed with #1145, but awaiting for your confirmation |
The fix on Thank you @olegz for the fix |
Describe the issue
Message payloads of type
ArrayList
lose their elements as they go through the Spring Cloud Stream framework.For instance, an application configured with:
and a function defined as:
the output destination receives the Message with an ArrayList payload, however, all elements from the ArrayList have vanished.
It appears that this issue was introduced as part of the following changes in Spring Cloud Function. When I undo the changes from that PR, the issue goes away.
To Reproduce
I have uploaded a minimal application reproducing the issue here.
Run the unit test called
testSpringCloudFunctionIssueWhereArrayListPayloadsLoseTheirElements
to reproduce the issue.Version of the framework
Using version
4.1.0
of Spring Cloud Stream and Spring Cloud FunctionExpected behavior
With the above function, I would expect to receive the message with complete arrayList payload on the output destination.
The text was updated successfully, but these errors were encountered: