Actually, in 0.7.1, the only metadata that we associate with each iterated message is topic. There are are couple of reasons why we didn't expose offset: (1) in 0.7.1, partition is local to a broker. So, for each offset, we have to return a (brokerid, partition id, offset) triple, which is inconvenient. (2) Our consumer api doesn't support setting the initial offset for a partition at startup.
So, for now, if you really need to know/set the offset, you have to use the low-level consumer. Thanks, Jun On Tue, Jun 19, 2012 at 9:22 AM, Jay Kreps <jay.kr...@gmail.com> wrote: > Jun, I think what he is saying is he wants to keep the offset in the > database so he can commit the data and offset transactionally. > > Tao, in the 0.7 release the offset is not exposed in the high-level API. > However in 0.7.1 which is currently in RC we do expose this. My > recommendation would be to give that a try. > > -Jay > > On Tue, Jun 19, 2012 at 9:16 AM, Jun Rao <jun...@gmail.com> wrote: > > > Tao, > > > > You can use manual offset commit in the high level consumer. Basically, > > call offset commit only after the data has been successfully processed. > > > > Thanks, > > > > Jun > > > > On Mon, Jun 18, 2012 at 10:41 PM, tao li <tust.05102...@gmail.com> > wrote: > > > > > hi, all > > > > > > In my project, we want to consume the msg in kafka in the transaction, > > so, > > > when the transaction rollback, we need the kafka offset back to the > > > point transaction begin, I use the consumer Low-level API make it, it's > > too > > > complex, how to make Transaction get with the consumer High-level API > if > > > is possible. > > > > > > Best regards, > > > > > > litao > > > > > >