Skip to content

Receiver

Namespace: MQTT_Receiver_Worker.MQTT

Handles MQTT topic subscription and message receiving functionality.
This class is responsible for subscribing to configured topics from the settings repository
and managing the connection to the MQTT broker.

public class Receiver : MQTT_Receiver_Worker.MQTT.Interfaces.IReceiver

Inheritance ObjectReceiver

Implements IReceiver

Constructors

Receiver(IServiceProvider, IConnection, ILogger<Receiver>)

Initializes a new instance of the Receiver class.

public Receiver(IServiceProvider serviceProvider, IConnection connection, ILogger<Receiver> logger)

Parameters

serviceProvider IServiceProvider

Service provider for dependency injection.

connection IConnection

Connection manager for the MQTT client.

logger ILogger<Receiver>

Logger for diagnostic information.

Methods

SubscribeToTopics()

Subscribes to configured MQTT topics using shared subscriptions.
Retrieves topic settings from the repository and establishes subscriptions

public Task SubscribeToTopics()

Returns

A task that represents the asynchronous subscribe operation.