Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Allow binary data over raw Websocket #19

Closed
essen opened this issue Aug 21, 2015 · 14 comments
Closed

Allow binary data over raw Websocket #19

essen opened this issue Aug 21, 2015 · 14 comments
Assignees
Milestone

Comments

@essen
Copy link
Collaborator

essen commented Aug 21, 2015

Users can't use the Web STOMP plugin with compressed data.

I'm not sure if this should be just using binary frames, or configurable between text and binary, or something else yet. Opening the ticket so this can get tracked.

Relevant mailing list post is there: https://groups.google.com/forum/#!topic/rabbitmq-users/aOJtofH0Z2c

Target at the time of writing is 3.6.0.

@WhiteRabbit-Code
Copy link

I have the same problem when sending data packaged as Protobuf via STOMP, it's binary as well.

@essen
Copy link
Collaborator Author

essen commented Sep 7, 2015

In 3.6.0 we will add another route that doesn't use SockJS. With SockJS, it is not possible to send binary data, at least not without bypassing SockJS entirely, because SockJS works with UTF-8 text only. The new route we add will be under /ws and is pure Websocket. This means that we can use the full protocol on this, and the protocol does allow sending either text (UTF8) frames or binary frames.

Currently this new route is using text frames. We can't detect if the data is text or binary automatically (at least not if you care about performance), but we could try to add an option to choose between text and binary frames.

We have two ways of adding such an option:

  • We could add a global option in the plugin to force text or binary. This would apply to all connections.
  • We could use a header when the Websocket connection is established. This requires the client to specifically request binary, so might not make too much sense if all data going through is binary.

I can try working on the first now and we'll see if anyone has more complex needs down the road. We can always have both at the same time eventually.

@michaelklishin
Copy link
Member

@essen we need to make sure this difference (and the new endpoint) is documented.

@essen
Copy link
Collaborator Author

essen commented Sep 7, 2015

Alright.

@essen
Copy link
Collaborator Author

essen commented Sep 8, 2015

Documentation for this ticket (and endpoint differences) is done, the code and PRs will follow a bit later today.

Docs: https://github.com/rabbitmq/rabbitmq-website/tree/rabbitmq-web-stomp-19

@michaelklishin
Copy link
Member

Please submit a pull request against master.

On 8/9/2015, at 17:00, Loïc Hoguin notifications@github.com wrote:

Documentation for this ticket (and endpoint differences) is done, the code and PRs will follow a bit later today.

Docs: https://github.com/rabbitmq/rabbitmq-website/tree/rabbitmq-web-stomp-19


Reply to this email directly or view it on GitHub.

@essen
Copy link
Collaborator Author

essen commented Sep 8, 2015

Ah you merged it already, I was waiting to be 100% sure with the code aspects before opening a PR.

Anyway the code PR is open now. :-)

@michaelklishin
Copy link
Member

I'm pretty happy that this will be in 3.6.0. Thank you, @essen!

@essen
Copy link
Collaborator Author

essen commented Sep 8, 2015

No problem, more tomorrow. :-)

@pantonis
Copy link

pantonis commented Jul 8, 2016

I know this was closed. How do I use this setting?

@michaelklishin
Copy link
Member

michaelklishin commented Jul 8, 2016

@pantonis start with the docs.

@pantonis
Copy link

pantonis commented Jul 8, 2016

{rabbitmq_web_stomp, [{ws_frame, binary}]}

Found it thanks

@pantonis
Copy link

pantonis commented Aug 8, 2016

I have problem making Protobuf work with rabbitMQ and web-stomp.

I get: "Illegal wire type in unknown group 12: 7 "

Exposed the same data using HTTP endpoint and I am able to read them.

@michaelklishin
Copy link
Member

Please post questions to rabbitmq-users or Stack Overflow. RabbitMQ uses GitHub issues for specific actionable items engineers can work on, not questions. Thank you.

@rabbitmq rabbitmq locked and limited conversation to collaborators Aug 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants