Table of Contents

Class TelemetryReceiver<T>

Namespace
Azure.Iot.Operations.Protocol.Telemetry
Assembly
Azure.Iot.Operations.Protocol.dll
public abstract class TelemetryReceiver<T> : IAsyncDisposable where T : class

Type Parameters

T
Inheritance
TelemetryReceiver<T>
Implements
Inherited Members

Constructors

TelemetryReceiver(ApplicationContext, IMqttPubSubClient, IPayloadSerializer)

public TelemetryReceiver(ApplicationContext applicationContext, IMqttPubSubClient mqttClient, IPayloadSerializer serializer)

Parameters

applicationContext ApplicationContext
mqttClient IMqttPubSubClient
serializer IPayloadSerializer

Properties

OnTelemetryReceived

public Func<string, T, IncomingTelemetryMetadata, Task>? OnTelemetryReceived { get; set; }

Property Value

Func<string, T, IncomingTelemetryMetadata, Task>

ServiceGroupId

public string ServiceGroupId { get; init; }

Property Value

string

TopicNamespace

public string? TopicNamespace { get; set; }

Property Value

string

TopicPattern

public string TopicPattern { get; init; }

Property Value

string

TopicTokenMap

The topic token replacement map that this receiver will use by default. Generally, this will include the token values for topic tokens such as "modelId" which should be the same for the duration of this receiver's lifetime.

public Dictionary<string, string> TopicTokenMap { get; protected set; }

Property Value

Dictionary<string, string>

Remarks

Tokens replacement values can also be specified when starting the receiver by specifying the additionalTopicToken map in StartAsync(Dictionary<string, string>?, CancellationToken).

Methods

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public virtual ValueTask DisposeAsync()

Returns

ValueTask

A task that represents the asynchronous dispose operation.

DisposeAsync(bool)

public virtual ValueTask DisposeAsync(bool disposing)

Parameters

disposing bool

Returns

ValueTask

DisposeAsyncCore(bool)

protected virtual ValueTask DisposeAsyncCore(bool disposing)

Parameters

disposing bool

Returns

ValueTask

StartAsync(CancellationToken)

Begin accepting telemetry.

public Task StartAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task

StopAsync(CancellationToken)

public Task StopAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task