• 카테고리

    질문 & 답변
  • 세부 분야

    데이터 엔지니어링

  • 해결 여부

    미해결

simple consumer 실행 시 무한 로그 찍힘

23.12.27 15:55 작성 23.12.27 16:03 수정 조회수 157

0

안녕하세요!

강의를 열심히 따라가는 중입니다.

simple consumer 개발 시 실행을 하면

15:46:20.636 [main] DEBUG org.apache.kafka.clients.FetchSessionHandler - [Consumer clientId=consumer-test-group-1, groupId=test-group] Built incremental fetch (sessionId=349253680, epoch=15) for node 0. Added 0 partition(s), altered 0 partition(s), removed 0 partition(s) out of 1 partition(s)
15:46:20.636 [main] DEBUG org.apache.kafka.clients.consumer.internals.Fetcher - [Consumer clientId=consumer-test-group-1, groupId=test-group] Sending READ_UNCOMMITTED IncrementalFetchRequest(toSend=(), toForget=(), implied=(test-0)) to broker localhost:9092 (id: 0 rack: null)
15:46:21.150 [main] DEBUG org.apache.kafka.clients.FetchSessionHandler - [Consumer clientId=consumer-test-group-1, groupId=test-group] Node 0 sent an incremental fetch response with throttleTimeMs = 0 for session 349253680 with 0 response partition(s), 1 implied partition(s)
15:46:21.150 [main] DEBUG org.apache.kafka.clients.consumer.internals.Fetcher - [Consumer clientId=consumer-test-group-1, groupId=test-group] Added READ_UNCOMMITTED fetch request for partition test-0 at position FetchPosition{offset=0, offsetEpoch=Optional.empty, currentLeader=LeaderAndEpoch{leader=Optional[localhost:9092 (id: 0 rack: null)], epoch=0}} to node localhost:9092 (id: 0 rack: null)
15:46:21.150 [main] DEBUG org.apache.kafka.clients.FetchSessionHandler - [Consumer clientId=consumer-test-group-1, groupId=test-group] Built incremental fetch (sessionId=349253680, epoch=16) for node 0. Added 0 partition(s), altered 0 partition(s), removed 0 partition(s) out of 1 partition(s)
15:46:21.150 [main] DEBUG org.apache.kafka.clients.consumer.internals.Fetcher - [Consumer clientId=consumer-test-group-1, groupId=test-group] Sending READ_UNCOMMITTED IncrementalFetchRequest(toSend=(), toForget=(), implied=(test-0)) to broker localhost:9092 (id: 0 rack: null)

로그가 이런식으로 무한대로 찍히고

스프링부트의 카프카 라이브러리를 통해 확인을 하면

이렇게 상태가 empty라고 뜨며

디버깅을 해보면 레코드에 데이터가 들어오지 않는 것을 확인 할 수 있습니다.

 

혹시 어느부분을 설정을 해주지않아서 그럴까요..?

 

kafka-console-producer 스크립트를 통해서 메시지를 생성하면 읽을수 있긴 합니다..

16:00:43.464 [main] INFO wendy.consumer.simpleconsumer.SimpleConsumer - record: ConsumerRecord(topic = test, partition = 0, leaderEpoch = 0, offset = 1, CreateTime = 1703660442453, serialized key size = -1, serialized value size = 12, headers = RecordHeaders(headers = [], isReadOnly = false), key = null, value = is it work??)

답변 1

답변을 작성해보세요.

0

안녕하세요. 우선, 남겨주신 producer로그를 보면 test 토픽에 0번 파티션의 1번 오프셋으로 레코드가 정상저장된 것으로 보입니다. 반면 consumer로그에서 DEBUG level의 로그가 많이 찍히는 것을 볼 수 있는데, INFO 또는 WARN이상 레벨의 로그를 보시는 것이 좋으며 DEBUG 레벨에는 다양한 로그가 찍힐 수 있으므로 일반적으로 무시하셔도 좋습니다.

gwlab님의 프로필

gwlab

질문자

2023.12.28

앗 그렇군요!! 감사합니다~~!!!!