Multi-kafka for high availability
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- kafka, python
调研方向
Start by running the provided asyncio example with two from_kafka_batched sources and an a.union(b) sink, then stop one Kafka cluster to reproduce the freeze. Trace the asynchronous Kafka source and union behavior to identify where progress stops. Done means the combined stream continues handling the available cluster when the other cluster is stopped, with coverage for the failure case.
由索引模型根据 Issue 内容生成。
描述
We are setting up Kafka in multiple data centers to achieve high availability. I expected that Streamz could do a union between both of these clusters. Everything works as expected, but when I stop one of the Kafka clusters, the stream freezes. I'm thinking there is a callback somewhere that is blocking operations?
import asyncio
import confluent_kafka as ck
from streamz import from_kafka_batched
async def produce(broker, cluster_id, topic):
p = ck.Producer({'bootstrap.servers': broker})
for i in range(100000):
p.poll(0)
p.produce(topic, 'cluster-{} value-{}'.format(cluster_id, i))
p.flush(timeout=0.5)
await asyncio.sleep(1)
async def main():
topic = 'test-topic'
args1 = {'bootstrap.servers': 'localhost:9092', 'group.id': 'test-group'}
args2 = {'bootstrap.servers': 'localhost:9093', 'group.id': 'test-group'}
a = from_kafka_batched(topic, args1, npartitions=1, start=True,
asynchronous=True)
b = from_kafka_batched(topic, args2, npartitions=1, start=True,
asynchronous=True)
a.union(b).sink(print)
asyncio.create_task(produce('localhost:9092', 1, topic))
asyncio.create_task(produce('localhost:9093', 2, topic))
while True:
await asyncio.sleep(1)
if __name__ == '__main__':
asyncio.run(main())
- 主要语言
- Python
- 星标
- 1.3k
- 派生
- 149
- 平均合并
- 17 小时 39 分钟
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-streamz/streamz 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 35/100
python-streamz/streamz#481 · 4 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
python-streamz/streamz#480 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 20/100
python-streamz/streamz#479 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 20/100
python-streamz/streamz#478 · 6 条评论 ·
-
难度 4/5 3-5 天 新手友好度 10/100
python-streamz/streamz#476 · 17 条评论 · 2 个 reaction ·
查看 python-streamz/streamz 的全部 Issue
相似的 Issue
-
essnmx good first issue
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 65/100
syfoud/Simulated_Scepter#174 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
Giskard-AI/giskard-oss#2840 · 1 条评论 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success 未关闭area: repo bug perceived difficulty: 2
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
yeti-platform/yeti#1380 ·