apache-kafka - 无权访问事件中心命名空间内的主题
问题描述
我有带有两个事件中心(event-hub
和event-hub-2
)的事件中心命名空间。为了建立连接,我使用 Kafka——当然命名空间是标准层。当我尝试连接到第二个 EH(event-hub-2
作为 Kafka 主题,连接字符串作为 Kafka 密码)时,我得到了以下堆栈跟踪:
2021-06-17T15:56:04.976Z - WARN: [NetworkClient] [Consumer clientId=consumer-$Default-1, groupId=$Default] Error while fetching metadata with correlation id 11 : {event-hub=TOPIC_AUTHORIZATION_FAILED}
2021-06-17T15:56:04.980Z - ERROR: [Metadata] [Consumer clientId=consumer-$Default-1, groupId=$Default] Topic authorization failed for topics [event-hub]
2021-06-17T15:56:05.007Z - ERROR: [KafkaConsumerActor] [9e1ad] Exception when polling from consumer, stopping actor: org.apache.kafka.common.errors.TopicAuthorizationException: Not authorized to access topics: [event-hub]
org.apache.kafka.common.errors.TopicAuthorizationException: Not authorized to access topics: [event-hub]
我的问题是:为什么我什至没有尝试从堆栈跟踪连接到主题/EH 时会得到这种堆栈跟踪?这是一个奇怪的...
解决方案
如果您在两种情况下都使用相同的消费者组,则您的消费者需要对该消费者组中使用的所有主题的读取权限,请尝试更改 group.id 并再次测试。
推荐阅读
- swift - 如何快速在 UIView 上应用带有边框的尖角半径?
- tensorflow - 您必须为占位符张量“x”提供一个值
- multidimensional-array - F# - 将锯齿状数组转换为 Array2D
- java - 使用 @SuppressWarnings("unchecked") 时的性能注意事项
- linux - 在ps中隐藏命令执行检测
- jquery - 淡入淡出动态 div
- django - LI 的空 POST 结果
- scheme - Scheme 中两个过程(或宏)如何共享一个本地环境?
- powershell - Azure Runbook - 从 Azure 文件系统存储中获取文件
- excel - 如何在自定义 UI 编辑器中为框分组容器中的按钮生成回调?