kcat은 아파치 카프카를 위한 non-JVM기반의 프로듀서, 컨슈머 기능을 제공하는 도구입니다.
현재 테스트 서버에 구축이 되어있으며 테스트 완료 하였습니다.
Kcat 명령어
토픽에 데이터 쏘기 (producer test)
kcat -P -b localhost:9092 -t test
토픽 데이터 확인 (consumer)
kcat -b localhost:9092 -t test -C
키밸류 데이터 쏘기(producer test)
kcat -b localhost:29092 -t test -P -K :
파일데이터 쏘기
kcat -b localhost:29092 -t test -P -K: msg.txt



특정 파티션에 데이터 쏘기
kcat -b localhost:29092 -t test -P -p 1
특정 파티션 데이터 확인
kcat -b localhost:29092 -t test -C -p 1
모든메세지 주고 받기
kcat -b localhost:29092 -t test -P
kcat -b localhost:29092 -t test -C
n개의 메세지만 확인
kcat -b localhost:29092 -t test -C -c 2
특정 오프셋 메세지 확인
kcat -b localhost:29092 -t test -C -o 1
(오프셋 값을 음수로 지정하면 끝에서부터 메세지를 가져옴)
kcat -b localhost:29092 -t test -C -o -2


출력 포맷 변경해서 데이터 확인하기
kcat -b localhost:29092 -t test -C -f '\nKey (%K bytes): %k\t\nValue (%S bytes): %s\n\tPartition: %p\tOffset: %o\n--\n'

메타 데이터 조회
kcat -L -b localhost:29092
'Kafka' 카테고리의 다른 글
Kafkaconnector(MysqlCDC To Impala&Kudu)-Confluent (0) | 2023.03.02 |
---|---|
Kafkaconnector(MysqlCDC To Impala&Kudu) (0) | 2023.02.22 |
Apache Beam (0) | 2023.01.26 |
Apache Flume(Kafka To Hadoop) (0) | 2022.10.21 |
Supervisor (0) | 2022.10.20 |