IotHubModuleClient.SendTelemetryBatchAsync Method

Definition

Sends a batch of events to IoT hub. Use AMQP or HTTPs for a true batch operation. MQTT will just send the messages one after the other. IotHubModuleClient instance must be opened already.

public System.Threading.Tasks.Task SendTelemetryBatchAsync (string outputName, System.Collections.Generic.IEnumerable<Microsoft.Azure.Devices.Client.TelemetryMessage> messages, System.Threading.CancellationToken cancellationToken = default);
override this.SendTelemetryBatchAsync : string * seq<Microsoft.Azure.Devices.Client.TelemetryMessage> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function SendTelemetryBatchAsync (outputName As String, messages As IEnumerable(Of TelemetryMessage), Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

outputName
String

The output target for sending the given message.

messages
IEnumerable<TelemetryMessage>

A list of one or more messages to send.

cancellationToken
CancellationToken

A cancellation token to cancel the operation.

Returns

The task containing the event

Exceptions

Thrown if IotHubModuleClient instance is not opened already.

Thrown when the operation has been canceled.

Remarks

For more information on IoT Edge module routing https://docs.microsoft.com/azure/iot-edge/module-composition?view=iotedge-2018-06#declare-routes.

Applies to