ANN MQTT-over-WebSockets plugin available for community evaluation

622 views
Skip to first unread message

Michael Klishin

unread,
Jan 21, 2016, 8:06:49 AM1/21/16
to rabbitm...@googlegroups.com
Hi, 

Team RabbitMQ just published a release of our new MQTT-over-WebSockets plugin:

 * https://github.com/rabbitmq/rabbitmq-web-mqtt/releases/tag/v1.0.0
 * https://github.com/rabbitmq/rabbitmq-web-mqtt-examples/releases/tag/v1.0.0

The plugin is a very close replica of our STOMP-over-WebSockets plugin and targets
RabbitMQ 3.6.x. We used Eclipse Paho JS client in the examples.

If you've been looking for a way to use RabbitMQ with MQTT over WebSockets, we'd love
to hear what you think.

The plugin is currently considered to be experimental (as in: we have no feedback on it)
but has a good chance of shipping with a future 3.6.x release.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


Santiago Fernández

unread,
Jan 21, 2016, 8:24:39 AM1/21/16
to rabbitm...@googlegroups.com
Great!!


--
Santiago



--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send an email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Jan 21, 2016, 8:27:04 AM1/21/16
to rabbitm...@googlegroups.com
On 21 January 2016 at 16:06:42, Michael Klishin (mkli...@pivotal.io) wrote:
> * https://github.com/rabbitmq/rabbitmq-web-mqtt/releases/tag/v1.0.0
> * https://github.com/rabbitmq/rabbitmq-web-mqtt-examples/releases/tag/v1.0.0
>
> The plugin is a very close replica of our STOMP-over-WebSockets
> plugin and targets
> RabbitMQ 3.6.x. We used Eclipse Paho JS client in the examples.

Also, apologies for the near total lack of documentation. The plugin is very much a clone
of Web STOMP, just uses a different port.

We will produce some docs once we are sure that the plugin is reasonably complete .

Santiago Fernández

unread,
Jan 21, 2016, 10:32:05 AM1/21/16
to rabbitm...@googlegroups.com
I'm getting the following error; log is attached:

=INFO REPORT==== 21-Jan-2016::12:29:06 ===
Error description:
   {could_not_start,rabbitmq_web_mqtt,
       {undef,
           [{lager_config,get,[{rabbit_log_lager_event,loglevel},{0,[]}],[]},
            {rabbit_web_mqtt_app,mqtt_init,0,
                [{file,"src/rabbit_web_mqtt_app.erl"},{line,64}]},
            {rabbit_web_mqtt_app,start,2,
                [{file,"src/rabbit_web_mqtt_app.erl"},{line,31}]},
            {application_master,start_it_old,4,
                [{file,"application_master.erl"},{line,273}]}]}}


After clone the plugin's repo, I ran:

$ make dist

and copied generated .ez to rabbitmq plugins folder.





--
Santiago

rabbit@m4400.log

Santiago Fernández

unread,
Jan 21, 2016, 10:48:42 AM1/21/16
to rabbitm...@googlegroups.com
Sorry... downloading 1.0.0 .ez file works fine!


--
Santiago

OL CO

unread,
Jan 28, 2016, 7:30:50 AM1/28/16
to rabbitmq-users
Hi,

Thank you very much for your work.

I am very interested to try MQTT over websockets with RabbitMQ... but i am a neebie. Sorry for this message but i didn't find my answer in this group. 

I am trying to use your plugin with RabbitMQ 3.6.0... but without success for the moment and i don't understand why. I feel it's a little thing.

I have followed the install instructions. I'm using the default configuration. I tried your examples first and with MQTT Lens in a second time. 

The server logs says to me :

=INFO REPORT==== 28-Jan-2016::13:03:31 ===
rabbit_web_mqtt: listening for HTTP connections on 0.0.0.0:15675

... so i believe that my configuration is fine (i attached it).

When a tried to connect the client, it says :

