-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Maciej Mensfeld <[email protected]>
- Loading branch information
Showing
16 changed files
with
118 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# Waits for Kafka to be ready | ||
# Useful in CI where Kafka needs to be fully started before we run any tests | ||
|
||
require 'karafka' | ||
|
||
Karafka::App.setup do |config| | ||
config.kafka[:'bootstrap.servers'] = '127.0.0.1:9092' | ||
end | ||
|
||
60.times do | ||
begin | ||
# Stop if we can connect to the cluster and get info | ||
exit if Karafka::Admin.cluster_info | ||
rescue Rdkafka::RdkafkaError | ||
puts "Kafka not available, retrying..." | ||
sleep(1) | ||
end | ||
end | ||
|
||
puts 'Kafka not available!' | ||
|
||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
version: '2' | ||
services: | ||
zookeeper: | ||
container_name: karafka_web_21_zookeeper | ||
image: wurstmeister/zookeeper | ||
restart: on-failure | ||
ports: | ||
- '2181:2181' | ||
|
||
services: | ||
kafka: | ||
container_name: karafka_web_21_kafka | ||
image: wurstmeister/kafka | ||
container_name: kafka | ||
image: confluentinc/cp-kafka:7.5.0 | ||
|
||
ports: | ||
- '9092:9092' | ||
- 9092:9092 | ||
|
||
environment: | ||
KAFKA_ADVERTISED_HOST_NAME: localhost | ||
KAFKA_ADVERTISED_PORT: 9092 | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | ||
CLUSTER_ID: kafka-docker-cluster-1 | ||
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
KAFKA_PROCESS_ROLES: broker,controller | ||
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER | ||
KAFKA_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT | ||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092 | ||
KAFKA_BROKER_ID: 1 | ||
KAFKA_CONTROLLER_QUORUM_VOTERS: [email protected]:9093 | ||
ALLOW_PLAINTEXT_LISTENER: 'yes' | ||
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true' | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
restart: on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters