728x90
__consumer_offsets 토픽 읽기 실습하기
1. consumer.config 용 config 파일 생성
echo "exclude.internal.topics=false" > consumer_temp.config
2. __consumer_offsets 토픽 읽기
kafka-console-consumer --consumer.config /home/min/consumer_temp.config \
--bootstrap-server localhost:9092 --topic __consumer_offsets \
--formatter "kafka.coordinator.group.GroupMetadataManager\$OffsetsMessageFormatter"
3. topic 삭제 후 생성
kafka-topics --bootstrap-server localhost:9092 --delete --topic simple-topic
kafka-topics --bootstrap-server localhost:9092 --create --topic simple-topic
4. Producer 실행 후 메시지 전송
kafka-console-producer --bootstrap-server localhost:9092 --topic simple-topic
- console producer를 실행해서 데이터를 전송 후, Application을 실행하면 offset이 전송한 데이터 수 + 1로 세팅되어 있다.
5. 결과 확인

728x90
'카프카 > Java 기반 카프카 클라이언트 구현, Consumer 내부 메커니즘 1' 카테고리의 다른 글
| Group Cordinator와 Consumer의 Rebalance 상세 메커니즘 (0) | 2025.10.18 |
|---|---|
| Consumer의 auto.offset.reset (0) | 2025.10.06 |
| wakeup을 이용한 Consumer 효과적 종료 (0) | 2025.10.06 |
| Consumer Fetcher 관련 주요 파라미터와 메커니즘 이해 (0) | 2025.10.06 |
| KafkaConsumer 주요 구성 요소와 Poll() 메소드 (0) | 2025.10.06 |