Skip to content

Commit

Permalink
use rpk to create or ingest
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed May 6, 2024
1 parent ddf245c commit 94fdcdd
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions backwards-compat-tests/scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ RECOVERY_DURATION=20

# Setup test directory
TEST_DIR=.risingwave/backwards-compat-tests/
KAFKA_PATH=.risingwave/bin/kafka
mkdir -p $TEST_DIR
cp -r backwards-compat-tests/slt/* $TEST_DIR

Expand Down Expand Up @@ -79,18 +78,16 @@ check_version() {
}

create_kafka_topic() {
"$KAFKA_PATH"/bin/kafka-topics.sh \
--create \
--topic backwards_compat_test_kafka_source --bootstrap-server kafka:9093
RPK_BROKERS=kafka:9093 \
rpk topic create backwards_compat_test_kafka_source
}

insert_json_kafka() {
local JSON=$1
echo "$JSON" | "$KAFKA_PATH"/bin/kafka-console-producer.sh \
--topic backwards_compat_test_kafka_source \
--bootstrap-server kafka:9093 \
--property "parse.key=true" \
--property "key.separator=,"

echo "$JSON" | \
RPK_BROKERS=kafka:9093 \
rpk topic produce backwards_compat_test_kafka_source -f "%k,%v"
}

seed_json_kafka() {
Expand Down

0 comments on commit 94fdcdd

Please sign in to comment.