LabVIEW-Open-Source/MQTT-Client

Subsription issue when publishing messages with QoS as 2.

achuthaperumal opened this issue · 4 comments

Hi,
First of all, I'd like to express my sincere gratitude for your work here. All the repositories are extremely useful!

I'm using the Latest MQTT Client Toolkit for publishing and subscribing to some messages with different QoS levels. When I do that, the following occurs:

Pub QoS | Sub QoS | Result

0	|		0		|	Able to receive all messages

0	|		1		|	Able to receive all messages

0	|		2		|	Able to receive all messages

1	|		1		|	Able to receive all messages

1	|		1		|	Able to receive all messages

1	|		1		|	Able to receive all messages

2	|		0		|	Able to receive all messages

2	|		1		|	Able to receive all messages

2	|		2		|	Able to receive only the first 19 or 20 messages

I'm using mosquitto broker v2.09. To recreate the issue, Just use the DropVI_SimpleClientPublisher.vi and DropVI_SimpleClientSubscriber.vi and set the QoS level as 2 on both the VIs. I also checked that the published data is received by the broker.

Hi @achuthaperumal
interesting result! Thanks for sharing.

Have you tried to adjust the timeout on the client side? I'm thinking that if the broker receives the message and publishes it back, the only thing that should be an issue is the latency of the exchange. If increasing the timeout makes it possible to get more messages, but not all, then I think it points to a caching/search issue in the client. If you can get them all, it points to a broker timeout issue.

Alternatively, could you try with this native broker? https://github.com/LabVIEW-Open-Source/LV-MQTT-Broker
I'd be curious to see if this also happens with a local, native broker.

FYI. With the local native broker, I can run it indefinitely.

image

I'm not sure this is related, but Mosquitto seems to have a "in flight" queue size of 20. I don't know what it means, but the coincidence with the number of messages you report might indicate it is related.
eclipse/mosquitto#1821 (comment)

Are you using a self-managed installation of Mosquitto? I'd look into the configuration of your server to see if something can be optimized based on your expected latency.

I'm not sure this is related, but Mosquitto seems to have a "in flight" queue size of 20. I don't know what it means, but the coincidence with the number of messages you report might indicate it is related.
eclipse/mosquitto#1821 (comment)

Are you using a self-managed installation of Mosquitto? I'd look into the configuration of your server to see if something can be optimized based on your expected latency.

Hi, I used the native Broker and I was able to get all the messages! So it turns out the problem is with the broker configuration! I set the inflight queue size to unlimited by using the following variable on the mosquitto.conf file.
max_inflight_messages 0

Now, I'm able to receive all the messages. Thank you for your time and effort! BTW The Client Toolkit works flawlessly...