I'm writing some Kafka client code and I'd like to unit test it. I've found 
some resources that say this is possible. For example:

http://ransilberman.wordpress.com/2013/07/19/how-to-unit-test-kafka/

but all the information I've found seems a little bit incorrect. For example, 
the above link uses "enable.zookeeper" which seems to be an ignored property. 
Similarly, other properties mentioned in that file have changed names. I found 
a few posts on this mailing list describing how it might be done (sorry - this 
was a few days ago and I don't have links handy), but they didn't quite work 
either. I tried digging into the scala code but it wasn't immediately obvious 
how to do things, probably partially because I don't know Scala.

If somebody could post working Java code that constructs a Kafka broker that 
can be used for unit testing that would be fantastic. My preference would be 
something that doesn't require ZooKeeper, but there's some talk that in 0.8 
that may no longer be an option. If not, using the Curator framework's 
TestingServer would be great (I'm using Curator everyone). But ultimately, I'll 
take anything that works!

Thanks in advance,
Oliver

Reply via email to