向Kafka Streams状态存储中断添加名称

时间:2018-09-11 17:10:26

标签: apache-kafka apache-kafka-streams

我有一个用kafka表定义的流拓扑:

stream
    ... //irrelevant steps
    .groupByKey(Serialized.with(Serdes.String(), customSerdes))
    .aggregate(something(), somethingElse(), Materialized.with(Serdes.String(),customSerdes))

我现在想动态查询状态存储以进行调试,据我了解,这需要命名状态存储:

stream
    ... //irrelevant steps
    .groupByKey(Serialized.with(Serdes.String(), customSerdes))
    .aggregate(something(), somethingElse(), 
    Materialized.<String,CustomType,KeyValueStore<Bytes, byte[]>>
                    as("mappings")
                    .withKeySerde(Serdes.String())
                    .withValueSerde(customSerdes))

但是,当我启动它时,流死于以下异常

Exception in thread "<consumer-id>-ce730881-6504-4804-b74f-8ef981708603-StreamThread-2" java.lang.IllegalArgumentException: Assigned partition <consumer-id>-KSTREAM-PEEK-0000000018-repartition-4 for non-subscribed topic regex pattern; subscription pattern is core.device.events.all|<consumer-id>-KSTREAM-PEEK-0000000017-repartition|<consumer-id>-mappings-repartition

这已经运行了一段时间,所以我宁愿不失去现有状态或需要重新处理整个主题。

0 个答案:

没有答案