Anyone here using spring-kafka
??? How can I set auto.offset.reset
in my application.properties file? I tried using spring.kafka.consumer.auto-offset-reset=latest
Im using kafka streams and it creates 2 consumers. One have auto.offset.reset = none
and the other one is auto.offset.reset = earliest
based on the startup logs
In your application.yml file…you can define like this …
bootstrap-servers: ${BOOTSTRAP_SERVERS:[http://localhost:9092](http://localhost:9092)}
listener:
poll-timeout: 3000
log-container-config: true
concurrency: ${PIPELINE_ACTION_CONSUMER_MBRS:3}
consumer:
group-id: group-id-service-consumer-grp
auto-offset-reset: latest
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
producer:
key-serializer: org.apache.kafka.common.serialization.StringSerializer
value-serializer: org.apache.kafka.common.serialization.StringSerializer
retries: 2```
Refer this section for configuring streams https://docs.spring.io/spring-boot/docs/current/reference/html/messaging.html#messaging.kafka.streams
Thanks. I know about these configs. What I want is something like https://stackoverflow.com/questions/48344981/how-to-always-consume-from-latest-offset-in-kafka-streams
Seems like it’s not possible out-of-the-box but the kafka-streams-application-reset.sh
script will do the job