TelemetryMessage Class

Definition

The data structure that represents the message that will be sent to IoT hub.

public class TelemetryMessage
type TelemetryMessage = class
Public Class TelemetryMessage
Inheritance
TelemetryMessage

Constructors

TelemetryMessage()

Default instantiation with no payload.

TelemetryMessage(Object)

Creates an outgoing message with the specified payload.

Properties

BatchCreatedOnUtc

The event creation time when sending data in a batch.

ComponentName

The DTDL component name from where the telemetry message has originated. This is relevant only for plug and play certified devices.

ConnectionDeviceId

Specifies the device Id from which this message was sent, if there is one.

ConnectionModuleId

Specifies the module Id from which this message was sent, if there is one.

ContentEncoding

Used to specify the content encoding type of the message.

ContentType

Used to specify the content type of the message.

CorrelationId

A string property that typically contains the MessageId of the request, in request-reply patterns.

CreatedOnUtc

The event creation time when sending one message at a time.

EnqueuedOnUtc

Date and time when the device-to-cloud message was received by the server.

ExpiresOnUtc

The time when this message is considered expired.

InputName

Specifies the input name on which the message was sent, if there was one.

IsSecurityMessage

True if the message is set as a security message

MessageId

An identifier for the message used for request-reply patterns. Format: A case-sensitive string ( up to 128 char long) of ASCII 7-bit alphanumeric chars

  • {'-', ':', '/', '', '.', '+', '%', '_', '#', '*', '?', '!', '(', ')', ',', '=', '@', ';', '$', '''}. Non-alphanumeric characters are from URN RFC.
MessageSchema

Used to specify the schema of the message content.

Payload

The message payload.

PayloadConvention

The convention to use with this message payload.

Properties

Gets the dictionary of user properties which are set when user sends the data.

SystemProperties

Gets the dictionary of system properties which are managed internally.

UserId

An Id used to specify the origin of messages.

Methods

CloneWithBody(Object)

Clones an existing Message instance and sets content body defined by payload on it.

SetAsSecurityMessage()

Sets the message as an security message

Applies to