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
ApplicationContextmqttClient
IMqttPubSubClientserializer
IPayloadSerializer
Properties
OnTelemetryReceived
public Func<string, T, IncomingTelemetryMetadata, Task>? OnTelemetryReceived { get; set; }
Property Value
ServiceGroupId
public string ServiceGroupId { get; init; }
Property Value
TopicNamespace
public string? TopicNamespace { get; set; }
Property Value
TopicPattern
public string TopicPattern { get; init; }
Property Value
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
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
DisposeAsyncCore(bool)
protected virtual ValueTask DisposeAsyncCore(bool disposing)
Parameters
disposing
bool
Returns
StartAsync(CancellationToken)
Begin accepting telemetry.
public Task StartAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenCancellation token.
Returns
StopAsync(CancellationToken)
public Task StopAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationToken