-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-demo-customers
executable file
·38 lines (30 loc) · 993 Bytes
/
setup-demo-customers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
export ZOOKEEPER=localhost:2181
export KAFKA_BROKER=localhost:9092
export DATAGEN_ITERATIONS=100
export MAX_INTERVAL=5000
export PID_FILE=pid_file.txt
function message() {
echo
echo "*** ${1}"
}
function create_topic() {
TOPIC=${1}
PARTITIONS=${2:-1}
message "Creating topic ${TOPIC} with ${PARTITIONS} partitions"
kafka-topics --zookeeper ${ZOOKEEPER} --create --partitions ${PARTITIONS} --replication-factor 1 --topic ${TOPIC}
}
rm -f ${PID_FILE}
if [[ ! -z "$1" && $1 == 'ksql' ]]; then
message "Running all KSQL setup scripts"
ksql << EOF
run script './querys/ksql/setup-rosetta-01.ksql';
exit
EOF
else
message "Starting debezium connector for topics ROSETTA"
nohup confluent local config rosetta-connector -- -d ./connectors/dbz-rosetta.json > /dev/null 2>&1 &
echo ${!} >> ${PID_FILE}
#confluent local consume dbserver1.rosetta.customers -- --from-beginning
message "Background rosetta-connector running"
fi