10 Kafka Partitions. 10 Consumers. That Used to Be the Ceiling.
Apache Kafka traditionally ties consumer parallelism to partition count. On November 2, 2026, AWS introduced queue consumption mode for Lambda, using Kafka Share Groups to process independent records concurrently from the same partition. Here's how it works, why it matters, and how to use it in a real image-processing pipeline. Tags: AWS Lambda, Apache Kafka, Serverless, Event Driven Architecture, Cloud Computing
The problem with traditional Kafka consumption
Imagine you're building an application where users upload thousands of images.
Every image needs multiple operations:
- Generate a thumbnail.
- Create different resolutions.
- Convert the format.
- Run image analysis.
These jobs are independent. One slow image should not hold up the processing of hundreds of other images.
But traditional Kafka consumer groups have a limitation.
One partition is assigned to one consumer within a consumer group.
That means:
Kafka partitions | Maximum consumers |
|---|---|
4 | 4 |
10 | 10 |
20 | 20 |
Want more consumers? You may need more partitions.
That can increase broker resource usage, make rebalancing slower, and still leave you with head-of-line blocking.
A slow record can delay the records behind it.
What's new in AWS Lambda?
On November 2, 2026, AWS announced Queue Consumption Mode for Lambda event source mappings that use Apache Kafka.
The feature uses Kafka Share Groups to let multiple consumers process records from the same partition concurrently.
This changes the scaling model.
<escape>
TRADITIONAL STREAM MODE
Partition 0 ── Consumer 1Partition 1 ── Consumer 2Partition 2 ── Consumer 3
One consumer per partition.
QUEUE MODE
Partition 0 ──┬── Consumer 1├── Consumer 2└── Consumer 3
Multiple consumers can process recordsfrom the same partition concurrently.
</escape>
The important difference:
Processing capacity is no longer directly tied to the number of Kafka partitions.
Queue mode also supports up to 10 concurrent Lambda invocations per event poller, compared with up to 5 in stream mode.
A real-world use case: Image processing at scale
Let's build a simple example.
A user uploads a photo. The application needs to generate multiple versions without making the user wait.
Architecture
<escape>
USER UPLOAD|vAmazon S3Original image|vUpload Service|Publishes independent jobs|vApache Kafkaimage-jobs topic|vLambda Event Source MappingQueue Mode|Kafka Share Group|+------------+------------+| | |v v vWorker 1 Worker 2 Worker 3Thumbnail Medium WebP| | |+------------+------------+|vAmazon S3Processed images|vDynamoDBJob status
</escape>
Each image-processing task becomes an independent Kafka record.
For example:
Job | Task |
|---|---|
JOB-001 | Generate thumbnail |
JOB-002 | Generate medium image |
JOB-003 | Convert to WebP |
JOB-004 | Generate high-resolution image |
Lambda can process these records concurrently, even when they originate from the same Kafka partition.
The original file remains in S3. Kafka carries job metadata, not the image itself.
This pattern is also useful for notification delivery, fraud scoring, telemetry ingestion, bulk file processing, and other workloads where records can be handled independently.
Stream Mode vs Queue Mode
Capability | Stream Mode | Queue Mode |
|---|---|---|
Consumption protocol | Kafka consumer groups | Kafka Share Groups |
Consumers per partition | One | Multiple |
Ordering | Preserved per partition | Not guaranteed |
Parallelism | Bounded by partitions | Independent of partition count |
Best for | Ordered event processing | Independent jobs |
The choice depends on your application.
Use Stream Mode when ordering matters:
- Event sourcing
- Change data capture
- Per-customer state transitions
- Ordered financial transactions
Use Queue Mode when throughput matters more than ordering:
- Image and video processing
- Notifications
- Independent background jobs
- Fraud-scoring workloads
- Telemetry processing
You can even run separate Stream and Queue event source mappings against the same topic.
How to enable Queue Mode
The main configuration change is simple.
Set
ConsumptionMode to Queue in your Lambda event source mapping.Example AWS CLI configuration:
aws lambda create-event-source-mapping \ --function-name image-rendition-worker \ --self-managed-event-source '{ "Endpoints": { "KAFKA_BOOTSTRAP_SERVERS": [ "broker1.example.com:9092", "broker2.example.com:9092" ] } }' \ --topics image-jobs \ --batch-size 100 \ --self-managed-kafka-event-source-config \ '{"ConsumptionMode": "Queue"}'The broker addresses and function name are placeholders. Configure the required network access, permissions, and cluster settings for your environment.
The same setting is available through the AWS Console, CloudFormation, SAM, and CDK.
Scaling: What happens when traffic increases?
Queue Mode supports two scaling options.
1. On-demand mode
Lambda adjusts event pollers based on consumer lag.
The default configuration scales up to:
- 5 event pollers per event source mapping.
- Up to 1 MB/s per poller.
- A ceiling of 5 MB/s aggregate throughput or 50 concurrent invocations, whichever comes first.
2. Provisioned mode
For workloads with stricter latency requirements or larger traffic spikes, you can configure dedicated poller capacity.
AWS supports configurable minimum and maximum poller counts. Broker limits still apply, so provisioned capacity must be sized against the Kafka share-group configuration.
Failure handling still matters
Higher parallelism does not remove the need for reliable processing.
Queue Mode uses a record lifecycle:
<escape>
AVAILABLE|vACQUIRED|+------ Success ------> ACKNOWLEDGED|+------ Failure ------> AVAILABLE AGAIN
</escape>
A failed invocation releases records so another poller can acquire them.
But there are important considerations:
- No ordering guarantee: Records can be processed out of order, including records from the same partition.
- Duplicate processing: Lambda event source mappings provide at-least-once processing. Your function must be idempotent.
- Retries: Configure retry limits and an on-failure destination for records that cannot be processed.
- Batching windows: Queue Mode does not support
MaximumBatchingWindowInSeconds.
For example, an image worker should use a stable job ID to avoid generating or billing for the same output repeatedly when a record is delivered again.
Requirements before using it
There are a few things to check:
Requirement | Details |
|---|---|
Kafka version | Apache Kafka 4.2 or later |
Broker capability | Share Groups enabled |
Lambda integration | Self-managed Kafka event source mapping |
Ordering | Not guaranteed in Queue Mode |
Deployment | AWS Console, CLI, CloudFormation, SAM, or CDK |
This includes Kafka clusters you operate and supported hosted Kafka offerings, such as Confluent Cloud.
It is not a setting that automatically applies to every Kafka integration. Check the supported event source mapping and broker requirements first.
The bigger engineering lesson
Scaling a distributed system is not always about adding more infrastructure.
Sometimes the bottleneck is the way work gets assigned.
Traditional Kafka consumption ties consumers to partitions. Queue Mode introduces a different approach for workloads where each record can be processed independently.
You can keep Kafka as your event backbone, use Lambda for serverless processing, and avoid adding a separate queue just to get more parallelism.
But don't switch everything to Queue Mode.
When ordering is part of correctness, Stream Mode is still the right choice.
The real lesson: choose your consumption model based on the workload, not just the technology you're using.
Further Reading
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article