0
votes

The context:

  1. mosquitto broker 1.5.7 running on a private cloud:

Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux

Extract of mosquitto.conf:

allow_anonymous false
password_file /etc/mosquitto/passwd
log_type all
  1. X clients (nodeJS mqtt package) SUB on the same topic xxx

Extract of their nodeJS config:

reconnectPeriod: 30000  (ms)
keepalive: 300  (sec) 
qos: 2 
clean = false

(version of node mqtt module: 3.0.0)

  1. Another client PUB in QoS2 on topic xxx

The problem:

PUB/SUB on the topic xxx worked fine during the first few hours, but clients (SUB) suddenly stop to received messages. Clients (SUB) are well connected and subscribed to the broker.

When I check the broker #$SYS,I can see :

  • "$SYS/broker/clients/active" OK
  • "$SYS/broker/clients/connected" OK (same number of active)
  • "$SYS/broker/subscriptions/count/" OK

When I check on the "mosquitto log", I can see the broker PUBLISH message only to 3 of my 7 SUB clients... so it is understandable my 4 others clients never received the message...

What Can I do to resolve this strange problem ?

Thank for your help.

1
You really should probably upgrade to the v2.x of mosquitto, 1.5.7 is VERY oldhardillb
I plan to do it yes. I keep you inform herelopic
Hi, I have updated mosquitto to 2.0.10 and the problem is till the same... What can I try to resolve it please ?lopic
I finally find a solution to make my architecture work : I switch the Qos SUB of all my devices to Qos1 (instead of Qos2). My conclusion is the Qos2 on SUB is not well managed by the broker if multiple subscribers on the same topic (7 in my case). In this case : turn Qos SUB to Qos 1 and it works fine ! This ticket can be close!lopic
If you want to delete the question then there is a link under tags.hardillb

1 Answers

0
votes

I finally find a solution to make my architecture work: I switch the Qos SUB of all my devices to Qos1 (instead of Qos2).

My conclusion is the Qos2 on SUB is not well managed by the broker if multiple subscribers on the same topic (7 in my case).

In this case: turn Qos SUB to Qos 1 and it works fine!