Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

new String((byte[]) message.getPayload()) uses default character set, usage of UTF8 would make message payload content more predictable #179

Open
mgevantmakher opened this issue Dec 13, 2023 · 0 comments

Comments

@mgevantmakher
Copy link

https://github.com/idealo/spring-cloud-stream-binder-sqs/blob/56102495b5d1ea2ab277af2082f20166ad6c6107/src/main/java/de/idealo/spring/stream/binder/sqs/SqsPayloadConvertingChannelInterceptor.java#L12C56-L12C56

  • The code from above uses Charset.defaultCharset() under the hood, which is causing issues in cross os/cross jvm messaging use cases. Usage of UTF8 would produce more consistent cross os/jvm experience.

  • Additionally this code assumes that Spring message payload is byte[] and only works with byte [] payload, otherwise it throw java.lang.ClassCastException: class java.lang.String cannot be cast to class [B (java.lang.String and [B are in module java.base of loader 'bootstrap') for example when payload is a string.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant