RE: Unable to start consumers in Tomcat

2013-12-14 Thread Seshadri, Balaji
We are doing one scala consumer and one java consumer who listen on same topic 
with different group id.The issue is if I start both second one fails with this 
error.If we run just one its working fine.

Attaching Scala code and Java code where we call createMessageStreams.It seems 
like issue with API not recognizing that its different group of consumers that 
are started because createMessageStream doesnot accept group.id but should 
refer already passed group.id to make sure second on is new stream and not 
related even we listen on same topic.

Please let me know if it is API issue or way we handle API.


-Original Message-
From: Joe Stein [mailto:joe.st...@stealth.ly] 
Sent: Friday, December 13, 2013 4:36 PM
To: users@kafka.apache.org
Subject: Re: Unable to start consumers in Tomcat

you do this at the consumer connector level not at the message stream level

so one
propsA.put("group.id", "groupA") be
val configA = new ConsumerConfig(propsA) val one = Consumer.create(configA)

and another
propsB.put("group.id", "groupB") be
val configB = new ConsumerConfig(propsB) val two = Consumer.create(configB)

so you then manage each Consumer connector  created by each of those .create in 
separate threads (or actors or processes or however you are doing concurrency) 
and you only call the create message stream each once but each once on each of 
them

makes sense?

/***
 Joe Stein
 Founder, Principal Consultant
 Big Data Open Source Security LLC
 http://www.stealth.ly
 Twitter: @allthingshadoop 
/


On Fri, Dec 13, 2013 at 6:29 PM, Seshadri, Balaji
wrote:

> Cant we create message stream for same topic but different consumer 
> group ?.
>
> -Original Message-
> From: Joe Stein [mailto:joe.st...@stealth.ly]
> Sent: Friday, December 13, 2013 4:23 PM
> To: users@kafka.apache.org
> Subject: Re: Unable to start consumers in Tomcat
>
> You should check your code to verify that it is only called once per 
> instantiated consumer connector.  Here is where the exception is 
> thrown 
> https://github.com/apache/kafka/blob/0.8/core/src/main/scala/kafka/con
> sumer/ZookeeperConsumerConnector.scala#L133from
>
> /***
>  Joe Stein
>  Founder, Principal Consultant
>  Big Data Open Source Security LLC
>  http://www.stealth.ly
>  Twitter: @allthingshadoop 
> /
>
>
> On Fri, Dec 13, 2013 at 6:17 PM, Seshadri, Balaji
> wrote:
>
> > We needed HTTP interface to start our consumers using REST interface 
> > for management that why we chose tomcat to run our consumers.
> >
> > We create streams only once.when we initially start consumer.
> >
> > -Original Message-
> > From: Joe Stein [mailto:joe.st...@stealth.ly]
> > Sent: Friday, December 13, 2013 4:12 PM
> > To: users@kafka.apache.org
> > Subject: Re: Unable to start consumers in Tomcat
> >
> > That error comes if you are trying to create a message/stream on a 
> > consumer instantiated object more than once.
> >
> > Why are you using tomcat for the consumers? Is it to see the results 
> > of messages? if so you need to isolate the Consumer in some way so 
> > there is a singleton (assuming one partition or if more than one 
> > partition some type of consumer pool) and the messages being 
> > consumed write to a thread safe memory structure and then the UI can 
> > read from that thread safe memory structure.
> >
> > /***
> >  Joe Stein
> >  Founder, Principal Consultant
> >  Big Data Open Source Security LLC
> >  http://www.stealth.ly
> >  Twitter: @allthingshadoop 
> > /
> >
> >
> > On Fri, Dec 13, 2013 at 5:42 PM, Seshadri, Balaji
> > wrote:
> >
> > > 0.8
> > >
> > > -Original Message-
> > > From: Neha Narkhede [mailto:neha.narkh...@gmail.com]
> > > Sent: Friday, December 13, 2013 3:33 PM
> > > To: users@kafka.apache.org
> > > Subject: Re: Unable to start consumers in Tomcat
> > >
> > > Which version of kafka are you using?
> > >
> > >
> > > On Fri, Dec 13, 2013 at 2:29 PM, Seshadri, Balaji
> > > wrote:
> > >
> > > > Any idea on this error guys ?.
> > > >
> > > > -Original Message-
> > > > From: Seshadri, Balaji [mailto:balaji.sesha...@dish.com]
> > > > Sent: Friday, December 13, 2013 9:32 AM
> > > > To: 'users@kafka.apache.org'
> > > > Subject: Unable to start consumers in Tomcat
> > > >
> > > > Hi ,
> > > >
> > > > Can you guys lets us know why are we getting this error when try 
> > > > to spawn a consumer ?.
> > > >
> > > > ZookeeperConsumerConnector can create message streams at most 
> > > > once
> > > >
> > > > Balaji
> > > >
> > >
> >
>


Re: Scala 2.10.1 - Issues with starting zookeeper

2013-12-14 Thread Michael G. Noll
Btw Sridhar: If you only want to write producer and/or consumer code in
Scala 2.10 you do not need to run the brokers (and thus build Kafka
itself) with 2.10, too.  That is, you can run the brokers with the stock
Scala 2.8 build and still write "your" code with 2.10. (But I am not
sure if that's what you want to do given your original question.)

See Joe Stein's response at
http://qnalist.com/questions/4631624/about-compiling-broker-in-0-8-branch.

Best,
Michael


On 12/13/2013 06:21 AM, Jun Rao wrote:
> using ./sbt "++ 2.10.1 assembly-package-dependency"
> 
> Thanks,
> 
> Jun
> 
> 
> On Thu, Dec 12, 2013 at 9:19 PM, Jun Rao  wrote:
> 
>> Try building assembly dependency again after building the 2.10.1 package.
>>
>> Thanks,
>>
>> Jun
>>
>>
>> On Thu, Dec 12, 2013 at 12:35 PM, Sridhar Sreenivasan <
>> sridharsre...@gmail.com> wrote:
>>
>>> Hi,
>>> I have downloaded
>>> kafka-0.8.0-src.tgz<
>>> https://www.apache.org/dyn/closer.cgi?path=/kafka/0.8.0/kafka-0.8.0-src.tgz
 ,
>>> and executed the sbt update, sbt package "++ 2.10.1 package", and the
>>> assembly dependency. Modified the scala-version in kafka-run-class.sh to
>>> 2.10.1. Upon starting zookeepr, I get a  "Error: Could not find or load
>>> main class org.apache.zookeeper.server.quorum.QuorumPeerMain". When I
>>> switch it to a 2.8.0 it works fine.
>>> Can you please point out what Iam missing here?
>>>
>>> Regards,
>>> Sridhar.
>>>
>>
>>
> 



Re: Embedding a Kafka 0.8 broker for testing

2013-12-14 Thread Javier Alba
Thanks for your responses! 

I could finally solve the issue (I used something like this 
https://gist.github.com/fjavieralba/7930018)

Your references will be of great help, thanks!


-- 
Javier Alba


On Thursday, 12 de December de 2013 at 19:11, Jason Rosenberg wrote:

> This is something we do routinely. We wrap the KafkaServer from java, it
> works pretty well. You can use the KafkaServerStartable class, or the
> KafkaServer class directly (in which case, you might need to do what we did
> as described in: https://issues.apache.org/jira/browse/KAFKA-1101)
> 
> 
> On Thu, Dec 12, 2013 at 8:07 AM, Jun Rao  (mailto:jun...@gmail.com)> wrote:
> 
> > You can take a look at KafkaServerTestHarness in our unit tests.
> > 
> > Thanks,
> > 
> > Jun
> > 
> > 
> > On Thu, Dec 12, 2013 at 3:14 AM, Javier Alba  > (mailto:m...@fjavieralba.com)> wrote:
> > 
> > > Hi,
> > > 
> > > I would like to embed a Kafka broker in my Java program, for testing
> > > purposes.
> > > 
> > > The idea is being capable of running a Junit test that starts a local
> > kafka
> > > broker, and then perform tests on some custom producers and consumers.
> > > 
> > > After searching around, I've found some pieces of code but none of them
> > > seem to work with Kafka 0.8 API.
> > > 
> > > Does anyone know about any guide/best practice or code example I could
> > use
> > > for this purpose?
> > > 
> > > Thanks in advance! 



Re: cluster expansion

2013-12-14 Thread Robert Turner
Is the kafka-add-partitons.sh tool stable in 0.8.0?


On 13 December 2013 19:21, Neha Narkhede  wrote:

> Partition movement is not an automatic operation in Kafka yet. You need to
> use the partition reassignment tool -
>
> https://cwiki.apache.org/confluence/display/KAFKA/Replication+tools#Replicationtools-6.ReassignPartitionsTool
> .
>
>
> Also, that feature is stable in 0.8.1.
>
> Thanks,
> Neha
>
>
> On Fri, Dec 13, 2013 at 6:48 AM, Robert Turner  wrote:
>
> > No the 6 partitions for each topic will remain on the original brokers.
> You
> > could either reassign some partitions from all topics to the new brokers
> or
> > you could add partitions to the new brokers for each topic. In 0.8.0
> there
> > is now an add-partitions tool.
> >
> > Cheers
> >Rob Turner.
> >
> >
> > On 13 December 2013 14:42, Yu, Libo  wrote:
> >
> > > Hi folks,
> > >
> > > There are three brokers running 0.8-beta1 in our cluster currently.
> > Assume
> > > all the topics have six partitions.
> > > I am going to add another three brokers to the cluster and upgrade all
> of
> > > them to 0.8. My question is after
> > > the cluster is up, will the partition be evenly distributed to all
> > > brokers? Thanks.
> > >
> > > Regards,
> > >
> > > Libo
> > >
> > >
> >
> >
> > --
> > Cheers
> >Rob.
> >
>



-- 
Cheers
   Rob.