Re: Kafka Mock

2014-04-30 Thread Clark Breyman
Mike, It's nowhere near a full broker, but I've had luck with using PowerMock (Mockito version) since it can mock out the static Consumer.createJavaConsumerConnector and the java Producer constructor. It doesn't guarantee that your mocks behave like Kafka but it's something. If you find/create

Re: Kafka Mock

2014-04-30 Thread Matt Narrell
Clark, Would you attach a small example of this mocking of Consumer.createJavaConsumer please? Thanks, Matt On Apr 30, 2014, at 6:39 AM, Clark Breyman cl...@breyman.com wrote: Mike, It's nowhere near a full broker, but I've had luck with using PowerMock (Mockito version) since it can

Re: Kafka Mock

2014-04-30 Thread Jay Kreps
With the new Java Kafka clients we are shipping a mock producer and consumer. E.g. https://github.com/apache/kafka/blob/0.8.1/clients/src/main/java/org/apache/kafka/clients/producer/MockProducer.java I suppose that doesn't help you now unless you are using the new producer already, but at least

Re: Kafka Mock

2014-04-30 Thread Clark Breyman
Matt - Here's a small Gist that shows some of the setup for Consumer.createJavaConsumer(). https://gist.github.com/clarkbreyman/548f25ad78c4bb4a7df7 -Clark On Wed, Apr 30, 2014 at 7:33 AM, Matt Narrell matt.narr...@gmail.comwrote: Clark, Would you attach a small example of this mocking of

Re: Kafka Mock

2014-04-30 Thread Olson,Andrew
You might take a look at the KafkaServerTestHarness [1] if you’re not already familiar with it. It’s not exactly “mock”, but it makes it easy to test Kafka functionality without needing to connect to any external broker or ZK processes. We ported this test harness to Java for our junit and

Re: Kafka Mock

2014-04-30 Thread Mike Marzo
I will have a look. Thanks mike marzo 908 209-4484 On Apr 30, 2014 4:56 PM, Olson,Andrew aols...@cerner.com wrote: You might take a look at the KafkaServerTestHarness [1] if you’re not already familiar with it. It’s not exactly “mock”, but it makes it easy to test Kafka functionality without

Re: Kafka Mock

2014-04-30 Thread Matt Narrell
Thanks Clark. -Matt On Apr 30, 2014, at 11:04 AM, Clark Breyman cl...@breyman.com wrote: Matt - Here's a small Gist that shows some of the setup for Consumer.createJavaConsumer(). https://gist.github.com/clarkbreyman/548f25ad78c4bb4a7df7 -Clark On Wed, Apr 30, 2014 at 7:33 AM, Matt

Kafka Mock

2014-04-29 Thread Mike Marzo
Is there any good mock impls of kafka that can be leveraged in junit tests?

Re: Kafka Mock

2014-04-29 Thread Guozhang Wang
Hi Mike, Do you just need a socket server which someone can talk to following the kafka server protocol or you need other funtionalities of the server? Guozhang On Tue, Apr 29, 2014 at 10:41 AM, Mike Marzo precisionarchery...@gmail.comwrote: Is there any good mock impls of kafka that can be