MQTTnet icon indicating copy to clipboard operation
MQTTnet copied to clipboard

Client application is missing messages at higher loads on 32bit .Net 4.8 applications.

Open vinaybr opened this issue 1 year ago • 5 comments

Client application is missing DataReceived events

Which component is your bug related to?

  • Client

To Reproduce

  • i have data being received on a musquitto mqtt broker. the publisher module is publishing data at an interval of 500ms. I have 2 clients applications(same source, different target) one built using .Net6 and x64bit while the other app is built to target .Net4.8 and x86. while the .Net6 client receives all the messages, the .Net4.8 is missing some of the data packets. This is observed at high loads where the publisher is publishing 100msgs / 500ms (each of the 100msgs is for a different topic).

Expected behavior

All clients should receive all the messages

Screenshots

Additional context / logging

vinaybr avatar Aug 08 '23 15:08 vinaybr

an update to the issue here, we are seeing messages missed and in some cases received in wrong order. its more frequent in 32bit .net4.8 but happens even on 64bit .Net6.

vinaybr avatar Aug 09 '23 10:08 vinaybr

In mqttnet, the default QoS subscription for a topic is 0. That may explain why you are missing messages or seeing them in an unexpected order. Not having seen a sample of your connection code this is only a guess.

Example ...

var subscriptionOptions = m_mqttFactory.CreateSubscribeOptionsBuilder(); foreach(var topicname in connectionData.TopicsToSubscribeTo) { subscriptionOptions.WithTopicFilter(topicname, MqttQualityOfServiceLevel.ExactlyOnce); } await m_client.SubscribeAsync(subscriptionOptions.Build(), m_cancel);

coffeeaddict19 avatar Aug 14 '23 16:08 coffeeaddict19

I have about 13500 retained messages/topics, but I can receive only 1179. The same number after many runs. I tried change QoS of subscription, nothing. Broker mosquitto.

tkouba avatar Mar 27 '24 15:03 tkouba