Apache kafka 卡夫卡复制器:消费者是否接受卡夫卡流?

Apache kafka 卡夫卡复制器:消费者是否接受卡夫卡流?,apache-kafka,apache-kafka-streams,Apache Kafka,Apache Kafka Streams,我们正试图在两个数据中心之间复制我们的偏移量。对于单个消费者来说,这真的很容易,只需添加: consumer.interceptor.classes=io.confluent.connect.replicator.offsets.ConsumerTimestampsInterceptor 现在我们有了一个使用卡夫卡流的应用程序。在捆绑了多个东西之后,我们不能像以前那样复制偏移量。 例如,我们也尝试过: kafka.streams.properties.consumer.interceptor.

我们正试图在两个数据中心之间复制我们的偏移量。对于单个消费者来说,这真的很容易,只需添加:

consumer.interceptor.classes=io.confluent.connect.replicator.offsets.ConsumerTimestampsInterceptor
现在我们有了一个使用卡夫卡流的应用程序。在捆绑了多个东西之后,我们不能像以前那样复制偏移量。 例如,我们也尝试过:

kafka.streams.properties.consumer.interceptor.classes=io.confluent.connect.replicator.offsets.ConsumerTimestampsInterceptor
但是没有运气
谢谢

尝试在代码中而不是在属性文件中执行此操作

例如,制作人

config.put(
    StreamsConfig.PRODUCER_PREFIX + ProducerConfig.INTERCEPTOR_CLASSES_CONFIG, 
    ConsumerTimestampsInterceptor.class.getName()
);

或者,确保
kafka.streams.properties
是用于创建所有流的正确属性前缀在结束kafka streams removes group.id参数中配置属性。然而,复制者仍然需要它

    override fun configure(configs: Map<String, *>?) {
        val newConfigs = configs!! + mapOf("group.id" to configs?.get("customgroupid"))
        super.configure(newConfigs)
    }
}

我有:ClassCastException:class io.confluent.connect.replicator.offsets.ConsumerItemsTampsintReceptor?我的答案不会进行任何强制转换,所以你能用完整的堆栈跟踪编辑你的问题吗?
kafka.streams.consumer.customgroupid=${kafka.streams.group.id} # customgroupid is not removed
kafka.streams.consumer.interceptor.classes=com.myjob.mymodule.ConsumerTimestampsInterceptorConfigurator