Skip to content

Per-Partition Fair Processing#1614

Open
cavus700 wants to merge 1 commit into
kafka-improvmentsfrom
kafka-per-partition-fair-processing
Open

Per-Partition Fair Processing#1614
cavus700 wants to merge 1 commit into
kafka-improvmentsfrom
kafka-per-partition-fair-processing

Conversation

@cavus700
Copy link
Copy Markdown
Member

Breaking Changes

  • MaxConcurrentMessages renamed to MaxConcurrentMessagesPerPartition in KafkaConsumerOptions. This now controls the message limit per partition rather than a single global limit. Existing configurations using. MaxConcurrentMessages must be updated to use MaxConcurrentMessagesPerPartition.

Added

  • Per-partition fair processing: The Kafka consumer now processes partitions independently. Each assigned partition gets its PartitionProcessor, preventing a single busy or slow partition from starving others. This ensures equal processing throughput across all partitions.

  • Kafka Pause/Resume back-pressure: When a partition's processing channel is full, the consumer pauses fetching from that partition. This allows other partitions to continue being consumed without blocking the main consume loop.

  • Partition rebalance handling: The consumer now registers SetPartitionsAssignedHandler and SetPartitionsRevokedHandler callbacks. On assignment, a per-partition processor is created. On revocation, completed in-flight messages are drained and offsets are committed before the partition is released.

  • Round-robin commit loop: The commit loop polls all partition processors in round-robin fashion, picking up completed tasks from each partition's channel. This gives each partition equal attention for offset storage and commits.

  • New log events: PartitionAssigned, PartitionRevoked, PartitionPaused, PartitionResumed for observability into partition lifecycle and back-pressure behavior.

@cavus700 cavus700 force-pushed the kafka-per-partition-fair-processing branch from bea02ab to d5f221e Compare April 15, 2026 10:58
@cavus700 cavus700 force-pushed the kafka-per-partition-fair-processing branch from d5f221e to 950b855 Compare April 15, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant