1 module kafkad.config; 2 3 struct Configuration { 4 /// maximum time to wait (msecs) when bundling fetch requests 5 /// the longer the waiting, the more fetch requests may be accumulated 6 /// the fetcher may bundle faster if there are more requests than fetcherBundleMinRequests 7 int fetcherBundleMaxWaitTime = 100; 8 /// minimum number of fetch requests to accumulate before bundling them into one request 9 /// the fetcher may bundle less requests if the fetcherBundleMaxWaitTime elapses first 10 int fetcherBundleMinRequests = 10; 11 /// maximum time to wait (msecs) when bundling produce requests 12 /// the longer the waiting, the more produce requests may be accumulated 13 /// the pusher may bundle faster if there are more requests than pusherBundleMinRequests 14 int pusherBundleMaxWaitTime = 100; 15 /// minimum number of producer requests to accumulate before bundling them into one request 16 /// the pusher may bundle less requests if the pusherBundleMaxWaitTime elapses first 17 int pusherBundleMinRequests = 10; 18 /// number of retries to perform when waiting for leader election, 0 = retry infinitely 19 int leaderElectionRetryCount = 3; 20 /// time to wait (msecs) between retries when waiting for leader election 21 int leaderElectionRetryTimeout = 1000; 22 /// size of the serializer buffer 23 int serializerChunkSize = 1024*4; 24 /// size of the deserializer buffer 25 int deserializerChunkSize = 1024*4; 26 /// maximum time (msecs) the broker should wait for the receipt of the number of acknowledgements (producerRequiredAcks) 27 int produceRequestTimeout = 1000; 28 /// this field indicates how many acknowledgements the servers should receive before responding to the request 29 /// if it is 0 the server will not send any response (this is the only case where the server will not reply to a request) 30 /// if it is 1, the server will wait the data is written to the local log before sending a response 31 /// if it is -1 the server will block until the message is committed by all in sync replicas before sending a response 32 /// for any number > 1 the server will block waiting for this number of acknowledgements to occur (but the server will 33 /// never wait for more acknowledgements than there are in-sync replicas) 34 short producerRequiredAcks = 1; 35 /// maximum time to wait (msecs) for a message set. Batches of messages are prepared up to maximum buffer size or up to 36 /// batch timeout, whichever happens first 37 int producerBatchTimeout = 100; 38 /// maximum number of bytes to include in the message set, this must not be larger than consumerMaxBytes, 39 /// otherwise, the consumers may not handle the message sets. 40 int producerMaxBytes = 1024*1024; //1mb 41 /// number of producer queue buffers, each one has size of producerMaxBytes, must be at least 2 42 int producerQueueBuffers = 2; 43 /// maximum time to wait (msecs) for messages 44 int consumerMaxWaitTime = 100; 45 /// minimum number of bytes to accumulate on the server before returning messages 46 int consumerMinBytes = 1; 47 /// maximum number of bytes to include in the message set 48 int consumerMaxBytes = 1024*1024; //1mb 49 /// number of consumer queue buffers, each one has size of consumerMaxBytes, must be at least 2 50 int consumerQueueBuffers = 2; 51 /// number of retries to perform when refreshing the metadata, 0 = retry infinitely 52 int metadataRefreshRetryCount = 3; 53 /// time to wait (msecs) between retries when refreshing the metadata 54 int metadataRefreshRetryTimeout = 1000; 55 /// default compression mode for the producers, may be overriden in the Producer constructor 56 Compression producerCompression = Compression.None; 57 /// valid only for GZIP compression, compression level between 1 and 9: 1 gives best speed, 9 gives best compression 58 int producerCompressionLevel = 6; 59 } 60 61 enum Compression { 62 None = 0, 63 GZIP = 1, 64 Snappy = 2, 65 }