你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
ServiceBusClient.CreateReceiver 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
CreateReceiver(String) |
创建一个 ServiceBusReceiver 实例,该实例可用于从特定队列接收和解决消息。 它使用 ServiceBusReceiveMode 指定接收消息的方式。 默认为“PeekLock”模式。 如果要更改 , ServiceBusReceiveMode请使用 CreateReceiver(String, ServiceBusReceiverOptions) 方法。 ServiceBusReceiveMode在 中ServiceBusReceiverOptions设置 。 |
CreateReceiver(String, ServiceBusReceiverOptions) |
创建一个 ServiceBusReceiver 实例,该实例可用于从特定队列接收和解决消息。 它使用 ServiceBusReceiveMode 指定接收消息的方式。 默认为“PeekLock”模式。 ServiceBusReceiveMode在 中ServiceBusReceiverOptions设置 。 |
CreateReceiver(String, String) |
ServiceBusReceiver创建可用于从特定订阅接收和解决消息的实例。 它使用 ServiceBusReceiveMode 指定接收消息的方式。 默认为“PeekLock”模式。 如果要更改 , ServiceBusReceiveMode请使用 CreateReceiver(String, String, ServiceBusReceiverOptions) 方法。 ServiceBusReceiveMode在 中ServiceBusReceiverOptions设置 。 |
CreateReceiver(String, String, ServiceBusReceiverOptions) |
ServiceBusReceiver创建可用于从特定订阅接收和解决消息的实例。 它使用 ServiceBusReceiveMode 指定接收消息的方式。 默认为“PeekLock”模式。 ServiceBusReceiveMode在 中ServiceBusReceiverOptions设置 。 |
CreateReceiver(String)
- Source:
- ServiceBusClient.cs
- Source:
- ServiceBusClient.cs
创建一个 ServiceBusReceiver 实例,该实例可用于从特定队列接收和解决消息。 它使用 ServiceBusReceiveMode 指定接收消息的方式。 默认为“PeekLock”模式。 如果要更改 , ServiceBusReceiveMode请使用 CreateReceiver(String, ServiceBusReceiverOptions) 方法。 ServiceBusReceiveMode在 中ServiceBusReceiverOptions设置 。
public virtual Azure.Messaging.ServiceBus.ServiceBusReceiver CreateReceiver (string queueName);
abstract member CreateReceiver : string -> Azure.Messaging.ServiceBus.ServiceBusReceiver
override this.CreateReceiver : string -> Azure.Messaging.ServiceBus.ServiceBusReceiver
Public Overridable Function CreateReceiver (queueName As String) As ServiceBusReceiver
参数
- queueName
- String
要为其创建 的 ServiceBusReceiver 队列。
返回
范围 ServiceBusReceiver 限定为指定队列的 。
例外
ServiceBusClient使用包含“EntityPath”标记的连接字符串构造的,该令牌的值与queueName
此处指定的值不同。
适用于
CreateReceiver(String, ServiceBusReceiverOptions)
- Source:
- ServiceBusClient.cs
- Source:
- ServiceBusClient.cs
创建一个 ServiceBusReceiver 实例,该实例可用于从特定队列接收和解决消息。 它使用 ServiceBusReceiveMode 指定接收消息的方式。 默认为“PeekLock”模式。 ServiceBusReceiveMode在 中ServiceBusReceiverOptions设置 。
public virtual Azure.Messaging.ServiceBus.ServiceBusReceiver CreateReceiver (string queueName, Azure.Messaging.ServiceBus.ServiceBusReceiverOptions options);
abstract member CreateReceiver : string * Azure.Messaging.ServiceBus.ServiceBusReceiverOptions -> Azure.Messaging.ServiceBus.ServiceBusReceiver
override this.CreateReceiver : string * Azure.Messaging.ServiceBus.ServiceBusReceiverOptions -> Azure.Messaging.ServiceBus.ServiceBusReceiver
Public Overridable Function CreateReceiver (queueName As String, options As ServiceBusReceiverOptions) As ServiceBusReceiver
参数
- queueName
- String
要为其创建 的 ServiceBusReceiver 队列。
- options
- ServiceBusReceiverOptions
返回
范围 ServiceBusReceiver 限定为指定队列的 。
例外
ServiceBusClient使用包含“EntityPath”标记的连接字符串构造的,该令牌的值与queueName
此处指定的值不同。
适用于
CreateReceiver(String, String)
- Source:
- ServiceBusClient.cs
- Source:
- ServiceBusClient.cs
ServiceBusReceiver创建可用于从特定订阅接收和解决消息的实例。 它使用 ServiceBusReceiveMode 指定接收消息的方式。 默认为“PeekLock”模式。 如果要更改 , ServiceBusReceiveMode请使用 CreateReceiver(String, String, ServiceBusReceiverOptions) 方法。 ServiceBusReceiveMode在 中ServiceBusReceiverOptions设置 。
public virtual Azure.Messaging.ServiceBus.ServiceBusReceiver CreateReceiver (string topicName, string subscriptionName);
abstract member CreateReceiver : string * string -> Azure.Messaging.ServiceBus.ServiceBusReceiver
override this.CreateReceiver : string * string -> Azure.Messaging.ServiceBus.ServiceBusReceiver
Public Overridable Function CreateReceiver (topicName As String, subscriptionName As String) As ServiceBusReceiver
参数
- topicName
- String
要为其创建 ServiceBusReceiver 的主题。
- subscriptionName
- String
特定于要为其创建 的指定主题的 ServiceBusReceiver 订阅。
返回
范围 ServiceBusReceiver 限定为指定的订阅和主题的 。
例外
ServiceBusClient使用包含“EntityPath”标记的连接字符串构造的,该令牌的值与topicName
此处指定的值不同。
适用于
CreateReceiver(String, String, ServiceBusReceiverOptions)
- Source:
- ServiceBusClient.cs
- Source:
- ServiceBusClient.cs
ServiceBusReceiver创建可用于从特定订阅接收和解决消息的实例。 它使用 ServiceBusReceiveMode 指定接收消息的方式。 默认为“PeekLock”模式。 ServiceBusReceiveMode在 中ServiceBusReceiverOptions设置 。
public virtual Azure.Messaging.ServiceBus.ServiceBusReceiver CreateReceiver (string topicName, string subscriptionName, Azure.Messaging.ServiceBus.ServiceBusReceiverOptions options);
abstract member CreateReceiver : string * string * Azure.Messaging.ServiceBus.ServiceBusReceiverOptions -> Azure.Messaging.ServiceBus.ServiceBusReceiver
override this.CreateReceiver : string * string * Azure.Messaging.ServiceBus.ServiceBusReceiverOptions -> Azure.Messaging.ServiceBus.ServiceBusReceiver
Public Overridable Function CreateReceiver (topicName As String, subscriptionName As String, options As ServiceBusReceiverOptions) As ServiceBusReceiver
参数
- topicName
- String
要为其创建 ServiceBusReceiver 的主题。
- subscriptionName
- String
特定于要为其创建 的指定主题的 ServiceBusReceiver 订阅。
- options
- ServiceBusReceiverOptions
返回
范围 ServiceBusReceiver 限定为指定的订阅和主题的 。
例外
ServiceBusClient使用包含“EntityPath”标记的连接字符串构造的,该令牌的值与topicName
此处指定的值不同。