You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Sathyanarayanan Nagarajan <sa...@gmail.com> on 2014/07/30 04:32:30 UTC

Issue with unit testing Kafka on 0.8.1.1 and scala 2.9.2

Hi,

 i have been trying to run the kafka server using TestUtils.for my unit
tests, while the topic gets created, i'm getting the following error

 error when handling request
Name:LeaderAndIsrRequest;Version:0;Controller:0;ControllerEpoch:1;CorrelationId:9;ClientId:id_0-host_localhost-port_9000;Leaders:id:0,host:localhost,port:9000;PartitionState:(netopic,0)
->
(LeaderAndIsrInfo:(Leader:0,ISR:0,1,LeaderEpoch:0,ControllerEpoch:1),ReplicationFactor:2),AllReplicas:0,1)
(kafka.server.KafkaApis:103)

It creates topics and i can check for existence

Output from my program
All topics Map(new-topic -> {})
 topic exists true

here's how i'm creating the zookeeper client and topic

        zkClient = new ZkClient(zookeeper.connectString(),
zkSessionTimeout,zkConnectionTimeout,  ZKStringSerializer$.MODULE$ );

        AdminUtils.createTopic(zkClient, topic, 1,
2,AdminUtils.createTopic$default$5());

kafka version

       <groupId>org.apache.kafka</groupId>
                <artifactId>kafka_2.9.2</artifactId>
                <version>0.8.1.1</version>

Let me know if anyone has faced this issue and any resolution for the same.

Regards,
Sathya

Re: Issue with unit testing Kafka on 0.8.1.1 and scala 2.9.2

Posted by Sathyanarayanan Nagarajan <sa...@gmail.com>.
I wrote my java code based on  kafka unit testing example code. Have you
got it working on a java code?

Regards,
Sathya


On Wed, Jul 30, 2014 at 9:07 PM, Jun Rao <ju...@gmail.com> wrote:

> Perhaps you can follow some examples in Kafka unit test?
>
> Thanks,
>
> Jun
>
>
> On Tue, Jul 29, 2014 at 7:32 PM, Sathyanarayanan Nagarajan <
> sathya21@gmail.com> wrote:
>
> > Hi,
> >
> >  i have been trying to run the kafka server using TestUtils.for my unit
> > tests, while the topic gets created, i'm getting the following error
> >
> >  error when handling request
> >
> >
> Name:LeaderAndIsrRequest;Version:0;Controller:0;ControllerEpoch:1;CorrelationId:9;ClientId:id_0-host_localhost-port_9000;Leaders:id:0,host:localhost,port:9000;PartitionState:(netopic,0)
> > ->
> >
> >
> (LeaderAndIsrInfo:(Leader:0,ISR:0,1,LeaderEpoch:0,ControllerEpoch:1),ReplicationFactor:2),AllReplicas:0,1)
> > (kafka.server.KafkaApis:103)
> >
> > It creates topics and i can check for existence
> >
> > Output from my program
> > All topics Map(new-topic -> {})
> >  topic exists true
> >
> > here's how i'm creating the zookeeper client and topic
> >
> >         zkClient = new ZkClient(zookeeper.connectString(),
> > zkSessionTimeout,zkConnectionTimeout,  ZKStringSerializer$.MODULE$ );
> >
> >         AdminUtils.createTopic(zkClient, topic, 1,
> > 2,AdminUtils.createTopic$default$5());
> >
> > kafka version
> >
> >        <groupId>org.apache.kafka</groupId>
> >                 <artifactId>kafka_2.9.2</artifactId>
> >                 <version>0.8.1.1</version>
> >
> > Let me know if anyone has faced this issue and any resolution for the
> same.
> >
> > Regards,
> > Sathya
> >
>

Re: Issue with unit testing Kafka on 0.8.1.1 and scala 2.9.2

Posted by Jun Rao <ju...@gmail.com>.
Perhaps you can follow some examples in Kafka unit test?

Thanks,

Jun


On Tue, Jul 29, 2014 at 7:32 PM, Sathyanarayanan Nagarajan <
sathya21@gmail.com> wrote:

> Hi,
>
>  i have been trying to run the kafka server using TestUtils.for my unit
> tests, while the topic gets created, i'm getting the following error
>
>  error when handling request
>
> Name:LeaderAndIsrRequest;Version:0;Controller:0;ControllerEpoch:1;CorrelationId:9;ClientId:id_0-host_localhost-port_9000;Leaders:id:0,host:localhost,port:9000;PartitionState:(netopic,0)
> ->
>
> (LeaderAndIsrInfo:(Leader:0,ISR:0,1,LeaderEpoch:0,ControllerEpoch:1),ReplicationFactor:2),AllReplicas:0,1)
> (kafka.server.KafkaApis:103)
>
> It creates topics and i can check for existence
>
> Output from my program
> All topics Map(new-topic -> {})
>  topic exists true
>
> here's how i'm creating the zookeeper client and topic
>
>         zkClient = new ZkClient(zookeeper.connectString(),
> zkSessionTimeout,zkConnectionTimeout,  ZKStringSerializer$.MODULE$ );
>
>         AdminUtils.createTopic(zkClient, topic, 1,
> 2,AdminUtils.createTopic$default$5());
>
> kafka version
>
>        <groupId>org.apache.kafka</groupId>
>                 <artifactId>kafka_2.9.2</artifactId>
>                 <version>0.8.1.1</version>
>
> Let me know if anyone has faced this issue and any resolution for the same.
>
> Regards,
> Sathya
>