Kafka Simulator docs menu
Tune producers and consumers
Change acks, idempotence, batching, compression, retries and quotas on a producer, and the offset reset, isolation level and assignor of a consumer group.
On this page
The steps use the free-play sandbox the playground opens with: producer p1 writes with acks=all and idempotence on, and consumer group cg1 has one member, c1. In a scripted scenario, the first change forks it into a sandbox.
Steps
1. Open the producer’s configuration
Select the producer p1 on the canvas. The Inspector opens on Producer · p1. A word and a sentence on top say what the producer is doing (Acked, Batching, Retrying, Blocked). Under them, the settings sit on five stations in the order a record passes them: send(), partitioner, accumulator, sender and broker ack. A marker on the line shows the station the current batch is at, and turns red on the one that holds it up. Select a station’s name to close or open it; when the panel is too short for all of them, only send() and a station holding the batch up start open. The ⓘ next to a setting opens a short explanation with a link to the Apache Kafka documentation.
2. Change the producer settings
Each row edits one setting of this producer only:
| Station | Row | Control | Kafka setting and simulator note |
|---|---|---|---|
| send() | message key | keep current (M1, M2, …), empty / default partitioner, fixed value | The key on the records the playground produces as this producer. A fixed key always lands on the same partition. |
| send() | produce every (ms) | number, empty for the default | How often the canvas auto-loop produces as this producer. |
| partitioner | partitioner | default (sticky), round-robin, uniform-sticky | Where records without a key go. |
| accumulator | batching | checkbox | Sets linger.ms to 100 (on) or 0 (off). |
| accumulator | linger.ms | stepper | linger.ms |
| accumulator | batch.size (records) | number, empty for off | batch.size, counted in records: a batch is sent as soon as it holds this many. |
| accumulator | compression.type | none, zstd, gzip, lz4, snappy | compression.type, modeled as more records in the same batch.size, so batches are fewer and larger. |
| accumulator | buffer.memory | number, empty for no limit | buffer.memory. A send that finds it full blocks for up to max.block.ms, a row that appears once you set the buffer. |
| sender | max.in.flight | number, empty for no limit | max.in.flight.requests.per.connection |
| sender | retries, retry.backoff.ms | steppers | retries, retry.backoff.ms |
| sender | producer_byte_rate | number, empty for no limit | A byte-rate client quota on this producer. A producer over it is throttled, and the note under the row says THROTTLED. In Kafka this is not a producer config: the broker enforces it per user and/or client-id, set with kafka-configs.sh. The simulator shows it on the producer for convenience. |
| broker ack | acks | 0, 1 or all | acks |
| broker ack | idempotence | checkbox | enable.idempotence |
When the cluster has more than one topic, a topic row on send() picks the topic this producer writes to. Under the stations, not the kafka default lists each setting that differs from the Apache Kafka default, with both values. Settings left unset use the simulator’s own fallbacks (by default 5 retries, 400 ms apart, no limit on requests in flight), and the list says so in one line.
3. Change the consumer group settings
Select the consumer group cg1. The Inspector opens on Consumer group · cg1:
| Row | Control | Kafka setting and simulator note |
|---|---|---|
| auto.offset.reset | earliest, latest, none | auto.offset.reset |
| isolation.level | uncommitted, committed | isolation.level (read_uncommitted, read_committed) |
| enable.auto.commit | display only | enable.auto.commit |
| poll interval (ms) | stepper | How often the selected consumer group polls. Each group keeps its own interval. |
| assignor | range, roundrobin, sticky, cooperative-sticky | partition.assignment.strategy |
| max.poll.records | display only | max.poll.records, ∞ when there is no cap. |
When the cluster has more than one topic, a subscribed topics row picks the topics the group reads. Under members, the dynamic button next to a member turns on static membership (group.instance.id) for it, and kill stops it.
4. Watch the effect
Produce a record with produce as p1 on send(), or let the auto-loop run. The line on top says what happened to the latest send, and each station shows its part: the target partition on partitioner, the buffer on accumulator, the retry attempt on sender, the latency of the last acknowledgement or the error on broker ack. The Metrics tab shows the same over time: Records produced, Retries, Produce throughput, Produce latency and Consumer lag.
For example, set acks to 0 and produce once. When the batch goes out, the line on top reads Sent, no ack and a delivery row on broker ack reads “fire-and-forget (acks=0, no ack)”. Each change is a recorded action, so it travels in a shared link.
The action log at the foot of the Failure tab lists your changes too.
Related
- Build a cluster in free play and break it shows how
acks=allandmin.insync.replicasdecide whether a write survives a broker failure. - The scenario catalog lists the scripted scenarios on producers and consumer groups.
- The acks trade-off scenario page shows what each
ackssetting does to a write, step by step.
- The linger.ms and batch.size scenario page shows the batching rows at work, and the TimeoutException and Consumers see duplicate messages pages start from what a mistuned producer looks like from outside.
- The Stuck consumer & max.poll.interval.ms scenario page, and the Consumer lag keeps growing and The consumer group keeps rebalancing pages, do the same for a consumer group.