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

Sometimes this library returns a ByteArrayLongString #109

Closed
andrewvc opened this issue Jan 13, 2017 · 4 comments
Closed

Sometimes this library returns a ByteArrayLongString #109

andrewvc opened this issue Jan 13, 2017 · 4 comments

Comments

@andrewvc
Copy link
Contributor

andrewvc commented Jan 13, 2017

We've received reports from the field that sometimes this lib returns a com.rabbitmq.client.impl.LongStringHelper$ByteArrayLongString. A lot of JRuby code doesn't know how to handle this since it doesn't extend String or any other common object.

I think the correct thing to do is to convert this to a RubyString. @michaelklishin what do you think?

@michaelklishin
Copy link
Member

Long strings are a protocol "feature" and they are used in property tables (e.g. optional message headers). Sometimes those values are never exposed to March Hare, in others it'd have to coerce arbitrarily nested arguments.

ByteArrayLongString can be easily converted to a java.lang.String. If someone wants to submit a PR, I would consider it.

@andrewvc
Copy link
Contributor Author

@michaelklishin I'd much prefer the patch be done here, and am glad to submit a PR for that. The tricky thing from a user perspective is that ruby users are not expecting that object necessarily (which is my case).

@michaelklishin
Copy link
Member

@andrewvc feel free to look into it. Normalizing message headers should be enough for just about everyone.

@michaelklishin
Copy link
Member

@andrewvc I agree that March Hare is the right place to address this. Just pointed out that it's easy to convert that "string-ish" object into a java.lang.String.

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

No branches or pull requests

2 participants