Open fdr400 opened 2 months ago
Hi @fdr400 this is the correct thing to do
Second, is to use the rd_kafka_seek to move the fetched offsets back to the commited values. But, again, I read that seek can used only after manual partition assignment with rd_kafka_assign
It's possible even when subscribing, given you seek only partitions that are assigned to you, that you can check with rd_kafka_assignment
. You should use rd_kafka_seek_partitions
to seek.
Check out this example: https://github.com/confluentinc/librdkafka/blob/7fc5a59826ee1e1dee3236b1e43180cc22cfb496/examples/transactions.c#L166
You should probably need also the rebalance_cb
to check if partitions are revoked from your member. That callback is called on consume, so after processing your last consumed message, but partition isn't revoked until you call assign(NULL)
or incremental_unassign()
inside that one.
@emasab thanks for your answer! I'll try to do so.
But it is not obvious from documentation, because rd_kafka_seek*
functions are in Simple Consumer API
group
Discussed in https://github.com/confluentinc/librdkafka/discussions/4722