2017-04-07 11 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) 

つまり、あなたのブローカーを再起動する必要があります - しかし、これは問題ではありません。カフカはブローカーのバウンスに関して堅牢な方法で構築されています。

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

関連する問題