我用的是Spring Cloud溪Kafka。我为Kafka设置了如下属性:
spring.cloud.stream.bindings.output.contentType=application/x-java-object;type=com.example.demo.KafkaApplication.Message
eureka.client.service-url.default-zone=http://172.16.165.26:8761/eureka/
spring.cloud.stream.kafka.binder.zkNodes=10.6.22.20
# spring,cloud.stream.kafka.binder.brokers=10.6.22.20
spring.kafka.bootstrap-servers=10.6.22.20:9092
# spring.kafka.consumer.group-id=example-consumer-1
spring.cloud.stream.instanceCount=1
spring.cloud.stream.instanceIndex=0
spring.kafka.consumer.auto-offset-reset=earliest
spring.cloud.stream.kafka.bindings.output.group=example-consumer-1
spring.cloud.stream.kafka.bindings.output.consumer.instanceCount=1
spring.cloud.stream.kafka.bindings.output.consumer.instanceIndex=0
spring.cloud.stream.kafka.bindings.output.consumer.resetOffsets=true
spring.cloud.stream.kafka.bindings.output.consumer.startOffset=earliest
这些属性正在失效。Kafka使用的是匿名组,而不是给定的属性。startoffset也是如此
1条答案
按热度按时间pkmbmrz71#
这是一个已知问题,已在最新的1.3.x快照中修复:
https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/commit/7355ada4613ad50fe95430f1859d4ea65f004be1