CONNECT TO 127.0.0.1:15675 
CONNECTION FAILURE - AMQJS0007E Socket error:undefined. 

Note : I used the version 43.0.4 of Firefox and 48.0.2564.82 of Chrome

Near that, the MQTT TCP connector works fine with MQTT Lens...

I tried another port (10193) which works fine with another broker, but i obtain the same result. I feel i have to specify the IP address and not the wildcard 0.0.0.0.... or something like that.

Do you have an idea for me ?

Thank you very much,

Olivier
rabbitmq.config

Michael Klishin

unread,
Jan 28, 2016, 7:34:15 AM1/28/16
to rabbitm...@googlegroups.com, OL CO
On 28 January 2016 at 15:30:52, OL CO (ocos...@gmail.com) wrote:
> When a tried to connect the client, it says :
>
> CONNECT TO 127.0.0.1:15675
> CONNECTION FAILURE - AMQJS0007E Socket error:undefined.

What client  do you use? Please post your code.

Does MQTT Lens use WebSockets? From the description it sounds like it connects
over "regular" TCP, so MQTT port should be 1883.

OL CO

unread,
Jan 28, 2016, 7:42:32 AM1/28/16
to rabbitmq-users, ocos...@gmail.com
Yes MQTT Lens uses Web Sockets (i attached a screen capture).

For me, MQTT Lens is another way to test the connectivity. But my main use is with a Paho JS client... and the client error i gave, was from the Paho JS exemple.

So the code is in the example and i din't modify anything :

MQTT_Lens_Capture.png

Michael Klishin

unread,
Jan 28, 2016, 8:24:32 AM1/28/16
to rabbitm...@googlegroups.com, OL CO
On 28 January 2016 at 15:42:34, OL CO (ocos...@gmail.com) wrote:
> So the code is in the example and i din't modify anything

Can you please post the entire RabbitMQ log and `rabbitmq-plugins list` output?

OL CO

unread,
Jan 28, 2016, 8:33:04 AM1/28/16
to rabbitmq-users, ocos...@gmail.com
The logs are attached and the plugin list below.


 Configured: E = explicitly enabled; e = implicitly enabled
 | Status:   * = running on rabbit@COSQUER-O
 |/
[e*] amqp_client                       3.6.0
[e*] cowboy                            1.0.3
[e*] cowlib                            1.0.1
[e*] mochiweb                          2.13.0
[  ] rabbitmq_amqp1_0                  3.6.0
[  ] rabbitmq_auth_backend_ldap        3.6.0
[  ] rabbitmq_auth_mechanism_ssl       3.6.0
[  ] rabbitmq_consistent_hash_exchange 3.6.0
[  ] rabbitmq_event_exchange           3.6.0
[  ] rabbitmq_federation               3.6.0
[  ] rabbitmq_federation_management    3.6.0
[E*] rabbitmq_management               3.6.0
[e*] rabbitmq_management_agent         3.6.0
[  ] rabbitmq_management_visualiser    3.6.0
[E*] rabbitmq_mqtt                     3.6.0
[  ] rabbitmq_recent_history_exchange  1.2.1
[  ] rabbitmq_sharding                 0.1.0
[  ] rabbitmq_shovel                   3.6.0
[  ] rabbitmq_shovel_management        3.6.0
[  ] rabbitmq_stomp                    3.6.0
[  ] rabbitmq_tracing                  3.6.0
[e*] rabbitmq_web_dispatch             3.6.0
[E*] rabbitmq_web_mqtt
[E*] rabbitmq_web_mqtt_examples
[  ] rabbitmq_web_stomp                3.6.0
[  ] rabbitmq_web_stomp_examples       3.6.0
[  ] sockjs                            0.3.4
[e*] webmachine                        git

Thank you,

Olivier
rabbit@COSQUER-O.log

Michael Klishin

unread,
Jan 28, 2016, 8:36:00 AM1/28/16
to rabbitm...@googlegroups.com, OL CO, ocos...@gmail.com
On 28 January 2016 at 16:33:06, OL CO (ocos...@gmail.com) wrote:
> The logs are attached and the plugin list below.

