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
529: Fixed conversion from byte array to String #527
Conversation
Looks like the build failed because SonarQube wasn't available. What am I supposed to do now? |
Hi! I'll have a look. It's the first external PR since we introduced sonarcloud. Maybe we missed some configuration. BR, |
Hi, thank you :-) |
I think we have to think about what this change implies to other payloads that are represented as byte array but not resolve to a String value. I think of binary data such as images, pdf and so on. The |
This reverts commit 1caddc6.
…age of ObjectMapper's readValue method with byte array input
I see. To avoid this I put the conversion directly in JsonMappingValidationCallback. I guess it solves the problem, but it is rather ugly. |
We should check this. If this is the case, we're missing some tests here to ensure that binary data works. BR, |
You would have to find the binary data that causes some trouble when print to the console with You simply do not want to print String representation of binary data that is not resolvable to a character stream. Your log will explode with non readable chars. That is why we used |
Let us look at this from another point of view. We get some binary message on JMS and want to validate the payload to an expected String as we know that the binary data is actually a String representation. Why not using one of the binaryBase64 message validators or introduce a message processor that takes the binary data and converts to a Spring as suggested with |
Hi!
But this change is not only about logging. Changes in the BR, |
@lmeyer4 Could please open an issue concerning the change, describing what's wrong with the current implementation from your perspective, including a test case sample? This would be very helpful for further discussion. =) BR, |
Agreed |
@svettwer Sure, I'll do that later today or tomorrow |
Hi! Concerning the broken build. There is currently a bug in the addon for travis from sonarcloud. I'll add the mentioned workaround and rebase your PR branch. BR, |
I created the issue (#529) |
Hi! I think we should double check the change from #359 concerning the The use of Therefore I'd recommend to revert the change of the BR, |
Arrays.toString converts the byte array into a String containing the numeric representation of each byte, e.g. [10, 29, 15]. What we actually want is a conversion into the characters, which the bytes represent.
This prevents a correct conversion of the payload from jms messages.