0

I am using c# M2MQTT Client code to publish and subscribe the data. I have set the QOS Level 1 or 2. Do not know that how the publisher will get the notification when delivery completes. I have searched a lot on inter net but no code available. Please let me know if any one how to handle the acknowledgement at publisher end in c#.

MqttClient client = new MqttClient(IPAddress.Parse(mqttserverurl));
 clientId = Guid.NewGuid().ToString();
   client.Connect(clientId, uname, pwd);`enter code here`

   client.Publish("testtopic", Encoding.UTF8.GetBytes("Hi"), MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE, false);
Mouse on the Keys
  • 322
  • 1
  • 5
  • 13
MUJAVED
  • 1
  • 1

1 Answers1

0

You don't.

It's all handled internally by the MQTT client library and M2MQTT doesn't seem to have a on_publish callback.

hardillb
  • 54,545
  • 11
  • 67
  • 105
  • You mean no mqtt publisher client get notification on the delivered message in QOS1 or QOS2 ??? – MUJAVED Aug 08 '19 at 04:50
  • I have seen your comment on this link : https://stackoverflow.com/questions/37875962/acknowledgement-on-publish-mqtt Clearly you mention that most of the libraries support this callback. Can i get any c# library information where deliverycomplete callback support – MUJAVED Aug 08 '19 at 04:55
  • I have situation where need to show logs to the client where all published messages are delivered ? – MUJAVED Aug 08 '19 at 04:59
  • As I said, "most" in this case I can see no evidence that M2MQTT supports this feature. – hardillb Aug 08 '19 at 08:11
  • Apologies to interrupt you but any other library or api supports same ? – MUJAVED Aug 08 '19 at 09:51