---
title: "Kafka Simulator v2.4 - connect your real Kafka clients and admin tools"
date: 2026-12-01T00:00:00.000Z
author: "michal"
excerpt: "A small local program, monedula-sim-bridge, lets kcat, the Java client, Kafbat UI and Confluent Control Center talk to a simulated cluster. Kill a data center on the canvas and watch your own producer fail over."
---
Until now the [Kafka Simulator](/kafka-simulator/) was a cluster you could only poke from inside the browser. v2.4 opens it to your own tools. A small open source program, [monedula-sim-bridge](/flock/docs/sim-bridge/), runs on your computer and speaks the Kafka protocol on `127.0.0.1`. Every request it gets goes to the playground tab, and the simulated cluster answers it. Your producers, consumers and admin UIs then show up on the canvas next to the simulated ones.

It also let us do something we had wanted for a long time: test the simulator against Apache Kafka itself. We ran Kafka's own test tools through 13 failure scenarios, once against the simulator and once against a real Apache Kafka 4.3.1 cluster, and every check passed on both. [More on that below](#tested-against-apache-kafka).

To show what that means in practice, we pointed four real tools at one simulated cluster: kcat as a producer and a consumer group, Kafbat UI and Confluent Control Center Next Gen. The cluster was the 2.5-DC stretched topology from free play. Then we killed a whole data center.

## Three commands to connect

```bash
monedula-sim-bridge
# monedula-sim-bridge 1.0.1
# Pairing code: K7Q2MZ
# WebSocket:    ws://127.0.0.1:19190/
```

Open [free play](/kafka-simulator/playground/), press **Connect your apps** and type the code. The bridge then opens one Kafka port per simulated broker, from 19092 up, and any client can bootstrap from `127.0.0.1:19092`:

```bash
kcat -b 127.0.0.1:19092 -L
```

Nothing connects on its own. Each page load starts disconnected, and only the Connect button opens the local socket. [Connect your first app](/flock/docs/sim-bridge/tutorials/connect-your-first-app/) walks through it step by step.

## What the playground sees

<figure>
  <img src="/blog/kafka-simulator-v2-4-bridge-real-kafka-clients/playground_2_5_dc_apps.webp" alt="The playground in 2.5-DC stretched free play with the bridge paired. The top bar reads BRIDGE ON, 3 APPS. Its list shows kafbat-ui-admin as apache-kafka-java 7.9.10-ccs with 6 connections, kcat-consumer and kcat-producer as librdkafka 1.8.2. On the canvas, dc-a and dc-b each hold three brokers and a KRaft voter, dc-c holds only the witness voter. The kcat producer sits next to the simulated producer p1, the kcat consumer group next to the simulated group cg1, and a payments topic created by kcat is drawn in its own color." />
  <figcaption>Three real apps on a 2.5-DC cluster. The bridge groups connections by client id and shows each app's client library and version.</figcaption>
</figure>

Every app is grouped by its client id, whatever number of brokers it connects to. It becomes a producer on its first record, a consumer on its first fetch and an admin on its first describe. The list under the status pill shows what each one is: Kafbat UI reports itself as the Java client 7.9.10, kcat as librdkafka 1.8.2.

The cluster in the picture is the [2.5-DC stretched topology](/kafka-simulator/scenarios/stretched-2-5-dc/): two data centers with three brokers each, two synchronous replicas and one observer per site, and a third site that holds only a KRaft voter. `orders` has four synchronous replicas and `min.insync.replicas=3`, so every acknowledged record sits in both data centers. A controller-only third site is plain Apache Kafka; observers and their automatic promotion are a Confluent Server feature (Multi-Region Clusters), and the simulator models both.

## kcat: produce, consume, measure

kcat needs no setup at all. A consumer reads records from both worlds: the JSON orders our kcat producer wrote, and the `M10` record of the simulated producer. Since the simulator models no payloads, a simulated record carries its key as its value.

<figure>
  <img src="/blog/kafka-simulator-v2-4-bridge-real-kafka-clients/kcat_timings_throttle.webp" alt="A terminal with three kcat runs. The first reads the last six records of orders: five JSON orders with keys order-7, order-8, order-0, order-1 and order-2, then the simulated record M10, each with an epoch-millisecond timestamp from 26 November 2026. The second runs kcat five times, producing one record each time with acks=all, and prints real times of 0.48, 1.09, 0.99, 0.89 and 0.79 seconds. The third pipes 4000 records into one kcat producer in batches of 1000; kcat prints four lines saying the broker throttled the request for 5000 ms, and the run takes 3.84 seconds." />
  <figcaption>Real output, unedited. One record with <code>acks=all</code> takes 0.5 to 1.1 seconds; a burst over the produce quota gets a throttle time back.</figcaption>
