sarama.go 1.4 KB

123456789101112131415161718192021222324252627
  1. /*
  2. Package sarama provides client libraries for the Kafka 0.8 protocol. The Client, Producer and Consumer objects are the core of the high-level API. The Broker and Request/Response objects permit more precise control.
  3. The Request/Response objects and properties are mostly undocumented, as they line up exactly with the
  4. protocol fields documented by Kafka at https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol
  5. */
  6. package sarama
  7. import (
  8. "io/ioutil"
  9. "log"
  10. )
  11. // Logger is the instance of golang's log.Logger that Sarama writes connection
  12. // management events to. By default it is set to discard all log messages via ioutil.Discard,
  13. // but you can set it to redirect wherever you want.
  14. var Logger = log.New(ioutil.Discard, "[Sarama] ", log.LstdFlags)
  15. // PanicHandler is called for recovering from panics spawned internally to the library (and thus
  16. // not recoverable by the caller's goroutine). Defaults to nil, which means panics are not recovered.
  17. var PanicHandler func(interface{})
  18. // MaxRequestSize is the maximum size (in bytes) of any request that Sarama will attempt to send. Trying
  19. // to send a request larger than this will result in an EncodingError. The default of 100 MiB is aligned
  20. // with Kafka's default `socket.request.max.bytes`, which is the largest request the broker will attempt
  21. // to process.
  22. var MaxRequestSize uint32 = 100 * 1024 * 1024