0

I have installed VerneMQ and Mosquitto on two different servers and I am trying to send test messages from the Mosquitto server to see if they are received on the VerneMQ server. For simplicity, let's call them: VerneMQ - S1 Mosquitto - S2

On S1:

[user1t@s1 ]# netstat -tupln | grep 1883
tcp        0      0 10.0.0.1:1883         0.0.0.0:*               LISTEN      13669/beam.smp

The S1, the config for VerneMQ should allow any connections:

[user1@s1 ]# cat /etc/vernemq/vernemq.conf | grep ano
## Allow anonymous users to connect, default is 'off'. !!NOTE!!
allow_anonymous = on

vernemq ping
Last login: Mon May 25 10:51:12 UTC 2020 on pts/2
pong

From S2

[user1@s2 ]# mosquitto_pub -h 10.0.0.1 -p 1883 -m "message1" -t "topic1" -d
Client mosq-wodJ1DYaw8yqeFMY95 sending CONNECT
Client mosq-wodJ1DYaw8yqeFMY95 received CONNACK (0)
Client mosq-wodJ1DYaw8yqeFMY95 sending PUBLISH (d0, q0, r0, m1, 'topic1', ... (8 bytes))
Client mosq-wodJ1DYaw8yqeFMY95 sending DISCONNECT

How can I check if the messages are received on the other machine. Running the vmq-admin session show does not provide any output

[user1@s1 ]# vmq-admin session show
Last login: Mon May 25 11:04:02 UTC 2020 on pts/2

Is there any location in the logs where I can I see the messages being processed?

alexsnemos
  • 17
  • 1
  • 5

2 Answers2

0

You can use the mosquitto_sub command to see messages that have been published to the broker.

Run the following on S2

mosquitto_sub -h 10.0.0.1 -p 1883 -v -t "topic1"
hardillb
  • 54,545
  • 11
  • 67
  • 105
0

Did you see how mosquitto_pub did a DISCONNECT? That's why the Verne session command doesn't show you a session.

If you want to forward messages from Verne to Mosquitto (or vice versa) you need to configure a bridge, either in Verne or in Mosquitto. And if you find it doesn't work, check your bridge config & make sure you have an understanding on how the topics are mapped.

André F.
  • 356
  • 1
  • 4