</figure>

### Timings

The simulated cluster does not run at network speed. The bridge sends the tab a tick every 1200 ms, and the cluster advances one step per tick, so you can follow every record across the canvas. In our runs that gave:

| What | Measured |
| --- | --- |
| Metadata and other admin requests | answered at once, between ticks |
| One record, `acks=all`, to a 4-replica partition across two sites | 0.48 to 1.09 s, depending on when in the tick it arrives |
| Producer ack to consumer delivery | the same tick: the consumer's waiting fetch is answered as the high watermark moves |
| Leader failover after a whole data center dies | about 2.5 s, two ticks (below) |

Record timestamps are simulation time placed on your clock, so kcat, Kafbat and Control Center show today's date and time.

### Throttling

Every record stays in the playground for the session, so the bridge caps each app at 200 records a second. An app that has been quiet saves up to 3000 records and writes a backlog at once, at most 1000 records a tick. It works like a Kafka produce quota. A batch that is over the budget is not split: it goes in whole, and the answer carries a throttle time that tells the client how long to wait. The client's next batch waits until that debt is paid.

You can see it in the third run above. kcat piped 4000 records in batches of 1000. The 3000 the bucket had saved went out at once, a tick at a time, and the answers said `throttled request for 5000ms`: the 1000 records over the budget need five seconds at 200 a second. The last batch went in whole, as a debt, so the run took 3.8 seconds, and the client's next batch would wait for the debt.

## Kafbat UI

