コード例 #1
1
        protected AbstractKafkaClient(KafkaSinkOptions options)
        {
            Contract.Requires<ArgumentNullException>(options != null);

            this.options = options;
            this.producerConfiguration = new ProducerConfiguration(options.Topic);
        }
コード例 #2
0
ファイル: Producer.cs プロジェクト: orianbsilva/kafka4net
        public Producer(Cluster cluster, ProducerConfiguration producerConfiguration)
        {
            Configuration = producerConfiguration;
            _cluster = cluster;

            _cluster.OnThreadHang += e => 
            {
                if (OnPermError != null)
                    OnPermError(e, _allPartitionQueues.SelectMany(p => p.Value.Queue.ToArray()).ToArray());
            };
        }
コード例 #3
0
ファイル: Producer.cs プロジェクト: deivydas/kafka4net
        public Producer(Cluster cluster, ProducerConfiguration producerConfiguration)
        {
            Configuration = producerConfiguration;
            _cluster = cluster;

            _queueSizeEvents = new Subject<QueueResizeInfo>();
            QueueSizeEvents = _queueSizeEvents.ObserveOn(Scheduler.Default);

            _cluster.OnThreadHang += e => 
            {
                if (OnPermError != null)
                    OnPermError(e, _allPartitionQueues.SelectMany(p => p.Value.Queue.ToArray()).ToArray());
            };
        }
コード例 #4
0
ファイル: Producer.cs プロジェクト: deivydas/kafka4net
 /// <summary>
 /// 
 /// </summary>
 /// <param name="seedBrokers">Comma separated list of seed brokers. Port numbers are optional.
 /// <example>192.168.56.10,192.168.56.20:8081,broker3.local.net:8181</example>
 /// </param>
 /// <param name="producerConfiguration"></param>
 public Producer(string seedBrokers, ProducerConfiguration producerConfiguration)
     : this(new Cluster(seedBrokers), producerConfiguration)
 {
     _internalCluster = true;
 }