OK, there's an unhandled exception in the log. I'll file an issue. 

Loïc Hoguin

unread,
Jan 28, 2016, 8:37:00 AM1/28/16
to rabbitm...@googlegroups.com, ocos...@gmail.com
The plugin requires changes in rabbitmq-mqtt that were merged after the
3.6.0 release. It therefore can't work with 3.6.0. It will work from
3.6.1 onward, or using the current stable branch of rabbitmq-mqtt.
> <javascript:>) wrote:
> > So the code is in the example and i din't modify anything
>
> Can you please post the entire RabbitMQ log and `rabbitmq-plugins
> list` output?
> --
> MK
>
> Staff Software Engineer, Pivotal/RabbitMQ
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "rabbitmq-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to rabbitmq-user...@googlegroups.com
> <mailto:rabbitmq-user...@googlegroups.com>.
> To post to this group, send email to rabbitm...@googlegroups.com
> <mailto:rabbitm...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--
Loïc Hoguin
http://ninenines.eu
Author of The Erlanger Playbook,
A book about software development using Erlang

OL CO

unread,
Jan 28, 2016, 9:18:33 AM1/28/16
to rabbitmq-users, ocos...@gmail.com, es...@ninenines.eu
Thank you, i will try this.

Olivier

Michael Klishin

unread,
Jan 28, 2016, 9:45:00 AM1/28/16
to OL CO, es...@ninenines.eu, rabbitm...@googlegroups.com
On 28 January 2016 at 17:18:35, OL CO (ocos...@gmail.com) wrote:
> Thank you, i will try this.

We can post a rabbitmq_mqtt .ez build from the tip of stable (which will become 3.6.1 hopefully soon)
in case you need help. 

OL CO

unread,
Jan 28, 2016, 10:18:15 AM1/28/16
to rabbitmq-users, ocos...@gmail.com, es...@ninenines.eu
Yes if possible. It should be great for me (i think i am going in a wrong direction).

Thank you

Michael Klishin

unread,
Feb 1, 2016, 6:02:25 AM2/1/16
to rabbitm...@googlegroups.com, OL CO
On 28 January 2016 at 18:18:18, OL CO (ocos...@gmail.com) wrote:
> Yes if possible. It should be great for me (i think i am going in
> a wrong direction).

Attached. Replace your version of rabbitmq_mqtt.ez with it (the actual file name is
likely a bit different and includes a version).
rabbitmq_mqtt-e4d29d12eae.ez

Chris Bick

unread,
Feb 7, 2016, 1:50:19 PM2/7/16
to rabbitmq-users
Hi,

I got the plugin running with v3.7 and can run the localhost examples.  I would like to run the same examples form a remote host, but I get this error message

"MQTT login failed for "guest" access_refused (access must be from localhost)"

What's the best "access approach" for accessing MQTT over WebSockets from a remote host?

Thanks,
Chris

Michael Klishin

unread,
Feb 7, 2016, 1:54:44 PM2/7/16
to rabbitm...@googlegroups.com, Chris Bick
 On 7 February 2016 at 21:50:23, Chris Bick (ch...@bickster.com) wrote:
> I got the plugin running with v3.7 and can run the localhost examples.
> I would like to run the same examples form a remote host, but I get
> this error message
>
> "MQTT login failed for "guest" access_refused (access must
> be from localhost)"
>
> What's the best "access approach" for accessing MQTT over WebSockets
> from a remote host?

See "Guest user can only connect from localhost" on http://www.rabbitmq.com/access-control.html
and "Plugin Configuration" on http://www.rabbitmq.com/mqtt.html.

The right thing to do is to create a new user and use its credentials (or configure MQTT plugin to use it
when no credentials are provided), and delete "guest".

Chris Bick

unread,
Feb 9, 2016, 11:00:08 PM2/9/16
to rabbitmq-users, ch...@bickster.com
Thanks.

