在使用 2 个分区创建的 Azure 事件中心中,事件中心使用者尝试连接到第 3 个和第 4 个分区



我已经设置了一个具有 2 个分区的 Azure 事件中心。我正在使用Microsoft发布的代码 (https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-java-get-started-send) 来使用来自事件中心的消息。使用者尝试连接到第 3 和第 4 个分区,即使它们不存在。

错误信息:

2019-06-14 09:34:34,998 [ault|host]-1-13] - 错误分区泵
- 主机主机: 3: 分区接收器创建失败 java.util.concurrent.CompletionException: com.microsoft.azure.eventhubs.EventHubException: 指定的 分区对于事件中心分区发送方或接收方无效。它 应介于 0 和 1 之间。参数名称:分区 ID 跟踪ID:11c0c687fa3146ffaa97749d23abeae5_G27, 系统跟踪器:网关5, 时间戳:2019-06-14T04:04:34, errorContext[NS: dev-sams-iot.servicebus.windows.net, PATH: test/ConsumerGroups/$Default/Partitions/3, REFERENCE_ID: 6d2875_ae5_G27_1560485074529] 在 java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292) 在 java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308) 在 java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:647) 在 java.util.concurrent.CompletableFuture$UniAccept.tryFire$$$capture(CompletableFuture.java:632) 在 java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java) 在 java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) 在 java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977) 在 com.microsoft.azure.eventhubs.impl.ExceptionUtil.completeExceptionally(ExceptionUtil.java:104) 在 com.microsoft.azure.eventhubs.impl.MessageReceiver.cancelOpen(MessageReceiver.java:361) 在 com.microsoft.azure.eventhubs.impl.MessageReceiver.onOpenComplete(MessageReceiver.java:351) 在 com.microsoft.azure.eventhubs.impl.MessageReceiver.onError(MessageReceiver.java:418) 在 com.microsoft.azure.eventhubs.impl.MessageReceiver.onClose(MessageReceiver.java:740) 在 com.microsoft.azure.eventhubs.impl.BaseLinkHandler.processOnClose(BaseLinkHandler.java:74) 在 com.microsoft.azure.eventhubs.impl.BaseLinkHandler.handleRemoteLinkClosed(BaseLinkHandler.java:113) 在 com.microsoft.azure.eventhubs.impl.BaseLinkHandler.onLinkRemoteClose(BaseLinkHandler.java:48) 在 org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:176) 在 org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108) 在 org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:324) 在 org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:291) 在 com.microsoft.azure.eventhubs.impl.MessagingFactory$RunReactor.run(MessagingFactory.java:507) 在 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) 在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

创建事件中心时,还需要存储帐户。事件中心将分区计数和分区消息等详细信息存储在存储帐户中。

以上原因是,最初我创建了一个具有四个分区的事件中心,并且它的详细信息保存在存储帐户中。我删除了此事件中心,然后创建了另一个具有两个分区的事件中心。两个事件中心使用相同的存储帐户。 删除存储帐户的内容解决了该问题。

最新更新