earliestOrLatestOffset, getOffsetsBefore

2015-02-22 Thread Stuart Reynolds
In http://apache.osuosl.org/kafka/0.8.2-beta/scala-doc/index.html#kafka.consumer.SimpleConsumer class SimpleConsumer: def earliestOrLatestOffset(topicAndPartition: TopicAndPartition, earliestOrLatest: Long, consumerId:Int): Long 1) What's the consumerId? It doesn't seem to matter what value

Latest offset is frozen

2015-02-22 Thread Stuart Reynolds
I'm finding that if I continuously produce values to a topic (say, once every 2 seconds), and in another thread, query the head and tail offsets of a topic, then sometimes I see the head offset increasing, sometimes its frozen. What's up with that? I'm using scala client: 0.8.2 and server: 2.9.2-0

Re: How to find the number of message in the topic

2015-02-23 Thread Stuart Reynolds
See SimpleConsumer. getOffsetsBefore and the getLastOffset example here: https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example whichTime=-1 or -2 (depending whether you want the latest or earliest offset. However, I've been banging my head against the wall with this

Re: How to find the number of message in the topic

2015-02-24 Thread Stuart Reynolds
2015 at 9:48 AM, Stuart Reynolds > wrote: > >> See SimpleConsumer. getOffsetsBefore >> and the getLastOffset example here: >> >> https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example >> whichTime=-1 or -2 (depending whether you want th

Re: Latest offset is frozen

2015-02-25 Thread Stuart Reynolds
nks, > > Jun > > On Sun, Feb 22, 2015 at 6:45 PM, Stuart Reynolds > wrote: > >> I'm finding that if I continuously produce values to a topic (say, >> once every 2 seconds), and in another thread, query the head and tail >> offsets of a topic, then sometimes I se

0.8 scala API reference

2015-03-01 Thread Stuart Reynolds
Pretty please, can someone add a link to the scaladoc API reference for the the current release? http://kafka.apache.org/documentation.html On Sat, Feb 28, 2015 at 9:31 PM, Guozhang Wang wrote: > Is this you are looking for? > > http://kafka.apache.org/07/documentation.html > > On Fri, Feb 27, 20

Re: Got negative offset lag after restarting brokers

2015-03-02 Thread Stuart Reynolds
Each topic has: earliest and latest offsets (per partition) Each consumer group has a current offset (per topic, partition pair) I see -1 for the current offsets new consumer groups that haven't yet committed an offset. I think it means that the offsets for that consumer group are undefined. Is

Possible to count for unclosed resources in process

2015-03-06 Thread Stuart Reynolds
One of our staff has has been terrible at adding finally clauses to close kafka resources. Does the kafka scala/Java client maintain a count or list of open producers/consumers/client connections?

Re: Possible to count for unclosed resources in process

2015-03-06 Thread Stuart Reynolds
ay miss messages as the connection will close before all >> messages are sent. Guess how we found out? :) >> >> Similar for consumer, if you use high level consumer and don't close the >> consumer nicely, you may not acknowledge the last messages and they will be >> re-read

kafka log ERROR Closing socket for IP -- Connection reset by peer

2015-03-09 Thread Stuart Reynolds
I'm calling ConsumerConnector.shutdown to close a consumer connection and kafka's log reports an error? I don't see a similar error when using SimpleConsumer. Is there a way to close ConsumerConnector so that the errors aren't reported in the kafka log (this is making it very difficult to sift th