title: Kafka - Unable to send a message to a remote server using Java
body: <p>I'm trying to create a <code>Kafka</code> cluster to send messages to a remote control. I have configured everything as described <a href="https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+Producer+Example">here</a>.
  I am running this on a <code>Linux red hat</code> machine, and it works fine using the shell. After writing the java code as described in the <code>quick start</code> tutorial on my windows machine, I have received the following error:</p>
  
  <pre><code>...
  DEBUG kafka.client.ClientUtils$ - Successfully fetched metadata for 1 topic(s)     Set(example)
  ...
  ERROR kafka.producer.SyncProducer - Producer connection to cldExampleKafka.domain:80 unsuccessful 
  java.nio.channels.UnresolvedAddressException
      ...
      at kafka.producer.async.ProducerSendThread.run(ProducerSendThread.scala:44)
  ...
  WARN kafka.producer.async.DefaultEventHandler - Failed to send producer request with correlation id 2 to broker 0 with data for patitions [ati,0]
  java.nio.channels.UnresolvedAddressException
  ...
  kafka.common.FailedToSendMessageException: Failed to send message after 3 tries.
  </code></pre>
  
  <p>I have also tried to run the jar in a different Linux machine, and still received the same error.</p>
  
  <p>Changing the address to <code>localhost</code> and running the java code as a jar in the machine where the kafka is installed works. </p>
  
  <p>I believe it something with the configuration, but I couldn't find it.</p>