DeviceClient.RejectAsync Method

Definition

Overloads

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, 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.

RejectAsync(String)

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.

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

Task

The previously received message

Exceptions

Thrown when the operation has been canceled.

Remarks

You cannot Reject a message over MQTT protocol. For more details, see https://docs.microsoft.com/en-us/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.

cancellationToken
CancellationToken

A cancellation token to cancel the operation.

Returns

Task

The lock identifier for the previously received message

Exceptions

Thrown when the operation has been canceled.

Remarks

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

Applies to

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

Task

The lock identifier for the previously received message

Remarks

You cannot Reject a message over MQTT protocol. For more details, see https://docs.microsoft.com/en-us/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

Task

The previously received message

Remarks

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

Applies to