'REST API service with MQTT client (subscriber) implementation
In C # (asp.net web api) I try to create an app/service that has the task of serving the REST API (only GET method) on one side and listening to MQTT messages on the other side. The REST API part has a controller, service and classes for DTOs and models. The MQTT part should listen to the messages on a particular broker topic and based on the received messages it should create new objects and put them in the list (some kind of persistence of data available to the REST API part). Using MQTTNet NuGet I created an MQTT client (subscriber only) and as a separate part it work.
My question now is how to integrate the MQTT part and the REST API part? Where do you think it would be best to insert the MQTT client, as a separated class, add the code to the service (business logic for API controller) or something else?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
