azure eventhub as kafka:主题授权问题

ds97pgxw  于 2021-06-06  发布在  Kafka
关注(0)|答案(2)|浏览(340)

我创建了一个启用kafka的eventhub命名空间,并创建了一个访问策略为“manage,send和listen”的eventhub。我可以生成此消息,但得到错误“org.apache.kafka.common.errors.topicauthorizationexception:无权访问主题:”。
我的akka consumer中的参数是:

akka.kafka.consumer {
  #Akka Kafka consumer properties defined here
  wakeup-timeout=60s

  # Properties defined by org.apache.kafka.clients.consumer.ConsumerConfig
  # defined in this configuration section.
  kafka-clients {
    request.timeout.ms=60000
    group.id=$Default

    bootstrap.servers=“<EventbusDomain>:9093"
    sasl.mechanism=PLAIN
    security.protocol=SASL_SSL
    sasl.jaas.config="org.apache.kafka.common.security.plain.PlainLoginModule required username=\"$ConnectionString\" password=\”<Connection String\”;”
  }
}

你能帮忙吗?
谢谢

tf7tbtn2

tf7tbtn21#

我从昨天开始就面临这个问题,并在下面添加了属性来解决这个问题。

spring.cloud.stream.kafka.binder.autoCreateTopics=false

请注意,我们使用的是springcloud+azure事件中心
但是,我无法从事件中心接收消息。

jjjwad0x

jjjwad0x2#

我通过修复pom.xml中的kafka版本解决了这个问题。显然,azure只支持Kafka0.10以上的版本。一旦我改变了依赖关系,它就可以正常工作了。

相关问题