2017-04-07 5 views
1

FlinkKafkaProducer08을 사용하여 카프카에 기록을 보내고 있습니다. 하지만 언젠가는 오류 메시지에 인쇄하고있는 레코드의 크기가 0.02 MB로 너무 작아도 언젠가 예외를 따르고 있습니다.카프카 프로듀서에서 RecordTooLargeException을 해결하는 방법?

java.lang.RuntimeException: Could not forward element to next operator 
Caused by: java.lang.RuntimeException: Could not forward element to next operator 
Caused by: java.lang.Exception: Failed to send data to Kafka: The message is 1513657 bytes when serialized which is larger than the maximum request size you have configured with the max.request.size configuration. 
Caused by: org.apache.kafka.common.errors.RecordTooLargeException: The message is 1513657 bytes when serialized which is larger than the maximum request size you have configured with the max.request.size configuration 

생산자에서 max.request.size를 변경하려고했지만 브로커가 브로커를 변경하고 다시 시작해야합니다.

답변

2

가 최대 메시지 크기 설정을 브로커도 :

message.max.bytes : 1,000,000 (default) 

그래서 당신은 당신의 브로커를 다시 시작해야합니다이 - 그러나 이것은 문제가되지 않을 것이다. 카프카는 중개인 반송과 관련하여 견고한 방법으로 만들어졌습니다.

. http://kafka.apache.org/082/documentation.html#producerconfigs