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

ServiceBusReceiver.DeadLetterMessageAsync 方法

定义

重载

DeadLetterMessageAsync(ServiceBusReceivedMessage, IDictionary<String,Object>, CancellationToken)

将消息移动到死信子队列。

DeadLetterMessageAsync(ServiceBusReceivedMessage, String, String, CancellationToken)

将消息移动到死信子队列。

DeadLetterMessageAsync(ServiceBusReceivedMessage, IDictionary<String,Object>, String, String, CancellationToken)

将消息移动到死信子队列。

DeadLetterMessageAsync(ServiceBusReceivedMessage, IDictionary<String,Object>, CancellationToken)

Source:
ServiceBusReceiver.cs
Source:
ServiceBusReceiver.cs

将消息移动到死信子队列。

public virtual System.Threading.Tasks.Task DeadLetterMessageAsync (Azure.Messaging.ServiceBus.ServiceBusReceivedMessage message, System.Collections.Generic.IDictionary<string,object> propertiesToModify = default, System.Threading.CancellationToken cancellationToken = default);
abstract member DeadLetterMessageAsync : Azure.Messaging.ServiceBus.ServiceBusReceivedMessage * System.Collections.Generic.IDictionary<string, obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.DeadLetterMessageAsync : Azure.Messaging.ServiceBus.ServiceBusReceivedMessage * System.Collections.Generic.IDictionary<string, obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function DeadLetterMessageAsync (message As ServiceBusReceivedMessage, Optional propertiesToModify As IDictionary(Of String, Object) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

参数

propertiesToModify
IDictionary<String,Object>

移动到子队列时要修改的消息的属性。

cancellationToken
CancellationToken

一个可选 CancellationToken 实例,用于发出取消操作的请求信号。

返回

例外

  • 消息的锁已过期或消息已完成。 这不适用于已启用会话的实体。 在这种情况下, Reason 将设置为 MessageLockLost
  • 会话的锁已过期或消息已完成。 这仅适用于已启用会话的实体。 在这种情况下, Reason 将设置为 SessionLockLost

注解

若要从死信队列接收消息或传输死信队列,请在调用 或 时将 SubQueue 属性设置为 DeadLetterCreateReceiver(String, String, ServiceBusReceiverOptions)TransferDeadLetterCreateReceiver(String, ServiceBusReceiverOptions) 仅当 设置为 PeekLockReceiveMode,才能执行此操作。

适用于

DeadLetterMessageAsync(ServiceBusReceivedMessage, String, String, CancellationToken)

Source:
ServiceBusReceiver.cs
Source:
ServiceBusReceiver.cs

将消息移动到死信子队列。

public virtual System.Threading.Tasks.Task DeadLetterMessageAsync (Azure.Messaging.ServiceBus.ServiceBusReceivedMessage message, string deadLetterReason, string deadLetterErrorDescription = default, System.Threading.CancellationToken cancellationToken = default);
abstract member DeadLetterMessageAsync : Azure.Messaging.ServiceBus.ServiceBusReceivedMessage * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.DeadLetterMessageAsync : Azure.Messaging.ServiceBus.ServiceBusReceivedMessage * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function DeadLetterMessageAsync (message As ServiceBusReceivedMessage, deadLetterReason As String, Optional deadLetterErrorDescription As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

参数

deadLetterReason
String

死信消息的原因。

deadLetterErrorDescription
String

死信消息的错误说明。

cancellationToken
CancellationToken

一个可选 CancellationToken 实例,用于发出取消操作的请求信号。

返回

例外

  • 消息的锁已过期或消息已完成。 这不适用于已启用会话的实体。 在这种情况下, Reason 将设置为 MessageLockLost
  • 会话的锁已过期或消息已完成。 这仅适用于已启用会话的实体。 在这种情况下, Reason 将设置为 SessionLockLost
  • 死信原因或死信错误说明超出了最大长度 4096。

注解

若要从死信队列接收消息或传输死信队列,请在调用 或 时将 SubQueue 属性设置为 DeadLetterCreateReceiver(String, String, ServiceBusReceiverOptions)TransferDeadLetterCreateReceiver(String, ServiceBusReceiverOptions) 仅当 设置为 PeekLockReceiveMode,才能执行此操作。

适用于

DeadLetterMessageAsync(ServiceBusReceivedMessage, IDictionary<String,Object>, String, String, CancellationToken)

Source:
ServiceBusReceiver.cs
Source:
ServiceBusReceiver.cs

将消息移动到死信子队列。

public virtual System.Threading.Tasks.Task DeadLetterMessageAsync (Azure.Messaging.ServiceBus.ServiceBusReceivedMessage message, System.Collections.Generic.IDictionary<string,object> propertiesToModify, string deadLetterReason, string deadLetterErrorDescription = default, System.Threading.CancellationToken cancellationToken = default);
abstract member DeadLetterMessageAsync : Azure.Messaging.ServiceBus.ServiceBusReceivedMessage * System.Collections.Generic.IDictionary<string, obj> * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.DeadLetterMessageAsync : Azure.Messaging.ServiceBus.ServiceBusReceivedMessage * System.Collections.Generic.IDictionary<string, obj> * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function DeadLetterMessageAsync (message As ServiceBusReceivedMessage, propertiesToModify As IDictionary(Of String, Object), deadLetterReason As String, Optional deadLetterErrorDescription As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

参数

propertiesToModify
IDictionary<String,Object>

移动到子队列时要修改的消息的属性。

deadLetterReason
String

死信消息的原因。

deadLetterErrorDescription
String

死信消息的错误说明。

cancellationToken
CancellationToken

一个可选 CancellationToken 实例,用于发出取消操作的请求信号。

返回

例外

  • 消息的锁已过期或消息已完成。 这不适用于已启用会话的实体。 在这种情况下, Reason 将设置为 MessageLockLost
  • 会话的锁已过期或消息已完成。 这仅适用于已启用会话的实体。 在这种情况下, Reason 将设置为 SessionLockLost
  • 参数和属性字典中都指定了死信原因或死信错误异常。
  • 死信原因或死信错误说明超出了最大长度 4096。

注解

若要从死信队列接收消息或传输死信队列,请在调用 或 时将 SubQueue 属性设置为 DeadLetterCreateReceiver(String, String, ServiceBusReceiverOptions)TransferDeadLetterCreateReceiver(String, ServiceBusReceiverOptions) 仅当 设置为 PeekLockReceiveMode,才能执行此操作。 死信原因和错误说明只能通过方法参数指定,也可以使用此属性进行硬编码。

适用于