[Kafbat UI](https://github.com/kafbat/kafka-ui) works with no special settings. Point it at `127.0.0.1:19092` and it lists the brokers, the topics, the consumer groups and the KRaft quorum. It can create and delete topics, change topic configs, reset group offsets, produce messages and purge records.

<figure>
  <img src="/blog/kafka-simulator-v2-4-bridge-real-kafka-clients/kafbat_messages.webp" alt="Kafbat UI 1.5.1 showing the Messages tab of the orders topic. Offsets 3656 to 3669, all in partition 0, with timestamps on 24 November 2026 around 09:23. Most rows have keys order-0 to order-8 and JSON values from the kcat producer; offsets 3658 and 3669 are simulated records with key and value M721 and M722." />
  <figcaption>Kafbat UI reads the same partition as everyone else: the kcat orders and the simulated producer's M-records, interleaved in offset order.</figcaption>
</figure>

One thing looks odd at first: Kafbat 1.5.1 shows the cluster version as "Unknown". The bridge reports Kafka 4.4, and Kafbat's version table ends at 4.3. A real 4.4 cluster gets the same label.

## Confluent Control Center Next Gen

Control Center connects too, in its management mode (`CONTROL_CENTER_MODE_ENABLE=management`) with internal topics at replication factor 3. Its normal mode wants about 60 Kafka Streams topics, far more than free play lets a cluster hold. In management mode the topics, the message viewer, the topic settings and the consumer lag views all work.

<figure>
  <img src="/blog/kafka-simulator-v2-4-bridge-real-kafka-clients/c3_next_gen_consumer_lag.webp" alt="Confluent Control Center Next Gen, Clients, Consumer Lag tab. Three consumer groups, all Stable: _confluent-controlcenter-2-7-0-1-command with protocol Classic and lag 0, g1 with protocol Consumer and lag 1, and kcat-readers with protocol Classic and lag 3. Each has one consumer, one topic and one partition." />
  <figcaption>Control Center lists the simulated group <code>g1</code> as a KIP-848 Consumer-protocol group, right next to the real kcat group on the Classic protocol.</figcaption>
</figure>

Simulated groups are visible to admin tools as well. `g1` runs inside the simulator with the cooperative-sticky assignor, so it is described as a KIP-848 group, while kcat's `kcat-readers` uses the classic protocol. Real clients cannot join a simulated group, but tools can watch both.

## Kill a data center

This is the part a test container cannot give you. With the kcat producer writing about 8 orders a second with `acks=all` and the kcat group reading them, we pressed **kill dc-a** in the Failure tab. That takes down broker-1, which led `orders`, two more brokers and dc-a's KRaft voter.

<figure>
  <img src="/blog/kafka-simulator-v2-4-bridge-real-kafka-clients/playground_dc_a_lost.webp" alt="The playground 13 seconds after kill dc-a. In dc-a, broker-1, broker-2 and broker-3 are marked DOWN, killed 13.2 s ago, and the dc-a voter is DEAD. In dc-b, broker-4 is now the leader of orders partition 0 at epoch 3, and broker-5 and broker-6 are in sync; broker-6 was an observer before. The active controller is c-b, with the witness voter c-c in dc-c. The kcat-readers group shows a lag of 23 while it catches up. The Failure tab on the right shows the Destroy a data center buttons." />
  <figcaption>13 seconds after dc-a died: broker-4 in dc-b leads, the dc-b observer was promoted into the ISR, and the witness kept the controller quorum alive.</figcaption>
</figure>

Here is what kcat's debug log recorded, in wall-clock time from the click:

- **0.17 s**: the last batch acknowledged by broker-1, which was already in flight.
- **0.45 s**: the connection to broker-1 drops. librdkafka refreshes metadata and finds broker-4 in dc-b as the new leader.
- **2.48 s**: the first batch acknowledged by broker-4. From then on, one batch per tick, as before.

No delivery failed, and the consumer group saw every order once, with no gaps. The reason is the 2.5-DC design. dc-b alone has only two synchronous replicas, one short of `min.insync.replicas=3`. Its observer, broker-6, is promoted into the ISR, so writes keep going. The witness voter in dc-c gives dc-b's controller a majority, so the leader election can happen at all.

<figure>
  <img src="/blog/kafka-simulator-v2-4-bridge-real-kafka-clients/kafbat_brokers_dc_a_lost.webp" alt="Kafbat UI's Brokers page after the data center loss. Partitions: 2 of 2 online, 2 under-replicated partitions, 5 of 8 replicas in sync, 3 out of sync, controller type KRaft. Only brokers 4, 5 and 6 are listed; broker 4 leads 2 partitions." />
  <figcaption>The same moment in Kafbat UI: three brokers left, two under-replicated partitions, every partition still online.</figcaption>
</figure>

### And bring it back

Restart dc-a from the same tab and its brokers catch up, rejoin the ISR, and broker-1 takes the leadership back. The observer goes back to async. This is where our kcat consumer saw something the failover did not show: ten orders twice.

kcat's debug log explains it. A batch of ten was waiting for its `acks=all` on broker-4 when the leadership moved back to broker-1. The batch had already been written and copied to the other replicas, but the answer was `NOT_LEADER_OR_FOLLOWER`, so librdkafka sent it again to the new leader. kcat does not turn on idempotence by default, so nothing told the broker it was a retry, and the log got the ten records at two sets of offsets. A real cluster behaves the same way.

We ran it again with `-X enable.idempotence=true`: the same kill, the same restart, the same `NOT_LEADER_OR_FOLLOWER` and retry. This time the simulated leader recognized the retried batch by its producer id and sequence numbers, as a broker does, and the consumer read all 728 orders once each.

If you want the reasoning behind this layout, [the 2.5-DC scenario](/kafka-simulator/scenarios/stretched-2-5-dc/) and [observer promotion](/kafka-simulator/scenarios/observer-promotion/) walk through it, and the [multi-DC chapter of the Kafka guide](/kafka/multi-dc/) compares it with the other topologies.

## Transactions and the new consumer protocol

Real clients get the newer Kafka features too, not stand-ins. A producer with a `transactional.id` commits or aborts across partitions, a second producer with the same id fences the first, and `read_committed` consumers see only committed records. `kafka-transactions.sh` lists, describes and aborts transactions as it does against a broker.

Consumers with `group.protocol=consumer` get KIP-848 itself: the coordinator assigns the partitions, and members move to them through their heartbeats. A group can also switch between the classic and the consumer protocol while it has members, as on Kafka 4.4. Static members and regular-expression subscriptions work as well.

Some diskless setups refuse transactions or KIP-848, as their implementations do. [Supported APIs](/flock/docs/sim-bridge/reference/supported-apis/#transactions) has the details, and [Limits](/flock/docs/sim-bridge/concepts/limits/) lists which setup refuses what.

## Kafka Streams

A stock Kafka Streams app runs against free play too. Its internal topics keep the names Streams generates, and `processing.guarantee=exactly_once_v2` works with Streams' own 10 second transaction timeout: an instance that takes over writes its backlog inside its transactions, because the produce quota lets an app write up to 3000 saved-up records at once.

We ran Kafka's own `WordCountDemo` from Kafka Streams 4.3.1 that way, with a repartition topic and a changelog-backed store, and killed the leader of an output partition, then the app itself. The new instance restored its state from the changelog, and a `read_committed` reader of the output saw each word's count run 1, 2, 3 and on, none repeated or skipped, as on a real Kafka cluster with the same kills. It needs a setup that takes transactions from real clients: the KIP-1163 draft and Inkless refuse their diskless topics in a transaction, Kafka Streams' first transactional write included, and Nisshi and KafScale take none. Topologies beyond the word count, and the `streams` group protocol of KIP-1071, are not covered yet.

## Tested against Apache Kafka

A simulator is only useful if it behaves like the real thing, so we checked it against Apache Kafka. We took the tools Kafka's own system tests use (`VerifiableProducer`, `VerifiableConsumer` and `TransactionalMessageCopier` from Apache Kafka 4.3.1), unmodified, and ran 13 scenarios twice: against the simulator, and against a real three-broker Apache Kafka 4.3.1 cluster, with the same faults and the same checks. The scenarios kill leaders, group coordinators, group members and transaction coordinators, move a group between the two consumer protocols, and run an exactly-once copy and Kafka Streams' word count.

**Every check passed on both.** No acknowledged record was lost or written twice, offsets had no gaps, each key kept its order, no partition had two owners, and the exactly-once output was read exactly once. The same checks also pass on the simulator's other setups and with franz-go and librdkafka clients. Running them there found bugs, which we fixed before this release.

What differs is the clock: the simulator elects a new leader about a second after a hard kill, where Kafka waits 9 seconds, and it answers once per 1200 ms tick, where Kafka takes milliseconds. [Tested against Apache Kafka](/flock/docs/sim-bridge/concepts/tested-against-kafka/) has every scenario, check and timing.

## kaf-mirror 2.0

Scalytics released kaf-mirror 2.0.0 on 27 November, and the simulator and the [kaf-mirror guide page](/kafka/multi-dc/mirroring-without-offset-translation/) follow it. A copied record now keeps its source partition and its source timestamp. The simulator already copied partition N to partition N. The timestamp changes the advice after a failover: offsets still do not carry over, but a reset by time with `--to-datetime` lands near the group's old position on the copy, a few records early. A record the target keeps rejecting is no longer passed over: kaf-mirror tries it 5 times and then stops the job at that record. A job also follows a source topic that is deleted and created again, by its Kafka topic ID.

2.0 is also pitched as a backup tool, and its docs are clear that a replica is not one: a copy that follows the source follows its deletes and bad writes too. For a backup, mirror into a target your producers cannot write to, on its own credentials, such as KafScale on S3.

## KafScale 2.1

KafScale released 2.1.0 on 26 November, and the [KafScale guide page](/kafka/diskless/kafscale/) and the diskless comparison now describe it, with every source link at the v2.1.0 tag. The headline change is the idempotent producer, still without transactions: a Kafka client can keep its default `enable.idempotence=true` with `acks=all`, and a retry after an uncertain write gets its original offsets back instead of a second copy. The simulator follows it: a producer you add to a KafScale cluster is idempotent by default, and its retry of a record already in S3 gets that offset back. The KafScale scenarios turn idempotence off, so they still show the copy a plain retry adds.

## What it does not do

The simulator is a cluster you watch, not a test broker, and the bridge refuses what it cannot do faithfully:

- Transactions and the KIP-848 consumer protocol on the diskless setups whose implementations do not offer them.
- Plaintext on `127.0.0.1` only: no TLS, no SASL, no clients on another machine. A tool in Docker needs a container that forwards its `127.0.0.1` ports to the host.
- Chrome, Edge and Firefox. Safari blocks a local WebSocket from an https page.
- Free play in the full playground only, not scripted scenarios or embeds.

[Limits](/flock/docs/sim-bridge/concepts/limits/) has the full list, and [supported APIs](/flock/docs/sim-bridge/reference/supported-apis/) has every request the bridge answers.

## Try it

[Install monedula-sim-bridge](/flock/docs/sim-bridge/), open [free play](/kafka-simulator/playground/), and connect whatever you already use. Then kill the broker that leads your topic and read what your client logs. If a client or a tool does not work, tell us on the [issue tracker](https://github.com/monedula-dev/monedula-sim-bridge/issues).