You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Skip Montanaro <sk...@gmail.com> on 2018/03/21 18:48:17 UTC

Commit to two topics, commit independently?

I have two related topics, a and b, and want to listen to them, but
commit the appropriate offset in each only when I've processed a pair
of corresponding messages from each. I see that the commit() method (I
use the Python API, FWIW) takes an optional dict, but it's not clear
to this simple guy exactly what {TopicPartition: OffsetAndMetadata}
means. If I am subscibed to two topics, A and B with group_id G, and
want to commit offsets a1 and b5, Is that dictionary defined as

{
    "A": a1,
    "B": b5,
}

or something more complex? (I've clearly not mentioned a partition.)

Thanks,

Skip Montanaro