IotHubBaseClient.SendTelemetryBatchAsync Method

Definition

Sends a batch of telemetry message to IoT hub.

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

Parameters

messages
IEnumerable<TelemetryMessage>

An IEnumerable<T> set of message objects.

cancellationToken
CancellationToken

A cancellation token to cancel the operation.

Returns

Exceptions

Thrown if the client instance is not opened already.

Thrown when the operation has been canceled.

Remarks

The client instance must be opened already.

Use AMQP for a true batch operation. MQTT will just send the messages one after the other.

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

Applies to