text: // SPDX-License-Identifier: BSD-2-Clause
  //
  // This code has been produced by the European Spallation Source
  // and its partner institutes under the BSD 2 Clause License.
  //
  // See LICENSE.md at the top level for license information.
  //
  // Screaming Udder!                              https://esss.se
  
  #pragma once
  
  #include <map>
  #include <string>
  
  namespace RdKafka {
  class Conf;
  }
  namespace KafkaW {
  
  /// Collect options used to connect to the broker.
  
  struct BrokerSettings {
    void apply(RdKafka::Conf *RdKafkaConfiguration) const;
    std::string Address;
    int PollTimeoutMS = 100;
    std::map<std::string, std::string> KafkaConfiguration = {
        {"api.version.request", "true"},
        {"metadata.request.timeout.ms", "2000"}, // 2 Secs
        {"socket.timeout.ms", "2000"},
        {"message.max.bytes", "24117248"}, // 23 MiB
        {"fetch.message.max.bytes", "24117248"},
        {"fetch.max.bytes", "52428800"},
        {"receive.message.max.bytes", "100000000"},
        {"queue.buffering.max.messages", "100000"},
        {"queue.buffering.max.ms", "50"},
        {"queue.buffering.max.kbytes", "819200"}, // 781.25 MiB
        {"batch.num.messages", "100000"},
        {"coordinator.query.interval.ms", "2000"},
        {"heartbeat.interval.ms", "500"},     // 0.5 Secs
        {"statistics.interval.ms", "600000"}, // 1 Min
    };
  };
  } // namespace KafkaW
  