python - 创建 Key_Shared Consumer Apache Pulsar
问题描述
我使用 Apache Pulsar Python 客户端连接我的微服务。我想创建 Key_Shared Consumer 这样做:
import pulsar,_pulsar
client = pulsar.Client('pulsar://localhost:6650')
consumer = client.subscribe('my-topic', 'consume-id',
consumer_type=_pulsar.ConsumerType.KeyShared)
但我收到以下错误:
AttributeError: type object 'ConsumerType' has no attribute 'KeyShared'
KeyShared 是否已在 Python 客户端中实现?如果是,我该如何使用它?
解决方案
它在 Python 客户端的 2.4.2 中发布。
推荐阅读
- c++ - 在 SFINAE 上下文中使用的表达式中使用的 static_assert
- ruby-on-rails - 用于复杂关联的 ActiveModel 序列化器
- html - 为什么 HTML 不允许嵌套表单?
- android - 如何将相机基本照片中的照片保存在数据库中?
- excel - 从“ThisWorkbook”问题中复制
- gitlab - Gitlab CI/CD 作业的日志超出限制
- java - 当 Junit 使用 Gradle 测试成功时自动提交 Git
- android - 如何捕获股票 Android Clock 应用程序事件?
- reactjs - 在单个组件中使用多个 redux 连接 HOC
- javascript - 未捕获的类型错误:无法在我的 php 文档上设置 null 的属性“值”