Hi everyone, Same errors can be seen when using embedded kafka and embedded zookeeper in unit tests. They’re absolutely normal. As long as you see a successful connection, it’s all good!
Kind regards, Radek Gruchalski ra...@gruchalski.com (mailto:ra...@gruchalski.com) (mailto:ra...@gruchalski.com) de.linkedin.com/in/radgruchalski/ (http://de.linkedin.com/in/radgruchalski/) Confidentiality: This communication is intended for the above-named person and may be confidential and/or legally privileged. If it has come to you in error you must take no action based on it, nor must you copy or show it to anyone; please delete/destroy and inform the sender immediately. On Friday, 10 July 2015 at 19:09, Jeff Gong wrote: > To follow up and provide a little more context on my second bullet point, > when I run any command for the first time on command line that requires > connecting to this code instantiated ZK server I get the specific error: > > > bin/kafka-topics.sh (http://kafka-topics.sh) --list --zookeeper > > localhost:2181 > > java.net.ConnectException: Connection refused > > at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) > > at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739) > > at > org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361) > > at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081) > > > But after that it looks like a reconnect is attempted, which succeeds and > I'll get a list of my topics or my console consumer will succeed, etc. If I > were to run any of those commands a second time, this error then > disappears. Anyone have any ideas? > > On Thu, Jul 9, 2015 at 4:20 PM, Jeff Gong <j.gon...@gmail.com > (mailto:j.gon...@gmail.com)> wrote: > > > Hey Gwen, > > > > Thanks for your response. The example was very helpful and exactly what I > > was looking for! I went ahead and used that as an example and while most > > things are working as I wanted, there are a few issues I'd like to follow > > up on: > > > > 1. If I launch a Zookeeper/Kafka server from code instead of command line, > > most of the helpful debugging/status messages will not be displayed -- is > > there any way I can retain this functionality? > > > > 2. I created a scenario where I successfully launched a Zookeeper instance > > from code, then connected to that Zookeeper server using a Kafka Server via > > command line. I then instantiated both a Kafka-Console-Consumer and > > Kafka-Console-Producer with the topic 'test'. I was able to send messages > > to the consumer as expected, but I noticed that when I try to connect the > > console consumer to the server I always get a 'Connection Refused' error to > > my Kafka Broker. Any ideas why this might be occuring? > > > > Best, > > Jeff > > > > > > > > On Tue, Jul 7, 2015 at 10:43 AM, Jeff Gong <j.gon...@gmail.com > > (mailto:j.gon...@gmail.com)> wrote: > > > > > Hi all, > > > > > > Is it possible to launch Kafka/Zookeeper servers via some part of the > > > API? I noticed in this: > > > http://stackoverflow.com/questions/16946778/how-can-we-create-a-topic-in-kafka-from-the-ide-using-api/ > > > that it seems to be possible to create a ZK instance and add a topic to > > > it, > > > but is this the same as launching the ZK server as we would in the command > > > line? > > > > > > Similarly, would it be possible to do this for a Kafka server and have it > > > connect to an existing ZK connection? > > > > > > Thanks!