Example #1
0
        protected AbstractKafkaClient(KafkaSinkOptions options)
        {
            Contract.Requires <ArgumentNullException>(options != null);

            this.options = options;
            this.producerConfiguration = new ProducerConfiguration(options.Topic);
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="KafkaSink"/> class.
        /// </summary>
        /// <param name="kafkaClient">
        /// The kafka Client.
        /// </param>
        /// <param name="options">
        /// The configuration options.
        /// </param>
        public KafkaSink(AbstractKafkaClient kafkaClient, KafkaSinkOptions options)
            : base(options.BatchPostingLimit, options.Period)
        {
            Contract.Requires <ArgumentNullException>(options != null);
            Contract.Requires <ArgumentNullException>(kafkaClient != null);

            this.kafkaClient   = kafkaClient;
            this.jsonFormatter = new JsonFormatter(renderMessage: options.RenderSerilogMessage);
        }
Example #3
0
 internal KafkaClient(KafkaSinkOptions options)
     : base(options)
 {
     Contract.Requires <ArgumentNullException>(options != null);
 }