Skip to content

Commit

Permalink
Use docker compose exec to create additional kafka topics
Browse files Browse the repository at this point in the history
fixes #2903
fixes #2754
  • Loading branch information
saz committed Mar 19, 2024
1 parent 437bddd commit 88fc89b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions install/create-kafka-topics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ echo "${_group}Creating additional Kafka topics ..."

# NOTE: This step relies on `kafka` being available from the previous `snuba-api bootstrap` step
# XXX(BYK): We cannot use auto.create.topics as Confluence and Apache hates it now (and makes it very hard to enable)
EXISTING_KAFKA_TOPICS=$($dcr -T kafka kafka-topics --list --bootstrap-server kafka:9092 2>/dev/null)
EXISTING_KAFKA_TOPICS=$($dc exec -T kafka kafka-topics --list --bootstrap-server kafka:9092 2>/dev/null)
NEEDED_KAFKA_TOPICS="ingest-attachments ingest-transactions ingest-events ingest-replay-recordings profiles ingest-occurrences ingest-metrics ingest-performance-metrics ingest-monitors"
for topic in $NEEDED_KAFKA_TOPICS; do
if ! echo "$EXISTING_KAFKA_TOPICS" | grep -qE "(^| )$topic( |$)"; then
$dcr kafka kafka-topics --create --topic $topic --bootstrap-server kafka:9092
$dc exec kafka kafka-topics --create --topic $topic --bootstrap-server kafka:9092
echo ""
fi
done
Expand Down

0 comments on commit 88fc89b

Please sign in to comment.