事件中心常见问题Event Hubs frequently asked questions

常规General

什么是事件中心命名空间?What is an Event Hubs namespace?

命名空间是事件中心/Kafka 主题的范围容器。A namespace is a scoping container for Event Hub/Kafka Topics. 它提供唯一的 FQDN。It gives you a unique FQDN. 命名空间充当容装多个事件中心/Kafka 主题的应用程序容器。A namespace serves as an application container that can house multiple Event Hub/Kafka Topics.

何时创建新的命名空间与使用现有命名空间?When do I create a new namespace vs. use an existing namespace?

容量分配(吞吐量单位 (TU))在命名空间级别进行计费。Capacity allocations (throughput units (TUs)) are billed at the namespace level. 命名空间也与区域相关联。A namespace is also associated with a region.

在以下任一情况下,你可能希望创建新的命名空间,而不是使用现有的命名空间:You may want to create a new namespace instead of using an existing one in one of the following scenarios:

  • 需要与新区域关联的事件中心。You need an Event Hub associated with a new region.
  • 需要与其他订阅关联的事件中心。You need an Event Hub associated with a different subscription.
  • 需要一个具有不同容量分配的事件中心(即,具有添加的事件中心的命名空间的容量需求将超过 40 TU 阈值,并且你不希望使用专用群集)You need an Event Hub with a distinct capacity allocation (that is, the capacity need for the namespace with the added event hub would exceed the 40 TU threshold and you don't want to go for the dedicated cluster)

事件中心基本和标准这两种服务层有什么不同?What is the difference between Event Hubs Basic and Standard tiers?

Azure 事件中心标准层提供的功能超出了基本层中提供的功能。The Standard tier of Azure Event Hubs provides features beyond what is available in the Basic tier. 以下功能是标准层附带的:The following features are included with Standard:

有关定价层的详细信息(包括专用事件中心),请参阅事件中心定价详细信息For more information about pricing tiers, including Event Hubs Dedicated, see the Event Hubs pricing details.

Azure 事件中心在哪些区域可用?Where is Azure Event Hubs available?

在所有支持的 Azure 区域中都可使用 Azure 事件中心。Azure Event Hubs is available in all supported Azure regions. 有关列表,请访问 Azure 区域页。For a list, visit the Azure regions page.

是否可以使用单个高级消息队列协议 (AMQP) 连接来与多个事件中心相互收发数据?Can I use a single Advanced Message Queuing Protocol (AMQP) connection to send and receive from multiple event hubs?

可以,但前提是所有事件中心都在同一个命名空间中。Yes, as long as all the event hubs are in the same namespace.

事件的最长保留期有多久?What is the maximum retention period for events?

事件中心标准版目前支持的最长保留期为七天。Event Hubs Standard tier currently supports a maximum retention period of seven days. 事件中心不应作为永久性的数据存储。Event hubs aren't intended as a permanent data store. 大于 24 小时的保留期适用于将事件流重播到相同系统中的情形。Retention periods greater than 24 hours are intended for scenarios in which it's convenient to replay an event stream into the same systems. 例如,基于现有数据训练或验证新机器学习模型。For example, to train or verify a new machine learning model on existing data. 如果需要将消息保留七天以上,请启用事件中心的事件中心捕获功能,将数据从事件中心提取到所选的存储帐户或 Azure Data Lake 服务帐户。If you need message retention beyond seven days, enabling Event Hubs Capture on your event hub pulls the data from your event hub into the Storage account or Azure Data Lake Service account of your choosing. 启用捕获功能需要支付费用,具体因购买的吞吐量单位而异。Enabling Capture incurs a charge based on your purchased throughput units.

可以在存储帐户上配置已捕获数据的保留期。You can configure the retention period for the captured data on your storage account. Azure 存储的“生命周期管理”功能为常规用途 v2 和 blob 存储帐户提供了基于规则的丰富策略。The lifecycle management feature of Azure Storage offers a rich, rule-based policy for general purpose v2 and blob storage accounts. 可使用该策略将数据转移到适当的访问层,或在数据的生命周期结束时使数据过期。Use the policy to transition your data to the appropriate access tiers or expire at the end of the data's lifecycle. 有关详细信息,请参阅管理 Azure Blob 存储生命周期For more information, see Manage the Azure Blob storage lifecycle.

如何监视事件中心?How do I monitor my Event Hubs?

事件中心向 Azure Monitor 发出详尽指标用于提供资源的状态。Event Hubs emits exhaustive metrics that provide the state of your resources to Azure Monitor. 此外,参考指标不仅可以在命名空间级别,而且还能在实体级别评估事件中心服务的总体运行状况。They also let you assess the overall health of the Event Hubs service not only at the namespace level but also at the entity level. 了解 Azure 事件中心提供哪些监视功能。Learn about what monitoring is offered for Azure Event Hubs.

Azure 事件中心将客户数据存储在何处?Where does Azure Event Hubs store customer data?

Azure 事件中心将存储客户数据。Azure Event Hubs stores customer data. 事件中心会自动将此数据存储在单个区域中,因此此服务会自动满足区域内数据驻留要求,包括信任中心内指定的要求。This data is automatically stored by Event Hubs in a single region, so this service automatically satisfies the region data residency requirements including the ones specified in the Trust Center.

需要在防火墙上打开哪些端口?What ports do I need to open on the firewall?

可以将以下协议与 Azure 服务总线配合使用,以便发送和接收消息:You can use the following protocols with Azure Service Bus to send and receive messages:

  • AMQPAMQP
  • HTTPHTTP
  • Apache KafkaApache Kafka

请查看下表,了解需要打开哪些出站端口,以便使用这些协议与 Azure 事件中心通信。See the following table for the outbound ports you need to open to use these protocols to communicate with Azure Event Hubs.

协议Protocol 端口Ports 详细信息Details
AMQPAMQP 5671 和 56725671 and 5672 请参阅 AMQP 协议指南See AMQP protocol guide
HTTP、HTTPSHTTP, HTTPS 80、44380, 443
KafkaKafka 90939093 请参阅使用 Kafka 应用程序中的事件中心See Use Event Hubs from Kafka applications

需要允许哪些 IP 地址?What IP addresses do I need to allow?

若要查找要添加到允许列表以进行连接的正确 IP 地址,请执行以下步骤:To find the right IP addresses to add to the allowed list for your connections, follow these steps:

  1. 从命令提示符运行以下命令:Run the following command from a command prompt:

    nslookup <YourNamespaceName>.servicebus.chinacloudapi.cn
    
  2. 记下 Non-authoritative answer 中返回的 IP 地址。Note down the IP address returned in Non-authoritative answer.

如果对命名空间使用区域冗余,则需执行一些额外的步骤:If you use the zone redundancy for your namespace, you need to do a few additional steps:

  1. 首先,在命名空间中运行 nslookup。First, you run nslookup on the namespace.

    nslookup <yournamespace>.servicebus.chinacloudapi.cn
    
  2. 记下“非权威回答”部分中的名称,该名称采用下述格式之一:Note down the name in the non-authoritative answer section, which is in one of the following formats:

    <name>-s1.servicebus.chinacloudapp.cn
    <name>-s2.servicebus.chinacloudapp.cn
    <name>-s3.servicebus.chinacloudapp.cn
    
  3. 为每一个运行 nslookup,使用后缀 s1、s2 和 s3 获取所有三个在三个可用性区域中运行的实例的 IP 地址。Run nslookup for each one with suffixes s1, s2, and s3 to get the IP addresses of all three instances running in three availability zones,

    备注

    nslookup 命令返回的 IP 地址不是静态 IP 地址。The IP address returned by the nslookup command isn't a static IP address. 但是,在删除基础部署或将其移至其他群集之前,该地址保持不变。However, it remains constant until the underlying deployment is deleted or moved to a different cluster.

在哪里可以找到向命名空间发送消息或从命名空间接收消息的客户端 IP?Where can I find client IP sending or receiving messages to my namespace?

首先,在命名空间上启用 IP 筛选First, enable IP filtering on the namespace.

然后,按照启用诊断日志中的说明,为事件中心虚拟网络连接事件启用诊断日志。Then, Enable diagnostic logs for Event Hubs virtual network connection events by following instructions in the Enable diagnostic logs. 你将看到连接遭到拒绝的 IP 地址。You'll see the IP address for which connection is denied.

{
    "SubscriptionId": "0000000-0000-0000-0000-000000000000",
    "NamespaceName": "namespace-name",
    "IPAddress": "1.2.3.4",
    "Action": "Deny Connection",
    "Reason": "IPAddress doesn't belong to a subnet with Service Endpoint enabled.",
    "Count": "65",
    "ResourceId": "/subscriptions/0000000-0000-0000-0000-000000000000/resourcegroups/testrg/providers/microsoft.eventhub/namespaces/namespace-name",
    "Category": "EventHubVNetConnectionEvent"
}

重要

只有当命名空间允许从特定的 IP 地址(IP 筛选器规则)进行访问时,才会生成虚拟网络日志。Virtual network logs are generated only if the namespace allows access from specific IP addresses (IP filter rules). 如果不希望使用这些功能限制对命名空间的访问,但仍希望获取虚拟网络日志来跟踪连接到事件中心命名空间的客户端的 IP 地址,则可以使用以下解决方法:启用 IP 筛选并添加整个可寻址 IPv4 范围 (1.0.0.0/1 - 255.0.0.0/1)。If you don't want to restrict access to your namespace using these features and still want to get virtual network logs to track IP addresses of clients connecting to the Event Hubs namespace, you could use the following workaround: Enable IP filtering, and add the total addressable IPv4 range (1.0.0.0/1 - 255.0.0.0/1). 事件中心不支持 IPv6 地址范围。Event Hubs doesn't support IPv6 address ranges.

Apache Kafka 集成Apache Kafka integration

如何将现有的 Kafka 应用程序与事件中心集成?How do I integrate my existing Kafka application with Event Hubs?

事件中心提供可由基于 Apache Kafka 的现有应用程序使用的 Kafka 终结点。Event Hubs provides a Kafka endpoint that can be used by your existing Apache Kafka based applications. 只需完成一项配置更改,即可获得 PaaS Kafka 体验。A configuration change is all that is required to have the PaaS Kafka experience. 使用该体验就如同运行自己的 Kafka 群集。It provides an alternative to running your own Kafka cluster. 事件中心支持 Apache Kafka 1.0 和更高版本的客户端,并且适用于现有的 Kafka 应用程序、工具和框架。Event Hubs supports Apache Kafka 1.0 and newer client versions and works with your existing Kafka applications, tools, and frameworks. 有关详细信息,请参阅适用于 Kafka 的事件中心存储库For more information, see Event Hubs for Kafka repo.

要使现有的应用程序与事件中心通信,需要完成哪些配置更改?What configuration changes need to be done for my existing application to talk to Event Hubs?

要连接到事件中心,需要更新 Kafka 客户端配置。To connect to an event hub, you'll need to update the Kafka client configs. 为此,可以创建事件中心命名空间并获取连接字符串It's done by creating an Event Hubs namespace and obtaining the connection string. 更改 bootstrap.servers,以将事件中心 FQDN 和端口指向 9093。Change the bootstrap.servers to point the Event Hubs FQDN and the port to 9093. 更新 sasl.jaas.config,以使用正确的身份验证将 Kafka 客户端定向到事件中心终结点(已获取的连接字符串),如下所示:Update the sasl.jaas.config to direct the Kafka client to your Event Hubs endpoint (which is the connection string you've obtained), with correct authentication as shown below:

bootstrap.servers={YOUR.EVENTHUBS.FQDN}:9093
request.timeout.ms=60000
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="{YOUR.EVENTHUBS.CONNECTION.STRING}";

例如:Example:

bootstrap.servers=dummynamespace.servicebus.chinacloudapi.cn:9093
request.timeout.ms=60000
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="Endpoint=sb://dummynamespace.servicebus.chinacloudapi.cn/;SharedAccessKeyName=DummyAccessKeyName;SharedAccessKey=XXXXXXXXXXXXXXXXXXXXX";

注意:如果 sasl.jaas.config 不是框架中受支持的配置,请查找用于设置 SASL 用户名和密码的配置,并改为使用这些配置。Note: If sasl.jaas.config isn't a supported configuration in your framework, find the configurations that are used to set the SASL username and password and use those instead. 将用户名设置为 $ConnectionString,将密码设置为事件中心连接字符串。Set the username to $ConnectionString and the password to your Event Hubs connection string.

事件中心的消息/事件大小是多少?What is the message/event size for Event Hubs?

事件中心允许的最大消息大小为 1 MB。The maximum message size allowed for Event Hubs is 1 MB.

吞吐量单位Throughput units

什么是事件中心吞吐量单元?What are Event Hubs throughput units?

事件中心内的吞吐量定义通过事件中心传入和传出的数据量,以 MB 或者 1-KB 事件的数目(以千计)为单位。Throughput in Event Hubs defines the amount of data in mega bytes or the number (in thousands) of 1-KB events that ingress and egress through Event Hubs. 此吞吐量以吞吐量单位 (TU) 来计量。This throughput is measured in throughput units (TUs). 在开始使用事件中心服务之前,需购买 TU。Purchase TUs before you can start using the Event Hubs service. 可以使用门户或事件中心资源管理器模板显式选择事件中心 TU。You can explicitly select Event Hubs TUs either by using portal or Event Hubs Resource Manager templates.

吞吐量单位是否适用于命名空间中的所有事件中心?Do throughput units apply to all event hubs in a namespace?

是的,吞吐量单位 (TU) 适用于事件中心命名空间中的所有事件中心。Yes, throughput units (TUs) apply to all event hubs in an Event Hubs namespace. 这意味着,TU 是在命名空间级别购买的,并在该命名空间下的事件中心之间共享。It means that you purchase TUs at the namespace level and are shared among the event hubs under that namespace. 每个 TU 为命名空间赋予以下功能:Each TU entitles the namespace to the following capabilities:

  • 入口事件(发送到事件中心的事件)最多为每秒 1 MB,但每秒不超过 1000 个入口事件、管理操作或控制 API 调用。Up to 1 MB per second of ingress events (events sent into an event hub), but no more than 1000 ingress events, management operations, or control API calls per second.
  • 出口事件(从事件中心使用的事件)最多达每秒 2 MB,但不超过 4096 个。Up to 2 MB per second of egress events (events consumed from an event hub), but no more than 4096 egress events.
  • 事件存储空间最多为 84 GB(对于默认的 24 小时保留期而言已足够)。Up to 84 GB of event storage (enough for the default 24-hour retention period).

吞吐量单位如何计费?How are throughput units billed?

吞吐量单位 (TU) 按小时计费。Throughput units (TUs) are billed on an hourly basis. 计费基于在给定的小时选择的最大单位数目。The billing is based on the maximum number of units that was selected during the given hour.

如何优化吞吐量单位的使用?How can I optimize the usage on my throughput units?

可以从最少的一个吞吐量单位 (TU) 着手,并启用自动扩充You can start as low as one throughput unit (TU), and turn on auto-inflate. 自动扩充功能可让你在流量/有效负载增大时扩展 TU。The auto-inflate feature lets you grow your TUs as your traffic/payload increases. 还可以针对 TU 数量设置上限。You can also set an upper limit on the number of TUs.

事件中心自动扩充功能的工作原理是什么?How does Auto-inflate feature of Event Hubs work?

使用自动扩充功能可以纵向扩展吞吐量单位 (TU)。The auto-inflate feature lets you scale up your throughput units (TUs). 这意味着,一开始可以购买较低的 TU,自动扩充会在入口流量增大时纵向扩展 TU。It means that you can start by purchasing low TUs and auto-inflate scales up your TUs as your ingress increases. 自动扩充是一种经济高效的选项,可让你完全控制 TU 数量。It gives you a cost-effective option and complete control of the number of TUs to manage. 这是一个 仅限纵向扩展 的功能,可以通过更新来完全控制 TU 数量的缩减。This feature is a scale-up only feature, and you can completely control the scaling down of the number of TUs by updating it.

可以从较低的吞吐量单位 (TU) 着手,例如 2 个 TU。You may want to start with low throughput units (TUs), for example, 2 TUs. 如果预测流量可能会增大到 15 TU,请对命名空间启用自动扩充功能,并将最大限制设置为 15 TU。If you predict that your traffic may grow to 15 TUs, turn-on the auto-inflate feature on your namespace, and set the max limit to 15 TUs. 现在,当流量增大时可以自动扩展 TU。You can now grow your TUs automatically as your traffic grows.

启用自动扩充功能是否会产生相关的费用?Is there a cost associated when I turn on the auto-inflate feature?

此功能 不会 产生相关的费用。There's no cost associated with this feature.

如何强制实施吞吐量限制?How are throughput limits enforced?

如果某个命名空间中所有事件中心间的总入口吞吐量或总入口事件率超过了聚合吞吐量单位限额,那么发送方会受到限制,并会收到指明已超出入口配额的错误信息。If the total ingress throughput or the total ingress event rate across all event hubs in a namespace exceeds the aggregate throughput unit allowances, senders are throttled and receive errors indicating that the ingress quota has been exceeded.

如果某个命名空间中所有事件中心间的总出口吞吐量或总出口事件率超过了聚合吞吐量单位限额,那么接收方会受到限制,但不会生成任何限制错误。If the total egress throughput or the total event egress rate across all event hubs in a namespace exceeds the aggregate throughput unit allowances, receivers are throttled but no throttling errors are generated.

入口和出口配额是分开强制实施的,因此,任何发送方都不会使事件耗用速度减慢,并且接收方也无法阻止事件发送到事件中心。Ingress and egress quotas are enforced separately, so that no sender can cause event consumption to slow down, nor can a receiver prevent events from being sent into an event hub.

可预留/选择的吞吐量单位数量是否有限制?Is there a limit on the number of throughput units that can be reserved/selected?

在 Azure 门户中创建基本层或标准层命名空间时,最多可以为命名空间选择 20 个 TU。When creating a basic or a standard tier namespace in the Azure portal, you can select up to 20 TUs for the namespace. 若要将 TU 提升到正好 40 个,请提交一个支持请求To raise it to exactly 40 TUs, submit a support request.

  1. 在“事件总线命名空间”页面上,选择左侧菜单上的“新建支持请求” 。On the Event Bus Namespace page, select New support request on the left menu.
  2. 在“新建支持请求”页面上,按照以下步骤操作:On the New support request page, follow these steps:
    1. 对于“摘要”,用几句话描述这个问题。For Summary, describe the issue in a few words.

    2. 对于“问题类型”,请选择“配额”。For Problem type, select Quota.

    3. 对于“问题子类型”,选择“吞吐量单位增加或减少请求” 。For Problem subtype, select Request for throughput unit increase or decrease.

      “支持请求”页面

如果超出 40 TU,事件中心可提供名为“事件中心专用群集”的基于资源/容量的模型。Beyond 40 TUs, Event Hubs offers the resource/capacity-based model called the Event Hubs Dedicated clusters. 专用群集按容量单位 (CU) 销售。Dedicated clusters are sold in Capacity Units (CUs).

分区Partitions

需要多少分区?How many partitions do I need?

分区数在创建时指定,并且必须介于 1 和 32 之间。The number of partitions is specified at creation and must be between 1 and 32. 分区计数不可更改,因此在设置分区计数时应考虑长期规模。The partition count isn't changeable, so you should consider long-term scale when setting partition count. 分区是一种数据组织机制,与使用方应用程序中所需的下游并行度相关。Partitions are a data organization mechanism that relates to the downstream parallelism required in consuming applications. 事件中心的分区数与预期会有的并发读取者数直接相关。The number of partitions in an event hub directly relates to the number of concurrent readers you expect to have. 有关分区的详细信息,请参阅分区For more information on partitions, see Partitions.

你可能希望在创建时将其设置为最高可能值,即 32。You may want to set it to be the highest possible value, which is 32, at the time of creation. 请记住,拥有多个分区将导致事件发送到多个分区而不保留顺序,除非你将发送方配置为仅发送到 32 个分区中的一个分区,剩下的 31 个分区是冗余分区。Remember that having more than one partition will result in events sent to multiple partitions without retaining the order, unless you configure senders to only send to a single partition out of the 32 leaving the remaining 31 partitions redundant. 在前一种情况下,必须跨所有 32 个分区读取事件。In the former case, you'll have to read events across all 32 partitions. 在后一种情况下,除了必须在事件处理器主机上进行额外配置外,没有明显的额外成本。In the latter case, there's no obvious additional cost apart from the extra configuration you have to make on Event Processor Host.

事件中心设计用于允许每个用户组使用单个分区读取器。Event Hubs is designed to allow a single partition reader per consumer group. 在大多数用例中,四个分区的默认设置就足够了。In most use cases, the default setting of four partitions is sufficient. 如果希望扩展事件处理,则可以考虑添加其他分区。If you're looking to scale your event processing, you may want to consider adding additional partitions. 对分区没有特定的吞吐量限制,但是命名空间中的聚合吞吐量受吞吐量单位数限制。There's no specific throughput limit on a partition, however the aggregate throughput in your namespace is limited by the number of throughput units. 增加命名空间中吞吐量单位的数量时,可能需要添加额外分区来允许并发读取器实现其自身的最大吞吐量。As you increase the number of throughput units in your namespace, you may want additional partitions to allow concurrent readers to achieve their own maximum throughput.

但是,如果有一个模型,其中应用程序具有到特定分区的关联性,则增加分区数可能对你没有任何益处。However, if you have a model in which your application has an affinity to a particular partition, increasing the number of partitions may not be of any benefit to you. 有关详细信息,请参阅可用性和一致性For more information, see availability and consistency.

增加分区数Increase partitions

通过提交支持请求,你可以请求将分区计数增加到 40(精确)。You can request for the partition count to be increased to 40 (exact) by submitting a support request.

  1. 在“事件总线命名空间”页面上,选择左侧菜单上的“新建支持请求” 。On the Event Bus Namespace page, select New support request on the left menu.
  2. 在“新建支持请求”页面上,按照以下步骤操作:On the New support request page, follow these steps:
    1. 对于“摘要”,用几句话描述这个问题。For Summary, describe the issue in a few words.

    2. 对于“问题类型”,请选择“配额”。For Problem type, select Quota.

    3. 对于“问题子类型”,选择“分区更改请求” 。For Problem subtype, select Request for partition change.

      增加分区计数

分区计数可以增加到正好 40 个。The partition count can be increased to exactly 40. 在这种情况下,TU 的数量也必须增加到 40 个。In this case, number of TUs also have to be increased to 40. 如果你稍后决定将 TU 限制降低到 <= 20 个,那么最大分区限制也将减少到 32 个。If you decide later to lower the TU limit back to <= 20, the maximum partition limit is also decreased to 32.

减少分区数不会影响现有的事件中心,因为分区数只在事件中心级别应用,并且在创建该中心之后它们是不可变的。The decrease in partitions doesn't affect existing event hubs because partitions are applied at the event hub level and they are immutable after creation of the hub.

定价Pricing

我可以在哪里找到更多定价信息?Where can I find more pricing information?

有关事件中心定价的完整信息,请参阅事件中心定价详细信息For complete information about Event Hubs pricing, see the Event Hubs pricing details.

保留事件中心事件超过 24 小时的话,要收取费用吗?Is there a charge for retaining Event Hubs events for more than 24 hours?

事件中心标准层允许消息保留期长于 24 小时,最长以 7 天为限。The Event Hubs Standard tier does allow message retention periods longer than 24 hours, for a maximum of seven days. 如果所存储事件总量的大小超过所选吞吐量单位数量的存储限制(每个吞吐量单位 84 GB),超出限制的部分会按公布的 Azure Blob 存储区费率收费。If the size of the total number of stored events exceeds the storage allowance for the number of selected throughput units (84 GB per throughput unit), the size that exceeds the allowance is charged at the published Azure Blob storage rate. 每个吞吐量单元的存储限制包括 24 小时(默认值)的保留期期间的所有存储成本,即使吞吐量单元已经用到了最大入口限制。The storage allowance in each throughput unit covers all storage costs for retention periods of 24 hours (the default) even if the throughput unit is used up to the maximum ingress allowance.

怎样对事件中心存储区大小进行计算和收费?How is the Event Hubs storage size calculated and charged?

所有存储的事件的总大小(包括所有事件中心内事件标头或磁盘存储器结构上的所有内部开销)按整天计量。The total size of all stored events, including any internal overhead for event headers or on disk storage structures in all event hubs, is measured throughout the day. 在一天结束时,计算存储区大小峰值。At the end of the day, the peak storage size is calculated. 每天的存储限制根据在当天所选择的吞吐量单元的最小数量(每个吞吐量单元提供 84 GB 的限制)来计算。The daily storage allowance is calculated based on the minimum number of throughput units that were selected during the day (each throughput unit provides an allowance of 84 GB). 如果总大小超过计算出的每日存储限额,超出的存储量会采用 Azure Blob 存储费率(按 本地冗余存储 费率)来计费。If the total size exceeds the calculated daily storage allowance, the excess storage is billed using Azure Blob storage rates (at the Locally Redundant Storage rate).

事件中心入口事件是怎样计算的?How are Event Hubs ingress events calculated?

发送到事件中心的每个事件均计为一条可计费消息。Each event sent to an event hub counts as a billable message. 入口事件 定义为小于等于 64 KB 的数据单位。An ingress event is defined as a unit of data that is less than or equal to 64 KB. 任何小于等于 64 KB 的事件均被视为一个计费事件。Any event that is less than or equal to 64 KB in size is considered to be one billable event. 如果该事件大于 64 KB,则根据事件大小按 64 KB 的倍数来计算计费事件的数量。If the event is greater than 64 KB, the number of billable events is calculated according to the event size, in multiples of 64 KB. 例如,发送到事件中心的 8-KB 事件按一个事件计费,而发送到事件中心的 96-KB 的消息则按两个事件计费。For example, an 8-KB event sent to the event hub is billed as one event, but a 96-KB message sent to the event hub is billed as two events.

从事件中心耗用的事件,以及管理操作和控制调用(例如检查点),不统计为计费入口事件,但会累计,上限为吞吐量单位限额。Events consumed from an event hub, as well as management operations and control calls such as checkpoints, are not counted as billable ingress events, but accrue up to the throughput unit allowance.

中转连接费用是否适用于事件中心?Do brokered connection charges apply to Event Hubs?

连接费用只在使用 AMQP 协议时适用。Connection charges apply only when the AMQP protocol is used. 使用 HTTP 发送事件没有连接费用,无论发送系统或设备的数量是多少。There are no connection charges for sending events using HTTP, regardless of the number of sending systems or devices. 如果计划使用 AMQP(例如,为了实现更高效的事件流式传输,或者为了对 IoT 命令和控制方案启用双向通信),请参阅事件中心定价信息页,了解有关每个服务层级中包括多少连接的详细信息。If you plan to use AMQP (for example, to achieve more efficient event streaming or to enable bi-directional communication in IoT command and control scenarios), see the Event Hubs pricing information page for details about how many connections are included in each service tier.

事件中心捕获如何计费?How is Event Hubs Capture billed?

命名空间中的任何事件中心启用了捕获选项时,即可启用捕获功能。Capture is enabled when any event hub in the namespace has the Capture option enabled. 事件中心捕获按所购买的吞吐量单位以小时计费。Event Hubs Capture is billed hourly per purchased throughput unit. 当吞吐量单位计数增加或减少时,事件中心捕获计费将在整个小时增量中反映这些变化。As the throughput unit count is increased or decreased, Event Hubs Capture billing reflects these changes in whole hour increments. 有关事件中心捕获计费的详细信息,请参阅事件中心定价信息For more information about Event Hubs Capture billing, see Event Hubs pricing information.

为事件中心捕获选择的存储帐户是否要付费?Do I get billed for the storage account I select for Event Hubs Capture?

捕获使用在事件中心启用捕获时提供的存储帐户。Capture uses a storage account you provide when enabled on an event hub. 因为这是你的存储帐户,任何针对此配置的费用更改都将计入你的 Azure 订阅。As it is your storage account, any changes for this configuration are billed to your Azure subscription.

配额Quotas

是否有与事件中心关联的配额?Are there any quotas associated with Event Hubs?

如需所有事件中心配额的列表,请参阅配额For a list of all Event Hubs quotas, see quotas.

疑难解答Troubleshooting

为什么在从其他订阅中删除命名空间后无法创建该命名空间?Why am I not able to create a namespace after deleting it from another subscription?

从订阅中删除命名空间时,请等待 4 个小时,然后才能在另一个订阅中使用相同的名称重新创建它。When you delete a namespace from a subscription, wait for 4 hours before recreating it with the same name in another subscription. 否则,可能会收到以下错误消息:Namespace already existsOtherwise, you may receive the following error message: Namespace already exists.

事件中心生成的异常有哪些,建议采取什么操作?What are some of the exceptions generated by Event Hubs and their suggested actions?

有关可能的事件中心异常的列表,请参阅异常概述For a list of possible Event Hubs exceptions, see Exceptions overview.

支持和 SLASupport and SLA

事件中心的技术支持可通过 Azure 服务总线的 Microsoft 问答页面获取。Technical support for Event Hubs is available through the Microsoft Q&A question page for Azure Service Bus. 计费和订阅管理支持免费提供。Billing and subscription management support is provided at no cost.

若要详细了解我们的 SLA,请参阅服务级别协议页面。To learn more about our SLA, see the Service Level Agreements page.

Azure Stack HubAzure Stack Hub

当使用 Azure Blob 存储作为检查点存储时,我如何以特定版本的 Azure Storage SDK 为目标?How can I target a specific version of Azure Storage SDK when using Azure Blob Storage as a checkpoint store?

如果在 Azure Stack Hub 上运行此代码,则将遇到运行时错误,除非你面向特定的存储 API 版本。If you run this code on Azure Stack Hub, you will experience runtime errors unless you target a specific Storage API version. 这是因为事件中心 SDK 使用 Azure 中提供的最新 Azure 存储 API,而此 API 可能在 Azure Stack Hub 平台上不可用。That's because the Event Hubs SDK uses the latest available Azure Storage API available in Azure that may not be available on your Azure Stack Hub platform. Azure Stack Hub 支持的存储 Blob SDK 版本可能与 Azure 上通常提供的版本不同。Azure Stack Hub may support a different version of Storage Blob SDK than that are typically available on Azure. 如果正在将 Azure Blob 存储用作检查点存储,请检查支持用于你的 Azure Stack Hub 版本的 Azure 存储 API 版本,并在你的代码中面向该版本。If you are using Azure Blog Storage as a checkpoint store, check the supported Azure Storage API version for your Azure Stack Hub build and target that version in your code.

例如,如果在 Azure Stack Hub 版本 2005 上运行,则存储服务的最高可用版本为版本 2019-02-02。For example, If you're running on Azure Stack Hub version 2005, the highest available version for the Storage service is version 2019-02-02. 默认情况下,事件中心 SDK 客户端库使用 Azure 上的最高可用版本(在 SDK 发布时为 2019-07-07)。By default, the Event Hubs SDK client library uses the highest available version on Azure (2019-07-07 at the time of the release of the SDK). 在这种情况下,除了执行本部分中的步骤以外,还需要添加相关代码,将存储服务 API 版本 2019-02-02 作为目标。In this case, besides following steps in this section, you will also need to add code to target the Storage service API version 2019-02-02. 如需通过示例来了解如何以特定的存储 API 版本为目标,请参阅以下 C#、Java、Python 和 JavaScript/TypeScript 示例。For an example on how to target a specific Storage API version, see the following samples for C#, Java, Python, and JavaScript/TypeScript.

如需通过示例来了解如何从代码中以特定存储 API 版本为目标,请参阅 GitHub 上的以下示例:For an example on how to target a specific Storage API version from your code, see the following samples on GitHub:

后续步骤Next steps

访问以下链接可以了解有关事件中心的详细信息:You can learn more about Event Hubs by visiting the following links: