Kafka主题作为聊天室标识符
我对一个可能有可能的聊天室的消息传递聊天应用程序感兴趣。 我试图了解Kafka主题是否可以用作Kafka概念观点的聊天室标识符?
由于聊天室通常是在运行时创建的,因此意味着
- 应该在运行时创建Kafka主题。是否可以?
- 用户应该能够在创建新主题(聊天室)。是否可以?
- 会有很多聊天室。 Kafka有大量主题是不好的还是可以的?
I am interested in a messaging chat app where different chatroom can be possible.
I try to understand if Kafka topics can be used as chatroom identifiers from Kafka conceptual point of view?
As chatrooms are normally created in a runtime then it means that
- Kafka topics should be created in a runtime. Is it possible?
- Users should be able to subscribe to the new topics (chatrooms) as soon as they are created. Is it possible?
- There will be a lot of chatrooms. Is it bad or ok for Kafka to have huge number of topics?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。 kafka adminclient 用于管理功能,包括列表,创建和删除主题。
我们可以使用肌肉图创建新主题:
上述代码来自Kafka:“权威指南”第二版,第5章以编程方式管理Apache Kafka,它讨论了很多有关adminclient的讨论。
对于Spring-Kafka,提供 createModifyTopics()方法。
是的。我们可以在
.subscribe()
中使用正则表达式:例如,要订阅所有测试主题,我们可以致电
没关系:我可以在kafka群集中有100万个主题吗?
Yes. Kafka AdminClient provides a programmatic API for administrative functionality, including listing, creating and deleting topics.
We can use createTopics to create new topics:
The above code comes from Kafka: The Definitive Guide 2nd Edition, Chapter 5 Managing Apache Kafka Programmatically, which discusses a lot about AdminClient.
For spring-kafka, the KafkaAdmin provides createOrModifyTopics() method.
Yes. We can use regular expressions in
.subscribe()
:For example, to subscribe to all test topics, we can call
It's okay: Can I have 100s of thousands of topics in a Kafka Cluster?