Command-line flags
The flags of monedula-sim-bridge, its start-up output and its exit codes.
On this page
monedula-sim-bridge [--ws-port N] [--base-port N] [--tick-ms N] [--version]
The bridge has no subcommands. Run it and it serves until you stop it with Ctrl-C; a second Ctrl-C ends a slow shutdown at once.
Flags
| Flag | Default | Meaning |
|---|---|---|
--ws-port |
19190 |
The port of the WebSocket the playground tab connects to, on 127.0.0.1. |
--base-port |
19092 |
The first Kafka port, on 127.0.0.1. Broker N listens on base-port + N - 1: broker 1 on 19092, broker 2 on 19093. |
--tick-ms |
1200 |
The tick interval in milliseconds, 50 to 1200: the simulated time one tick stands for. A shorter tick answers requests sooner; it is a test setting, so leave it at 1200 with the playground. |
--version |
Print the version and exit. |
Every port must be between 1 and 65535. A flag can also be written with one dash, such as -ws-port, as in every Go program that uses the standard flag package.
The playground always connects to ws://127.0.0.1:19190/ and has no setting for another address, so leave --ws-port at its default. --base-port is free to change: the bridge tells the playground, and the playground gives clients the ports in its metadata answers.
Output
On start the bridge prints three lines to standard output:
monedula-sim-bridge 1.0.1
Pairing code: K7Q2MZ
WebSocket: ws://127.0.0.1:19190/
The pairing code is six characters from ABCDEFGHJKMNPQRSTUVWXYZ23456789, with no 0, 1, I, L or O to misread, and new on every start. Log lines, such as a produce request refused for its size, go to standard error.
The Kafka ports open only after a tab has paired, one for each live broker of the playground’s cluster.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Stopped with Ctrl-C or SIGTERM, or --version. |
| 1 | The WebSocket port could not be opened, for example because it is in use, or the server failed. |
| 2 | A port flag is outside 1 to 65535, --tick-ms is outside 50 to 1200, or a flag is not recognized. |