Skip to content
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

Not possible to create pretty JSON from headers. #83

Closed
carlbenson opened this issue Aug 26, 2015 · 4 comments
Closed

Not possible to create pretty JSON from headers. #83

carlbenson opened this issue Aug 26, 2015 · 4 comments

Comments

@carlbenson
Copy link

AMQP.BasicProperties.getHeaders() returns a Map<String, Object> where the strings are of type LongStringHelper.ByteArrayLongString that is a private internal class which makes it impossible to write custom serializers for this class. Using Google Gson for instance, always inserts a "bytes": key before the value. While it is easy to write a serializer that converts the resulting byte[], I'd like to have the string value only without the "bytes": key.

In short, how can I produce a regular Java string out of LongStringHelper.ByteArrayLongString?

@michaelklishin
Copy link
Member

ByteArrayLongString#toString?

@michaelklishin
Copy link
Member

@carlbenson toString will be a part of the LongString interface in 3.6.0.

@michaelklishin
Copy link
Member

@carlbenson for now, it should be possible to use getBytes (already part of the interface) and produce a string from that, using UTF-8 as encoding.

@dumbbell dumbbell added this to the n/a milestone Sep 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants