Re: Questions about .9 consumer API

2015-10-27 Thread Guozhang Wang
The Java docs have not been updated, but here is a short summary: Consumer.poll() call will possibly throw three types of exceptions: 1) WakeupException: this is when Consumer.close() is called by another thread which interrupts another user thread polling on the consumer, users should really cat

Re: Questions about .9 consumer API

2015-10-26 Thread Mohit Anchlia
There is a very basic example here: https://github.com/apache/kafka/blob/trunk/examples/src/main/java/kafka/examples/Consumer.java However, I have a question on the failure scenario where say there is an error in a for loop, is the expectation that developer set the offset to offset -1 ? On Sat,

Re: Questions about .9 consumer API

2015-10-24 Thread Guozhang Wang
Mohit, We will update the java docs page to include more examples using the APIs soon, will keep you posted. Guozhang On Fri, Oct 23, 2015 at 9:30 AM, Mohit Anchlia wrote: > Can I get a link to other type of examples? I would like to see how to > write the API code correctly. > > On Fri, Oct 2

Re: Questions about .9 consumer API

2015-10-23 Thread Mohit Anchlia
Can I get a link to other type of examples? I would like to see how to write the API code correctly. On Fri, Oct 23, 2015 at 8:23 AM, Gwen Shapira wrote: > There are some examples that include error handling. These are to > demonstrate the new and awesome seek() method. > You don't have to handl

Re: Questions about .9 consumer API

2015-10-23 Thread Gwen Shapira
There are some examples that include error handling. These are to demonstrate the new and awesome seek() method. You don't have to handle errors that way, we are just showing that you can. On Thu, Oct 22, 2015 at 8:34 PM, Mohit Anchlia wrote: > It's in this link. Most of the examples have some ki

Re: Questions about .9 consumer API

2015-10-22 Thread Mohit Anchlia
It's in this link. Most of the examples have some kind of error handling http://people.apache.org/~nehanarkhede/kafka-0.9-consumer-javadoc/doc/ On Thu, Oct 22, 2015 at 7:45 PM, Guozhang Wang wrote: > Could you point me to the exact examples that indicate user error handling? > > Guozhang > > On

Re: Questions about .9 consumer API

2015-10-22 Thread Guozhang Wang
Could you point me to the exact examples that indicate user error handling? Guozhang On Thu, Oct 22, 2015 at 5:43 PM, Mohit Anchlia wrote: > The examples in the javadoc seems to imply that developers need to manage > all of the aspects around failures. Those examples are for rewinding > offsets

Re: Questions about .9 consumer API

2015-10-22 Thread Mohit Anchlia
The examples in the javadoc seems to imply that developers need to manage all of the aspects around failures. Those examples are for rewinding offsets, dealing with failed portioned for instance. On Thu, Oct 22, 2015 at 11:17 AM, Guozhang Wang wrote: > Hi Mohit: > > In general new consumers will

Re: Questions about .9 consumer API

2015-10-22 Thread Guozhang Wang
Hi Mohit: In general new consumers will abstract developers from any network failures. More specifically. 1) consumers will automatically try to re-fetch the messages if the previous fetch has failed. 2) consumers will remember the currently fetch positions after each successful fetch, and can pe