combine:
destination: {action명}
binder: kafka
group: {group}
consumer:
batch-mode: true
ackEachRecord: false
startOffset: latest
이렇게 해놔도 latest가 아닌 earlist부터 가져옴.
원인은.. group명을 지정하면 startOffset이 earlist로 세팅됨.
그래서 그간 쌓인 몇백만개를 다 읽어오려고함.. @.@
https://cloud.spring.io/spring-cloud-stream-binder-kafka/spring-cloud-stream-binder-kafka.html
https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/67
Our suggested workaround is to manage offsets using the Kafka consumer group management CLI tooling (http://kafka.apache.org/0102/documentation.html#basic_ops_consumer_group) between application restarts. (Also set the startOffset to earliest or latest so that the application can restart at the proper offset).
=> anomynous그룹을 쓰거나 컨슈머 그룹 매니지먼트를 써서 offset을 관리해라.
./kafka-consumer-groups.sh \
--bootstrap-server {ip}:9092 \
--group {group}
--topic {topic}\
--reset-offsets --to-latest --execute