Kafka

Kafka Streams 어플리케이션 초기화

ZzangHo 2023. 1. 10. 14:07
728x90

Kafka Streams를 개발하다 보면 매번 데이터를 새로 받아서 땡길 수 없기 때문에 초기화를 해주어야 하는 케이스가 종종 발생한다.

그럴때 아래 명령어를 통해 초기화를 하면 된다.

 

./kafka-streams-application-reset.sh --bootstrap-servers {브로커IP:PORT} --application-id {streams-id} --input-topics {토픽명}

Reset-offsets for input topics [streams.test.topic]
Following input topics offsets will be reset to (for consumer group search-ncms-streams)
Topic: streams.test.topic Partition: 3 Offset: 0
Topic: streams.test.topic Partition: 4 Offset: 0
Topic: streams.test.topic Partition: 1 Offset: 0
Topic: streams.test.topic Partition: 2 Offset: 0
Topic: streams.test.topic Partition: 0 Offset: 0
Done.
Deleting all internal/auto-created topics for application search-ncms-streams
Done

 

--aplication-id는 필수 값
--bootstrap-servers는 필수는 아니지만 넣지 않을 경우 localhost:9092 기준으로 작동한다.

--input-topics는 kafka streams에서 땡기고자 하는 토픽의 이름을 쓰면 되고 Comma(,) 기준으로 여러개를 동시에 입력 할 수 있다.

ex) --input-topics a.topic,b.topic

'Kafka' 카테고리의 다른 글

카프카 스트림즈(Kafka Streams)  (0) 2022.12.14
Kafka Consumer 멀티 쓰레드로 간단하게?  (0) 2022.01.28
Consumer Lag - Grafana 셋팅  (0) 2022.01.27
Consumer Lag - telegraf 설정  (0) 2022.01.27
Consumer Lag - burrow 설치  (0) 2022.01.27