public void Init() { var consumerConfig1 = this.ConsumerConfig1; var consumerConfig2 = this.ConsumerConfig2; var consumerConfig3 = this.ConsumerConfig3; KafkaClusterConnectionPool.Init(CONNECTION_POOL_SIZE, new TimeSpan(0, 0, consumerConfig1.ConnectionLifeSpan), consumerConfig1.BufferSize, consumerConfig1.SocketTimeout, consumerConfig1.IdleTimeToKeepAlive, consumerConfig1.KeepAliveInterval, consumerConfig1.SocketPollingTimeout, consumerConfig1.SocketPollingLevel); }
/// <summary> /// Initializes a new instance of the <see cref="Consumer"/> class. /// </summary> /// <param name="config"> /// The consumer configuration. /// </param> /// <param name="host"></param> /// <param name="port"></param> public Consumer(ConsumerConfiguration config, string host, int port) { Guard.NotNull(config, "config"); this.config = config; this.host = host; this.port = port; KafkaClusterConnectionPool.Init(this.config.MaxConnectionPoolSize, new TimeSpan(0, 0, this.config.ConnectionLifeSpan), this.config.BufferSize, this.config.SocketTimeout, this.config.IdleTimeToKeepAlive, this.config.KeepAliveInterval, this.config.SocketPollingTimeout, this.config.SocketPollingLevel); }