2017-04-02 68 views
0

我正在使用.NET client (producer and consumer) of Apache Kafka配置Apache Kafka的.NET生產者客戶端使用大消息時出錯

我正在嘗試增加可發送的最大消息的大小。我讀了configuration manual和一些帖子關於我的問題:

  1. Kafka: Sending a 15MB message
  2. https://github.com/confluentinc/kafka-rest/issues/208

我看到了,我應該爲生產者的財產 「max.request.size」。 所以我做了以下內容:

var config = new Dictionary<string, object> 
     { 
      { "bootstrap.servers", brokerList }, 
      { "max.request.size", 10 * 1024 * 1024 } 
     }; 

     using (var producer = new Producer<Null, string>(config, null, new StringSerializer(Encoding.UTF8))) 
     { 
     ... 

但是當我運行的生產者,將拋出一個異常:

System.InvalidOperationException: 'No such configuration property: "max.request.size"' 

Apache的卡夫卡文檔講述了以下有關生產者的這個屬性:

在字節的請求的最大大小。這也是一個有效的最大記錄大小上限 。請注意,服務器在 記錄大小上有自己的上限,這可能與此不同。此設置將限制 生產者將在單個 請求中發送的記錄批次數,以避免發送巨大請求。

如果由於某些原因文檔不是最新的,那麼使用什麼樣的正確屬性?

由於

回答

相關問題