我使用spring cloud kafka binder将数据读取到KStream。在阅读其中一个主题的数据时,我需要从头开始阅读。
我试图设置kafka偏移重置和启动偏移属性。但是,找不到任何参考。
请你帮我提供任何示例application.yaml来重置偏移量,以便我可以从头开始使用来自主题的消息
添加我使用的application.yaml:
spring.cloud.stream.bindings.input:
destination: input-topic1
consumer:
useNativeDecoding: true
headerMode: raw
spring.cloud.stream.bindings.output:
destination: output-topic
producer:
useNativeDecoding: true
headerMode: raw
spring.cloud.stream.bindings.beginningInput:
destination: beginning-topic
consumer:
useNativeDecoding: true
headerMode: raw
spring.cloud.stream.kafka.streams.bindings.input:
consumer:
keySerde: org.apache.kafka.common.serialization.Serdes$StringSerde
valueSerde: org.apache.kafka.common.serialization.Serdes$StringSerde
spring.cloud.stream.kafka.streams.bindings.output:
producer:
keySerde: org.apache.kafka.common.serialization.Serdes$StringSerde
valueSerde: org.apache.kafka.common.serialization.Serdes$StringSerde
spring.cloud.stream.kafka.streams.bindings.beginningInput:
consumer:
keySerde: org.apache.kafka.common.serialization.Serdes$StringSerde
valueSerde: org.apache.kafka.common.serialization.Serdes$StringSerde
resetOffsets: true
startOffset: earliest
spring.cloud.stream.kafka.streams.binder:
brokers: 127.0.0.1
zkNodes: 127.0.0.1
configuration:
default.key.serde: org.apache.kafka.common.serialization.Serdes$StringSerde
default.value.serde: org.apache.kafka.common.serialization.Serdes$StringSerde
commit.interval.ms: 1000
答案 0 :(得分:0)
Quadruple q1 = new Quadruple(1, 1, 1, 2);
Quadruple q2 = new Quadruple(1, 1, 2, 1);
被打破了。它在2.0.0.RELEASE中恢复。