I need to do a programmatic commit using kafka-python api. From the the documentation i see that I need to use the api below, but couldn't find a good usage example:
It needs offsets as a dictionary of TopicPartition and OffsetMetadata. I was thinking of using the assignment() API on the consumer which returns me the list of TopicPartitions of the current consumer. For the OffsetAndMetadata, i can set the offset but I don't get what i need to set for the metadata attribute. The documentation isn't that helpful.
Please let me know.
Thanks in advance.