noodles, Without an external mechanism you won't be able to mark individual messages/offsets as needing to be retried at a later time. Guozhang is describing a way to get the offset of a message that's been received so that you can find it later. You would need to save that into a 'failed messages' store somewhere else and have code that looks in there to make retries happen (assuming you want the failure/retry to persist beyond the lifetime of the process).
Christian On Wed, Jan 28, 2015 at 7:00 PM, Guozhang Wang <wangg...@gmail.com> wrote: > I see. If you are using the high-level consumer, once the message is > returned to the application it is considered "consumed", and current it is > not supported to "re-wind" to a previously consumed message. > > With the new consumer coming in 0.8.3 release, we have an api for you to > get the offset of each message and do the rewinding based on offsets. For > example, you can do sth. like > > ---- > > message = // get one message from consumer > > try { > // process message > } catch { > consumer.seek(message.offset) > } > > ---- > > Guozhang > > On Wed, Jan 28, 2015 at 6:26 PM, noodles <rungumpth...@gmail.com> wrote: > > > I did not describe my problem clearly. In my case, I got the message from > > Kakfa, but I could not handle this message because of some reason, for > > example the external server is down. So I want to mark the message as not > > being consumed directly. > > > > 2015-01-28 23:26 GMT+08:00 Guozhang Wang <wangg...@gmail.com>: > > > > > Hi, > > > > > > Which consumer are you using? If you are using a high level consumer > then > > > retry would be automatic upon network exceptions. > > > > > > Guozhang > > > > > > On Wed, Jan 28, 2015 at 1:32 AM, noodles <rungumpth...@gmail.com> > wrote: > > > > > > > Hi group: > > > > > > > > I'm working for building a webhook notification service based on > > Kafka. I > > > > produce all of the payloads into Kafka, and consumers consume these > > > > payloads by offset. > > > > > > > > Sometimes some payloads cannot be consumed because of network > exception > > > or > > > > http server exception. So I want to mark the failed payloads and > retry > > > them > > > > by timers. But I have no idea if I don't use a storage (like MySQL) > > > except > > > > kafka and zookeeper. > > > > > > > > > > > > -- > > > > *noodles!* > > > > > > > > > > > > > > > > -- > > > -- Guozhang > > > > > > > > > > > -- > > *Yeah, I'm noodles!* > > > > > > -- > -- Guozhang >