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

            this.options = options;
            this.producerConfiguration = new ProducerConfiguration(options.Topic);
        }
예제 #2
0
        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
        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
 /// <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;
 }