Skip to content

Commit 9e36f16

Browse files
committed
chore: add demo gif
1 parent 7c2edb8 commit 9e36f16

6 files changed

Lines changed: 62 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[![CI](https://github.com/cymo-eu/kannika-bridge/actions/workflows/ci.yml/badge.svg)](https://github.com/cymo-eu/kannika-bridge/actions/workflows/ci.yml)
44

5+
![Demo](examples/demo.gif)
6+
57
> ✉️ 🚀 Restore consumer offsets on kafka cluster.
68
79
A powerful tool for migrating Kafka consumer group offsets between clusters, enabling seamless cluster migrations and disaster recovery scenarios.

examples/demo.gif

289 KB
Loading

examples/demo.tape

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# VHS tape file for kbridge demo
2+
# Run with: ./scripts/generate-demo.sh
3+
# Requires local-dev setup (docker compose)
4+
5+
Output examples/demo.gif
6+
7+
Set FontSize 14
8+
Set Width 1000
9+
Set Height 600
10+
Set LineHeight 1.4
11+
Set Theme "Catppuccin Mocha"
12+
Set WindowBar Colorful
13+
14+
Type "kbridge fetch -b localhost:9092 -p group.id=kbridge > source_offsets.csv"
15+
Enter
16+
Wait@60s
17+
18+
Type "cat source_offsets.csv"
19+
Enter
20+
Sleep 3s
21+
22+
Type "kbridge calculate -b localhost:9093 -H Offset -i source_offsets.csv -p group.id=kbridge > target_offsets.csv"
23+
Enter
24+
Hide
25+
Wait@60s
26+
Show
27+
28+
Type "kbridge apply -b localhost:9093 -i target_offsets.csv -p group.id=kbridge"
29+
Enter
30+
Sleep 2s
31+
32+
Type "Y"
33+
Enter
34+
Wait@30s
35+
Sleep 5s

justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ run-example:
3535
run-docs:
3636
cargo doc --no-deps && \
3737
docker compose -f docker-compose-docs.yml up --build
38+
39+
generate-demo:
40+
./scripts/generate-demo.sh

scripts/generate-demo.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
cd "$(dirname "$0")/.."
5+
6+
if ! command -v vhs &> /dev/null; then
7+
echo "Error: vhs not found. Please install: https://github.com/charmbracelet/vhs"
8+
exit 1
9+
fi
10+
11+
# Build and add to PATH so vhs can find kbridge
12+
cargo build --release
13+
export PATH="$PWD/target/release:$PATH"
14+
15+
# Make sure everything is gone
16+
just teardown
17+
18+
just setup-local-dev
19+
20+
vhs examples/demo.tape
21+
echo "Generated examples/demo.gif"

scripts/simulate_order_restore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ kafka-console-consumer \
3333
--topic $TOPIC \
3434
--max-messages $NUM_MESSAGES \
3535
--from-beginning \
36-
| sed 's/^\([0-9]*\)\s/Offset:\1|/' | sed 's/\s/|/g' \
36+
| awk -F'[:\t]' -v OFS='|' '{print "Offset:"$2*2, $3, $4}' \
3737
> "$PIPE_FILE"
3838

3939
wait $PRODUCER_ID

0 commit comments

Comments
 (0)