-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your request related to a problem you have?
I need to be able to tell the consumers to start from a specified offset. This is implemented in Confluent Kafka by calling Assign with a TopicPartitionOffset.
Describe the solution you'd like
There is currently the ability to set ManualAssignPartitions in the Consumer Configuration, It would be nice to also have ManualAssignPartitionOffsets. Configuration would look like:
consumer.ManualAssignPartitionOffsets("my-topic", new Dictionary<int, long> { { 0, 100 }, { 1, 120 } })
The implementation would look like:
private void ManualAssignPartitionOffsets(IEnumerable<TopicPartitionOffsets> topics)
{
var partitionOffsets = topics
.SelectMany(
topic => topic.PartitionOffsets.Select(
partitionOffset => new Confluent.Kafka.TopicPartitionOffset(
topic.Name, new Partition(partitionOffset.Key), new Offset(partitionOffset.Value))))
.ToList();
_consumer.Assign(partitionOffsets);
Are you able to help bring it to life and contribute with a Pull Request?
Yes
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request