title: How i can get Kafka consumer hardware interface?
body: <p>I have some services and each service polls data from Kafka by KafkaConsumer.</p>
  <p><strong>What I want</strong>: I need to send tracing info, from what ip address and what interface consumer works.</p>
  <p><strong>And my question is</strong>: How i can get from what hardware interface and what IP address KafkaConsumer polls data?</p>
  <p>For example, i can see interfaces on my server:</p>
  <pre class="lang-java prettyprint-override"><code>    public static void main(String[] args) throws UnknownHostException, SocketException {
          System.out.println(&quot;Your Host addr: &quot; + InetAddress.getLocalHost().getHostAddress());  // often returns &quot;127.0.0.1&quot;
          Enumeration&lt;NetworkInterface&gt; n = NetworkInterface.getNetworkInterfaces();
          for (; n.hasMoreElements();)
          {
              NetworkInterface e = n.nextElement();
              System.out.println();
              System.out.println(e.getName());
              Enumeration&lt;InetAddress&gt; a = e.getInetAddresses();
              for (; a.hasMoreElements();)
              {
                  InetAddress addr = a.nextElement();
                  System.out.println(&quot;  &quot; + addr.getHostAddress());
                  System.out.println(&quot;  &quot; + addr.getHostName());
              }
          }
      }
  </code></pre>
  <p>But how i can find from which interface my KafkaConsumer works?</p>
  <p>Thank you very much for help!</p>