Пример #1
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);
        }
Пример #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);
        }