首页 > 解决方案 > 浮士德找不到话题

问题描述

我正在使用:python 3.8 faust==1.10.4 kafka==2.13-2.8.0

app = faust.App(
    'kafka_faust',
    autodiscover=True,
    bootstrap_sever=KAFKA_SERVER,
)
test_topic = app.topic('test_read',
                       retention=datetime.timedelta(days=1),
                       value_serializer=json,
                       value_type=json,
                       partitions=8
                       )

但是,faust 的日志只显示而不显示其他主题

┌Requested Subscription───────────┐
│ topic name                      │
├─────────────────────────────────┤
│ kafka_faust-__assignor-__leader │
└─────────────────────────────────┘ 

我已经用 Kafka API 检查了主题“test_read”的存在。这是结果

./kafka-topics.sh --describe --zookeeper localhost:2181 --topic test_read
Topic: test_read        PartitionCount: 3       ReplicationFactor: 1    Configs: 
        Topic: test_read        Partition: 0    Leader: 0       Replicas: 0     Isr: 0
        Topic: test_read        Partition: 1    Leader: 0       Replicas: 0     Isr: 0
        Topic: test_read        Partition: 2    Leader: 0       Replicas: 0     Isr: 0

因此,这个话题肯定存在,而浮士德没有发现它。你有什么建议吗?为什么会这样?

标签: pythonapache-kafkafaust

解决方案


推荐阅读