0

I want to get sensor data that are published by a mqtt client. The client connect to my server but I cannot found any event on MqttServer that handle published messages by the client. Is it possible or is there any example about it ?

P.S: In the old versions Mqttnet server has UseApplicationMessageReceivedHandler that handle incoming messages.

Find an example or solution about subscribing in a server (broker).

hmfarimani
  • 531
  • 1
  • 8
  • 13
  • 1
    As a rule you do not write a MQTT broker to do this, you implement another client that connects to the broker and subscribes to the messages the sensor is publishing – hardillb Jul 13 '23 at 08:08
  • Oh, I see. thank for your comment. Do you recommend make a BackgroundService as client in my asp host? – hmfarimani Jul 13 '23 at 08:56
  • 1
    Or take a look at this sample. This replaces the previous `ApplicationMessageReceivedHandler` https://github.com/dotnet/MQTTnet/blob/master/Samples/Server/Server_Intercepting_Samples.cs – Jeanot Zubler Jul 25 '23 at 11:12

0 Answers0