[rabbitmq-discuss] Stomp, subscriptions, and forward slashes
Brennan Sellner
bsellner at seegrid.com
Mon Nov 4 22:35:48 GMT 2013
On 11/04/2013 05:21 AM, Emile Joubert wrote:
>
> On 02/11/13 22:04, Brennan Sellner wrote:
>
>> Is there any way to escape the slash in the exchange name when
>> subscribing via web-stomp? I've blindly tried a few options (i.e. '\\/'
>> or '%47'),
>
>
> You can use %2F as an escaped forward-slash character in STOMP.
>
<facepalm> My bad: URL encoding, not HTML encoding. Thanks!
One more STOMP / WebSockets-related question: The STOMP 1.1 spec states
that it's possible to transmit binary messages
(http://stomp.github.io/stomp-specification-1.1.html, 'Protocol Overview').
However, when I try to consume a binary protobuf from Javascript,
RabbitMQ drops my connection with the bad_utf8_character_code error
report quoted below. Browser-side, I'm using SockJS and stomp.js
(http://www.jmesnil.net/stomp-websocket/doc/).
https://github.com/sockjs/sockjs-protocol/issues/74 makes it clear that
SockJS (at least) doesn't yet support binary payloads. What's not clear
to me is whether rabbitmq_web_stomp does: is it worth fiddling around
with SockJS replacements, or should I just bite the bullet and add a
relay to re-encode everything going to and from the browser as base64?
Thanks,
-Brennan
=ERROR REPORT==== 4-Nov-2013::17:15:03 ===
** Handler sockjs_cowboy_handler terminating in websocket_info/3
for the reason exit:{ucs,{bad_utf8_character_code}}
** Message was go
** Options were {service,"/stomp",#Fun<rabbit_ws_sockjs.1.120271989>,{},
"http://cdn.sockjs.org/sockjs-0.2.js",false,true,
5000,25000,131072,#Fun<rabbit_ws_sockjs.0.116551930>}
** Handler state was {websocket,<0.4058.0>}
** Request was {http_req,#Port<0.20033>,cowboy_tcp_transport,keepalive,
<0.4057.0>,'GET',
{1,1},
{{127,0,0,1},33666},
[<<"localhost">>],
undefined,<<"localhost">>,15674,
[<<"stomp">>,<<"615">>,<<"38_dv47k">>,<<"websocket">>],
[<<"615">>,<<"38_dv47k">>,<<"websocket">>],
<<"/stomp/615/38_dv47k/websocket">>,undefined,<<>>,[],
[{'Cookie',
<<"sessionid=600fbdc35df07db74bf4067b38702643;
csrftoken=ae2bc9d9535ef8f220a0eb467883ea4e">>},
{'User-Agent',
<<"Mozilla/5.0 (X11; Linux x86_64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110
Safari/537.36">>},
{<<"Sec-Websocket-Extensions">>,
<<"x-webkit-deflate-frame">>},
{<<"Sec-Websocket-Version">>,<<"13">>},
{<<"Sec-Websocket-Key">>,<<"dJr61dUXL0ilQiqpgALD3w==">>},
{'Cache-Control',<<"no-cache">>},
{'Pragma',<<"no-cache">>},
{<<"Origin">>,<<"http://localhost:8000">>},
{'Host',<<"localhost">>},
{'Connection',<<"Upgrade">>},
{'Upgrade',<<"websocket">>}],
[{'Upgrade',[<<"websocket">>]},
{'Connection',[<<"upgrade">>]}],
undefined,
[{websocket_version,13}],
waiting,<<>>,done,[],<<>>,
{#Fun<cowboy_http.urldecode.2>,crash}}
** Stacktrace: [{xmerl_ucs,from_utf8,1},
{mochijson2_fork,json_encode_string,2},
{mochijson2_fork,'-json_encode_array/2-fun-0-',3},
{lists,foldl,3},
{mochijson2_fork,json_encode_array,2},
{sockjs_util,encode_frame,1},
{sockjs_ws_handler,reply,2},
{sockjs_cowboy_handler,websocket_info,3}]
My apologies for the below:
Email Confidentiality Notice
The information contained in this transmission is confidential, proprietary or privileged and may be subject to protection under the law. This message is intended for the sole use of the individual or entity to whom it's addressed. If you are not the intended recipient, you are notified that any use, distribution or copying of the message is strictly prohibited and may subject you to criminal or civil penalties. If you received this transmission in error, please contact the sender immediately by replying to this email and delete the material from any computer.
More information about the rabbitmq-discuss
mailing list