I'm seeing this message in the log file.  Does the plugin support pings?

Web MQTT: unexpected WebSocket frame {ping,<<>>}



Chris

Loïc Hoguin

unread,
Feb 10, 2016, 5:29:33 AM2/10/16
to rabbitm...@googlegroups.com, ch...@bickster.com
It supports ping, the frame is unexpected in one function of the plugin
but the server sends the pong back properly. Will just need to clean
that up.

On 02/10/2016 05:00 AM, Chris Bick wrote:
> Thanks.
>
> I'm seeing this message in the log file. Does the plugin support pings?
>
> Web MQTT: unexpected WebSocket frame {ping,<<>>}
>
>
>
> Chris
>
> On Sunday, February 7, 2016 at 1:54:44 PM UTC-5, Michael Klishin wrote:
>
> On 7 February 2016 at 21:50:23, Chris Bick (ch...@bickster.com
> <javascript:>) wrote:
> > I got the plugin running with v3.7 and can run the localhost
> examples.
> > I would like to run the same examples form a remote host, but I get
> > this error message
> >
> > "MQTT login failed for "guest" access_refused (access must
> > be from localhost)"
> >
> > What's the best "access approach" for accessing MQTT over WebSockets
> > from a remote host?
>
> See "Guest user can only connect from localhost" on
> http://www.rabbitmq.com/access-control.html
> <http://www.rabbitmq.com/access-control.html>
> and "Plugin Configuration" on http://www.rabbitmq.com/mqtt.html
> <http://www.rabbitmq.com/mqtt.html>.
>
> The right thing to do is to create a new user and use its
> credentials (or configure MQTT plugin to use it
> when no credentials are provided), and delete "guest".
> --
> MK
>
> Staff Software Engineer, Pivotal/RabbitMQ
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "rabbitmq-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to rabbitmq-user...@googlegroups.com
> <mailto:rabbitmq-user...@googlegroups.com>.
> To post to this group, send email to rabbitm...@googlegroups.com
> <mailto:rabbitm...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Chris Bick

unread,
Feb 10, 2016, 8:19:56 AM2/10/16
to rabbitmq-users, ch...@bickster.com, es...@ninenines.eu
Ok.  I'm seeing this error now.  What could be causing the error?  

[error] <0.29803.227> closing WEB-MQTT connection "54.183.xxx.xxx:41709 -> 10.0.0.170:15675" (keepalive timeout)



Thanks,
Chris

Loïc Hoguin

unread,
Feb 10, 2016, 8:57:30 AM2/10/16
to Chris Bick, rabbitmq-users
Reading the code, I think this one could be a bug. It's supposed to
trigger if the client didn't send pings but obviously the client did, at
least at the Websocket level.

Please open a ticket.
> > an email to rabbitmq-user...@googlegroups.com <javascript:>
> > <mailto:rabbitmq-user...@googlegroups.com <javascript:>>.
> > To post to this group, send email to rabbitm...@googlegroups.com
> <javascript:>
> > <mailto:rabbitm...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.

Chris Bick

unread,
Feb 16, 2016, 4:20:34 PM2/16/16
to rabbitmq-users, ch...@bickster.com, es...@ninenines.eu
Ok.  

Another question.  Is there a way to authorize based on topic? Check to make sure a client has access to subscribe to a specific topic.

Thanks,
Chris
>      > <mailto:rabbitmq-users+unsub...@googlegroups.com <javascript:>>.

Michael Klishin

unread,
Feb 16, 2016, 8:34:50 PM2/16/16
to rabbitm...@googlegroups.com, ch...@bickster.com, es...@ninenines.eu
There is no, just like there is no in MQTT. We have some ideas about that for the future, sadly MQTT the protocol has no way to communicate an error to a client,
or any provisions for such authorization in general.

Also, please ask questions in separate threads. Stuffing the same thread with unrelated questions is against mailing list etiquette.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages