rabbitMQ add Plugin Configuration

137 views
Skip to first unread message

yong

unread,
Jul 2, 2019, 12:01:21 AM7/2/19
to rabbitmq-users
Hi all;

         I want to connect with rabbitMQ using MQTT, but I don't know how to add plugin configuration as   https://www.rabbitmq.com/mqtt.html#config said .

My environment : ubuntu.

             I tried to add rabbitmq.config  file at location  /etc/rabbitmq  with content:

mqtt.listeners.tcp.default = 1883
## Default MQTT with TLS port is 8883
# mqtt.listeners.ssl.default = 8883

# anonymous connections, if allowed, will use the default
# credentials specified here
mqtt.allow_anonymous  = true
mqtt.default_user     = guest
mqtt.default_pass     = guest

mqtt.vhost            = /
mqtt.exchange         = amq.topic
# 24 hours by default
mqtt.subscription_ttl = 86400000
mqtt.prefetch         = 10

but server cannot run .




 

Michael Klishin

unread,
Jul 2, 2019, 2:45:43 AM7/2/19
to rabbitmq-users
If you plan on using the new style config format, the file must be named rabbitmq.conf. See [1][2].


--
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 email to rabbitm...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/6f9b20f3-7d30-4b86-be6f-5dfb94f070a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
MK

Staff Software Engineer, Pivotal/RabbitMQ
Message has been deleted

yong

unread,
Jul 2, 2019, 5:50:03 AM7/2/19
to rabbitmq-users
Thanks , it works. But I also cannot receive mosquito mqtt message . Can you help ? Here is my operation :

1. Modify  mosquitto.conf , add below message and restart mosquito mqtt :

connection main
address 192.168.18.82
bridge_attempt_unsubscribe false
bridge_protocol_version mqttv311
bridge_insecure true
log_type debug
topic public out

2. add below configure message in rabbitmq.conf and restart rabbitMQ

mqtt.listeners.tcp.default = 1883
## Default MQTT with TLS port is 8883
# mqtt.listeners.ssl.default = 8883

# anonymous connections, if allowed, will use the default
# credentials specified here
mqtt.allow_anonymous  = true
mqtt.default_user     = guest
mqtt.default_pass     = guest

mqtt.vhost            = /
mqtt.exchange         = amq.topic
# 24 hours by default
mqtt.subscription_ttl = 86400000
mqtt.prefetch         = 10


3. mosquitto publish a messsage and see if rabbitMQ recevice . 

mosquitto_pub -t topic -m "Hello MQTT"

In fact it cannot work , in the http://192.168.18.82:15672/#/queues or http://192.168.18.82:15672/#/ I cannot see anything . I don't know which step I do wrong or is there anything I
I'm missing .

yong

unread,
Jul 2, 2019, 6:06:04 AM7/2/19
to rabbitmq-users
The fact is that I have a wifi mudule and it can linked with mosquito mqtt  with below information :

AT+MQIPPORT=192.168.18.81,1883
AT+MQUSERPWD=user,123456

Note:
Server IP : 192.168.18.81
IP PORT : 1883
UserName: user
Password : 123456

But I use this message to connect with rabbitMQ, it cannot work  and this is why I 'm make a bridge between mosquitto with rabbitMQ 
Peharps is it possible I can link my device with rabbitMQ directly ? If yes, what should I do in rabbitMQ and what topic I can publish using rabbitMQ default mode ?

Michael Klishin

unread,
Jul 2, 2019, 7:38:23 AM7/2/19
to rabbitmq-users
Start with inspecting server logs [1][2] and ensuring that the client can connect [3].
For that the MQTT plugin must be enabled and its port accessible. Default user (guest) can only connect from localhost [4] which is not the case in your examples.


On Tue, Jul 2, 2019 at 11:48 AM yong <wenqi...@gmail.com> wrote:
Thanks , it works. But I also cannot receive mosquito mqtt message . Can you help ? Here is my operation :

1. Modify  mosquitto.conf , add below message and restart mosquito mqtt :

connection main
address 192.168.18.82
bridge_attempt_unsubscribe false
bridge_protocol_version mqttv311
bridge_insecure true
log_type debug
topic public out

2. add below configure message in rabbitmq.conf and restart rabbitMQ

mqtt.listeners.tcp.default = 1883
## Default MQTT with TLS port is 8883
# mqtt.listeners.ssl.default = 8883

# anonymous connections, if allowed, will use the default
# credentials specified here
mqtt.allow_anonymous  = true
mqtt.default_user     = guest
mqtt.default_pass     = guest

mqtt.vhost            = /
mqtt.exchange         = amq.topic
# 24 hours by default
mqtt.subscription_ttl = 86400000
mqtt.prefetch         = 10


3. mosquitto publish a messsage and see if rabbitMQ recevice . 

mosquitto_pub -t topic -m "Hello MQTT"

In fact it cannot work , in the http://192.168.18.82:15672/#/queues or http://192.168.18.82:15672/#/ I cannot see anything . I don't know which step I do wrong or is there anything I
I'm missing .





在 2019年7月2日星期二 UTC+8下午12:01:21,yong写道:

--
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 email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

yong

unread,
Jul 3, 2019, 4:41:01 AM7/3/19
to rabbitmq-users

Hi ;

       I add below  message in rabbit.conf to change log file level
    log.file.level = debug

      Here is my rab...@ubuntu.log content ,but it cannot know why I don't receive the message .


=INFO REPORT==== 3-Jul-2019::01:27:42 ===
MQTT vhost picked using plugin configuration or default

=INFO REPORT==== 3-Jul-2019::01:27:42 ===
accepting MQTT connection <0.645.0> (192.168.18.81:58528 -> 192.168.18.82:1883)

=INFO REPORT==== 3-Jul-2019::01:27:42 ===
closing MQTT connection <0.645.0> (192.168.18.81:58528 -> 192.168.18.82:1883)


mosqutto publish message :
mosquitto_pub -h 192.168.18.82 -t /amq/topic -m "Hello World" -u root2 -P 123456 -p 1883

root2 has all access to rabbitMQ.


在 2019年7月2日星期二 UTC+8下午7:38:23,Michael Klishin写道:
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitm...@googlegroups.com.

To post to this group, send email to rabbitm...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/31f49635-b4bc-40d6-a1b0-2a36df72b8d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Jul 4, 2019, 6:09:23 AM7/4/19
to rabbitmq-users
We don't have sub-second precision in 3.6 logs but what very likely happens is that Mosquitto publishes a message without
waiting for any confirmation and closes the connection. The message is then not guaranteed to be actually processed.

[1][2][3] cover relevant concepts (not specific to MQTT, as the general problem is not).
Using QoS 1 should help with this.


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.

Michael Klishin

unread,
Jul 4, 2019, 6:13:44 AM7/4/19
to rabbitmq-users
Also, [1] which documents protocol-specific terminology around publisher acknowledgements (including MQTT).

huang yong

unread,
Jul 4, 2019, 11:38:54 PM7/4/19
to rabbitm...@googlegroups.com
Hi

     Thanks for your help .
Now I can use Trace log to see default Virtual host log , but it cannot add the trace for another Virtual host . I search the net and could not find the result . 
图片.png
图片.png

Michael Klishin <mkli...@pivotal.io> 于2019年7月4日周四 下午6:09写道:
Reply all
Reply to author
Forward
0 new messages