title: How to configure the proxy for a kafka client?
body: <p>I'm using kafka-clients library in order to create a consumer for a Kafka topic. The Kafka broker (producer) is in a restrict network, so only some IPs can access the service. So I need to configure a Proxy on Kafka client (consumer) in order to connect. In ConsumerConfig, that can be passed in Consumer constructor there isn't a proxy entry.</p>
  
  <p>Method to create a consumer:</p>
  
  <pre><code>public static Consumer&lt;Long, String&gt; createConsumer() {
      Properties props = new Properties();
      props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, IKafkaConstants.KAFKA_BROKERS);
      props.put(ConsumerConfig.GROUP_ID_CONFIG, IKafkaConstants.GROUP_ID_CONFIG);
      props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, LongDeserializer.class.getName());
      props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
      props.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, IKafkaConstants.MAX_POLL_RECORDS);
      props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "false");
      props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, IKafkaConstants.OFFSET_RESET_EARLIER);
      Consumer&lt;Long, String&gt; consumer = new KafkaConsumer&lt;&gt;(props);
      consumer.subscribe(Collections.singletonList(IKafkaConstants.TOPIC_NAME));
      return consumer;
  }
  </code></pre>
  
  <p>how can I configure a proxy for this Consumer?</p>