你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
EventProcessorHost 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
EventProcessorHost(String, String, String, String, String)
- Source:
- EventProcessorHost.cs
创建一个新主机以处理事件中心的事件。
由于事件中心经常用于横向扩展的高流量方案,因此通常每个进程只有一个主机,并且进程将在单独的计算机上运行。 但是,如果吞吐量不是问题,则支持在一台计算机上运行多个主机,甚至在一个进程中运行。
构造函数的此重载使用默认的内置租约和检查点管理器。 内置管理员使用 storageConnectionString 参数指定的 Azure 存储帐户来记录租约和检查点。
public EventProcessorHost (string eventHubPath, string consumerGroupName, string eventHubConnectionString, string storageConnectionString, string leaseContainerName);
new Microsoft.Azure.EventHubs.Processor.EventProcessorHost : string * string * string * string * string -> Microsoft.Azure.EventHubs.Processor.EventProcessorHost
Public Sub New (eventHubPath As String, consumerGroupName As String, eventHubConnectionString As String, storageConnectionString As String, leaseContainerName As String)
参数
- eventHubPath
- String
EventHub 的名称。
- consumerGroupName
- String
事件中心内使用者组的名称。
- eventHubConnectionString
- String
要从中接收的事件中心的连接字符串。
- storageConnectionString
- String
用于租用和检查点的 Azure 存储帐户的连接字符串。
- leaseContainerName
- String
供内置租用和检查点管理器使用的 Azure 存储容器名称。
适用于
EventProcessorHost(String, String, String, String, ICheckpointManager, ILeaseManager)
- Source:
- EventProcessorHost.cs
创建一个新主机以处理事件中心的事件。
构造函数的此重载可实现最大的灵活性。 此名称还允许调用方指定处理器主机的名称。 重载还允许调用方提供自己的租约和检查点管理器来替换基于 Azure 存储的内置租约。
public EventProcessorHost (string hostName, string eventHubPath, string consumerGroupName, string eventHubConnectionString, Microsoft.Azure.EventHubs.Processor.ICheckpointManager checkpointManager, Microsoft.Azure.EventHubs.Processor.ILeaseManager leaseManager);
new Microsoft.Azure.EventHubs.Processor.EventProcessorHost : string * string * string * string * Microsoft.Azure.EventHubs.Processor.ICheckpointManager * Microsoft.Azure.EventHubs.Processor.ILeaseManager -> Microsoft.Azure.EventHubs.Processor.EventProcessorHost
Public Sub New (hostName As String, eventHubPath As String, consumerGroupName As String, eventHubConnectionString As String, checkpointManager As ICheckpointManager, leaseManager As ILeaseManager)
参数
- hostName
- String
处理器主机的名称。 必须是唯一的。 强烈建议包含 Guid 以确保唯一性。
- eventHubPath
- String
EventHub 的名称。
- consumerGroupName
- String
事件中心内使用者组的名称。
- eventHubConnectionString
- String
要从中接收的事件中心的连接字符串。
- checkpointManager
- ICheckpointManager
实现处理分区检查点的 ICheckpointManager 的对象。
- leaseManager
- ILeaseManager
实现处理分区租约的 ILeaseManager 的对象。
适用于
EventProcessorHost(Uri, String, String, ITokenProvider, CloudStorageAccount, String)
- Source:
- EventProcessorHost.cs
使用提供的事件中心创建一个新主机来处理事件 TokenProvider
public EventProcessorHost (Uri endpointAddress, string eventHubPath, string consumerGroupName, Microsoft.Azure.EventHubs.ITokenProvider tokenProvider, Microsoft.Azure.Storage.CloudStorageAccount cloudStorageAccount, string leaseContainerName);
new Microsoft.Azure.EventHubs.Processor.EventProcessorHost : Uri * string * string * Microsoft.Azure.EventHubs.ITokenProvider * Microsoft.Azure.Storage.CloudStorageAccount * string -> Microsoft.Azure.EventHubs.Processor.EventProcessorHost
Public Sub New (endpointAddress As Uri, eventHubPath As String, consumerGroupName As String, tokenProvider As ITokenProvider, cloudStorageAccount As CloudStorageAccount, leaseContainerName As String)
参数
- endpointAddress
- Uri
事件中心的完全限定域名。 最有可能的为 {yournamespace}.servicebus.windows.net
- eventHubPath
- String
EventHub 的名称。
- consumerGroupName
- String
事件中心内使用者组的名称。
- tokenProvider
- ITokenProvider
将生成用于授权的安全令牌的令牌提供程序。
- cloudStorageAccount
- CloudStorageAccount
用于租用和检查点的 Azure 存储帐户。
- leaseContainerName
- String
供内置租用和检查点管理器使用的 Azure 存储容器名称。
适用于
EventProcessorHost(String, String, String, String, String, String, String)
- Source:
- EventProcessorHost.cs
创建一个新主机以处理事件中心的事件。
构造函数的此重载使用默认的内置租约和检查点管理器。
public EventProcessorHost (string hostName, string eventHubPath, string consumerGroupName, string eventHubConnectionString, string storageConnectionString, string leaseContainerName, string storageBlobPrefix = default);
new Microsoft.Azure.EventHubs.Processor.EventProcessorHost : string * string * string * string * string * string * string -> Microsoft.Azure.EventHubs.Processor.EventProcessorHost
Public Sub New (hostName As String, eventHubPath As String, consumerGroupName As String, eventHubConnectionString As String, storageConnectionString As String, leaseContainerName As String, Optional storageBlobPrefix As String = Nothing)
参数
- hostName
- String
处理器主机的名称。 必须是唯一的。 强烈建议包含 Guid 以确保唯一性。
- eventHubPath
- String
EventHub 的名称。
- consumerGroupName
- String
事件中心内使用者组的名称。
- eventHubConnectionString
- String
要从中接收的事件中心的连接字符串。
- storageConnectionString
- String
用于租用和检查点的 Azure 存储帐户的连接字符串。
- leaseContainerName
- String
供内置租用和检查点管理器使用的 Azure 存储容器名称。
- storageBlobPrefix
- String
命名存储容器中的 Blob 时使用的前缀。
适用于
EventProcessorHost(String, Uri, String, String, ITokenProvider, ICheckpointManager, ILeaseManager, Nullable<TimeSpan>, TransportType)
- Source:
- EventProcessorHost.cs
使用提供的事件中心创建一个新主机来处理事件 TokenProvider
public EventProcessorHost (string hostName, Uri endpointAddress, string eventHubPath, string consumerGroupName, Microsoft.Azure.EventHubs.ITokenProvider tokenProvider, Microsoft.Azure.EventHubs.Processor.ICheckpointManager checkpointManager, Microsoft.Azure.EventHubs.Processor.ILeaseManager leaseManager, TimeSpan? operationTimeout = default, Microsoft.Azure.EventHubs.TransportType transportType = Microsoft.Azure.EventHubs.TransportType.Amqp);
new Microsoft.Azure.EventHubs.Processor.EventProcessorHost : string * Uri * string * string * Microsoft.Azure.EventHubs.ITokenProvider * Microsoft.Azure.EventHubs.Processor.ICheckpointManager * Microsoft.Azure.EventHubs.Processor.ILeaseManager * Nullable<TimeSpan> * Microsoft.Azure.EventHubs.TransportType -> Microsoft.Azure.EventHubs.Processor.EventProcessorHost
Public Sub New (hostName As String, endpointAddress As Uri, eventHubPath As String, consumerGroupName As String, tokenProvider As ITokenProvider, checkpointManager As ICheckpointManager, leaseManager As ILeaseManager, Optional operationTimeout As Nullable(Of TimeSpan) = Nothing, Optional transportType As TransportType = Microsoft.Azure.EventHubs.TransportType.Amqp)
参数
- hostName
- String
处理器主机的名称。 必须是唯一的。 强烈建议包含 Guid 以确保唯一性。
- endpointAddress
- Uri
事件中心的完全限定域名。 最有可能的为 {yournamespace}.servicebus.windows.net
- eventHubPath
- String
EventHub 的名称。
- consumerGroupName
- String
事件中心内使用者组的名称。
- tokenProvider
- ITokenProvider
将生成用于授权的安全令牌的令牌提供程序。
- checkpointManager
- ICheckpointManager
实现处理分区检查点的 ICheckpointManager 的对象。
- leaseManager
- ILeaseManager
实现处理分区租约的 ILeaseManager 的对象。
- transportType
- TransportType
连接时传输类型。
适用于
EventProcessorHost(Uri, String, String, ITokenProvider, CloudStorageAccount, String, String, Nullable<TimeSpan>, TransportType)
- Source:
- EventProcessorHost.cs
使用提供的事件中心创建一个新主机来处理事件 TokenProvider
public EventProcessorHost (Uri endpointAddress, string eventHubPath, string consumerGroupName, Microsoft.Azure.EventHubs.ITokenProvider tokenProvider, Microsoft.Azure.Storage.CloudStorageAccount cloudStorageAccount, string leaseContainerName, string storageBlobPrefix = default, TimeSpan? operationTimeout = default, Microsoft.Azure.EventHubs.TransportType transportType = Microsoft.Azure.EventHubs.TransportType.Amqp);
new Microsoft.Azure.EventHubs.Processor.EventProcessorHost : Uri * string * string * Microsoft.Azure.EventHubs.ITokenProvider * Microsoft.Azure.Storage.CloudStorageAccount * string * string * Nullable<TimeSpan> * Microsoft.Azure.EventHubs.TransportType -> Microsoft.Azure.EventHubs.Processor.EventProcessorHost
Public Sub New (endpointAddress As Uri, eventHubPath As String, consumerGroupName As String, tokenProvider As ITokenProvider, cloudStorageAccount As CloudStorageAccount, leaseContainerName As String, Optional storageBlobPrefix As String = Nothing, Optional operationTimeout As Nullable(Of TimeSpan) = Nothing, Optional transportType As TransportType = Microsoft.Azure.EventHubs.TransportType.Amqp)
参数
- endpointAddress
- Uri
事件中心的完全限定域名。 最有可能的为 {yournamespace}.servicebus.windows.net
- eventHubPath
- String
EventHub 的名称。
- consumerGroupName
- String
事件中心内使用者组的名称。
- tokenProvider
- ITokenProvider
将生成用于授权的安全令牌的令牌提供程序。
- cloudStorageAccount
- CloudStorageAccount
用于租用和检查点的 Azure 存储帐户。
- leaseContainerName
- String
供内置租用和检查点管理器使用的 Azure 存储容器名称。
- storageBlobPrefix
- String
命名存储容器中的 Blob 时使用的前缀。
- transportType
- TransportType
连接时传输类型。
适用于
EventProcessorHost(String, Uri, String, String, ITokenProvider, CloudStorageAccount, String, String, Nullable<TimeSpan>, TransportType)
- Source:
- EventProcessorHost.cs
使用提供的事件中心创建一个新主机来处理事件 TokenProvider
public EventProcessorHost (string hostName, Uri endpointAddress, string eventHubPath, string consumerGroupName, Microsoft.Azure.EventHubs.ITokenProvider tokenProvider, Microsoft.Azure.Storage.CloudStorageAccount cloudStorageAccount, string leaseContainerName, string storageBlobPrefix = default, TimeSpan? operationTimeout = default, Microsoft.Azure.EventHubs.TransportType transportType = Microsoft.Azure.EventHubs.TransportType.Amqp);
new Microsoft.Azure.EventHubs.Processor.EventProcessorHost : string * Uri * string * string * Microsoft.Azure.EventHubs.ITokenProvider * Microsoft.Azure.Storage.CloudStorageAccount * string * string * Nullable<TimeSpan> * Microsoft.Azure.EventHubs.TransportType -> Microsoft.Azure.EventHubs.Processor.EventProcessorHost
Public Sub New (hostName As String, endpointAddress As Uri, eventHubPath As String, consumerGroupName As String, tokenProvider As ITokenProvider, cloudStorageAccount As CloudStorageAccount, leaseContainerName As String, Optional storageBlobPrefix As String = Nothing, Optional operationTimeout As Nullable(Of TimeSpan) = Nothing, Optional transportType As TransportType = Microsoft.Azure.EventHubs.TransportType.Amqp)
参数
- hostName
- String
处理器主机的名称。 必须是唯一的。 强烈建议包含 Guid 以确保唯一性。
- endpointAddress
- Uri
事件中心的完全限定域名。 最有可能的为 {yournamespace}.servicebus.windows.net
- eventHubPath
- String
EventHub 的名称。
- consumerGroupName
- String
事件中心内使用者组的名称。
- tokenProvider
- ITokenProvider
将生成用于授权的安全令牌的令牌提供程序。
- cloudStorageAccount
- CloudStorageAccount
用于租用和检查点的 Azure 存储帐户。
- leaseContainerName
- String
供内置租用和检查点管理器使用的 Azure 存储容器名称。
- storageBlobPrefix
- String
命名存储容器中的 Blob 时使用的前缀。
- transportType
- TransportType
连接时传输类型。