---
title: "Connect your first app"
description: "Run monedula-sim-bridge, pair it with a Kafka Simulator free-play session, then produce and consume with the Kafka console tools and watch the canvas."
url: https://monedula.dev/flock/docs/sim-bridge/tutorials/connect-your-first-app/
---
In this tutorial you run the bridge, pair it with the playground, send records with the Kafka console producer, read them back with the console consumer, and watch both apps on the canvas.

## What you need

- `monedula-sim-bridge` on your `PATH`. The [install section](/flock/docs/sim-bridge/#install) shows how.
- The console tools of an Apache Kafka 4.x download, unpacked on the same computer, and the Java they need (17 or newer). The commands below run from that folder.
- Chrome, Edge or Firefox.

<Callout type="note" title="The tools run on your computer, not in a container">

The bridge listens on `127.0.0.1` only, and the addresses it gives clients are `127.0.0.1` addresses. A client in a Docker container on Docker Desktop cannot reach them; run the tools directly on your computer.

</Callout>

## 1. Start the bridge

```bash
monedula-sim-bridge
```

It prints its version, a pairing code and the WebSocket address, and waits. The code is new on every start:

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



Leave it running in this terminal.

## 2. Pair the playground

1. Open a [free-play session](/kafka-simulator/playground/?scenario=free) of the playground.
2. Press **Connect your apps** in the top bar. The panel walks three steps: start the bridge, enter the code it prints, point a client at it. Opening it connects nothing.
3. Type the code from step 1 (or paste the whole line it is on) and press **Connect**. Your browser may ask whether the page may reach devices on your local network; allow it.

The panel stays open: its third step shows the address to point a client at, `127.0.0.1:19092`, and says no apps are connected yet. Press **Done**; the top bar now shows a status pill, **Bridge on, 0 apps**. Press the pill to open the panel again.

If the panel reports that no bridge answered, check that step 1 is still running. If it says the bridge refused the code, type it again from the bridge's terminal.

## 3. Produce

In a second terminal, start the console producer against the bridge. Free play already has a topic named `orders`:

```bash
bin/kafka-console-producer.sh --bootstrap-server 127.0.0.1:19092 --topic orders
```

Type a few lines, each followed by Enter:

```text
>hello
>from
>my laptop
```

On the canvas a new producer card appears with an **app** badge: that is your console producer, next to the simulated ones. The records go to the partitions of `orders` like any other, and the status pill now counts one app. Its panel lists the client id `console-producer`, the client software, the role `producer`, and how many records a second it sends against the limit. An app sending faster than the limit is marked throttled, in the panel and on the pill.

## 4. Consume

In a third terminal, read the topic as the consumer group `tutorial`:

```bash
bin/kafka-console-consumer.sh --bootstrap-server 127.0.0.1:19092 \
  --topic orders --group tutorial --from-beginning
```

Your lines come back. Records of the simulated producers can come between them: a simulated record has no real value, so the playground serves its key as the value, such as `M17`. The canvas gains a consumer lane for the group `tutorial`, with the **app** badge.

Type more lines in the producer terminal and watch them travel across the canvas to the consumer.

## 5. Pause and stop

Press **Pause** in the playground. The simulated cluster stops, and the playground warns that connected apps will time out until you press Play: the clients keep retrying, then carry on when you press **Play** again.

When you are done, stop the producer and the consumer with Ctrl-C, press the status pill, then **Disconnect**, and stop the bridge with Ctrl-C. Disconnecting removes the apps from the canvas.

## Next

- [Watch a client fail over](/flock/docs/sim-bridge/how-to/watch-a-client-fail-over/) when you kill a broker.
- [Use the Java client](/flock/docs/sim-bridge/how-to/use-the-java-client/) from your own program.
- [How it works](/flock/docs/sim-bridge/concepts/how-it-works/), for what happened between the terminal and the canvas.