That was it! I didn't have logging setup correctly, so I missed those extra clues.
Not using the kafka instance hostname in the producer caused the topic metadata requests to fail. Thank you! On Thu, Jun 20, 2013 at 3:01 PM, Jun Rao <jun...@gmail.com> wrote: > Before that log entry, you should see why the send fails in WARN. Could you > post that? Also, any error/exception in the broker log (including > state-change log)? > > Thanks, > > Jun > > > On Thu, Jun 20, 2013 at 12:08 AM, Ran RanUser <ranuse...@gmail.com> wrote: > > > I'm stumped: > > > > My sample Producer code does not work in Windows, but does work in Linux > > (Ubunuty). > > > > My sample Consumer code is fine. > > > > - Kaka 0.8 (June 19), compiled using Scala 2.9.2 > > - Java version is JDK 1.7x (Oracle version in Windows, OpenJDK on Ubuntu) > > - 1 broker, 1 partition,1 replica, no compression, topic already created > > called "test" > > - Producer code throws exception when producer runs on Windows 7 > regardless > > if Kaka broker is running in Windows 7 or Ubuntu 12.04 > > - Producer code works if run on Ubuntu 12.04 > > - Consumer code works on Windows > > > > Producer code: > > > > val topic = "test" > > val props = new Properties() > > props.put("serializer.class", "kafka.serializer.StringEncoder"); > > props.put("metadata.broker.list", "192.168.1.200:9092"); > > val producer = new Producer[String, String](new > ProducerConfig(props)) > > val msg = new KeyedMessage(topic, "key1", "value1") > > try { > > producer.send(msg) > > } > > catch { > > case e: Exception => > > ... > > } > > > > Stack trace: > > > > kafka.common.FailedToSendMessageException: Failed to send messages after > 3 > > tries. > > at > > > > > kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:90) > > at kafka.producer.Producer.send(Producer.scala:74) > > at kafka.javaapi.producer.Producer.send(Producer.scala:32) > > at shops.runner.Runner$.main(Runner.scala:91) > > > > > > Any ideas? > > > > > > Thank you! > > >