title: Kafka Producer From Remote Server
body: <p>I'm developing a streaming API with Apache Kafka version (2.1.0). I have a Kafka cluster and an external server.
  The external Server will be producing data to be consumed on the Kafka cluster. </p>
  
  <p>Let's denote the external Server as <strong>E</strong> and the cluster as <strong>C</strong> . <strong>E</strong> doesn't have Kafka installed. I run on it a JAR file to produce messages. Here is the snippet for  <strong>Producer  properties:</strong> </p>
  
  <pre><code>properties.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "bootstrapIp:9092");
  properties.put(ProducerConfig.CLIENT_ID_CONFIG, "producer");
  </code></pre>
  
  <p>I set <code>bootstrapIp</code> to the Kafka broker IP. </p>
  
  <p>In the cluster side, I start the consumer console using this command:</p>
  
  <pre><code>kafka-console-consumer --bootstrap-server bootstrapIp:9092 --topic T1 --from-beginning
  </code></pre>
  
  <p>I set <code>bootstrapIp</code> to the cluster bootstrap server IP.</p>
  
  <p>When running the producer and the consumer on the cluster, it works very fine, but when i run the producer in the external server (<strong>E</strong>) and the consumer in the cluster (<strong>C</strong>) the data not being consumed.</p>
  
  <p>In localhost every thing is working fine also when i run the producer and the consumer in the cluster (<strong>C</strong>) everything is working fine, when running the producer externally i can't consume the data in the cluster.</p>
  
  <p>The ping from cluster(<strong>C</strong>) to  external server (<strong>E</strong>) is working, but i can't see where the problem is exactly.</p>
  
  <p>I am not able to figure out how to consume messages from an external server.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>From the external server (<strong>E</strong>) i telnet the (<strong>bootstrapIp</strong>):
  telnet bootstrapIp 9092 and it works, i don't understand the problem</p>