你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

DeviceClient.RejectAsync Method

Definition

Overloads

RejectAsync(Message)

Deletes a received message from the device queue and indicates to the server that the message could not be processed.

RejectAsync(String)

Deletes a received message from the device queue and indicates to the server that the message could not be processed.

RejectAsync(Message, CancellationToken)

Deletes a received message from the device queue and indicates to the server that the message could not be processed.

RejectAsync(String, CancellationToken)

Deletes a received message from the device queue and indicates to the server that the message could not be processed.

RejectAsync(Message)

Deletes a received message from the device queue and indicates to the server that the message could not be processed.

public System.Threading.Tasks.Task RejectAsync(Microsoft.Azure.Devices.Client.Message message);
member this.RejectAsync : Microsoft.Azure.Devices.Client.Message -> System.Threading.Tasks.Task
Public Function RejectAsync (message As Message) As Task

Parameters

message
Message

The message.

Returns

The lock identifier for the previously received message

Remarks

You cannot reject or abandon messages over MQTT protocol. For more details, see https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messages-c2d#the-cloud-to-device-message-life-cycle.

Applies to

RejectAsync(String)

Deletes a received message from the device queue and indicates to the server that the message could not be processed.

public System.Threading.Tasks.Task RejectAsync(string lockToken);
member this.RejectAsync : string -> System.Threading.Tasks.Task
Public Function RejectAsync (lockToken As String) As Task

Parameters

lockToken
String

The message lockToken.

Returns

The previously received message

Remarks

You cannot reject or abandon messages over MQTT protocol. For more details, see https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messages-c2d#the-cloud-to-device-message-life-cycle.

Applies to

RejectAsync(Message, CancellationToken)

Deletes a received message from the device queue and indicates to the server that the message could not be processed.

public System.Threading.Tasks.Task RejectAsync(Microsoft.Azure.Devices.Client.Message message, System.Threading.CancellationToken cancellationToken);
member this.RejectAsync : Microsoft.Azure.Devices.Client.Message * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function RejectAsync (message As Message, cancellationToken As CancellationToken) As Task

Parameters

message
Message

The message to reject.

cancellationToken
CancellationToken

A cancellation token to cancel the operation.

Returns

The lock identifier for the previously received message

Exceptions

Thrown when the operation has been canceled.

Thrown when the operation has been canceled. The inner exception will be OperationCanceledException.

Remarks

You cannot reject or abandon messages over MQTT protocol. For more details, see https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messages-c2d#the-cloud-to-device-message-life-cycle.

Applies to

RejectAsync(String, CancellationToken)

Deletes a received message from the device queue and indicates to the server that the message could not be processed.

public System.Threading.Tasks.Task RejectAsync(string lockToken, System.Threading.CancellationToken cancellationToken);
member this.RejectAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function RejectAsync (lockToken As String, cancellationToken As CancellationToken) As Task

Parameters

lockToken
String

The message lockToken.

cancellationToken
CancellationToken

A cancellation token to cancel the operation.

Returns

The previously received message

Exceptions

Thrown when the operation has been canceled.

Thrown when the operation has been canceled. The inner exception will be OperationCanceledException.

Remarks

You cannot reject or abandon messages over MQTT protocol. For more details, see https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messages-c2d#the-cloud-to-device-message-life-cycle.

Applies to