Skip to content

Commit

Permalink
Update to kcat
Browse files Browse the repository at this point in the history
  • Loading branch information
ldechoux committed Mar 29, 2024
1 parent 91b4eec commit 4ac7726
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG GOLANG_VERSION
FROM golang:$GOLANG_VERSION-alpine

RUN echo $GOLANG_VERSION
RUN apk update && apk add --no-cache git bash make gcc libc-dev librdkafka-dev pkgconf openssh netcat-openbsd curl kafkacat
RUN apk update && apk add --no-cache git bash make gcc libc-dev librdkafka-dev pkgconf openssh netcat-openbsd curl kcat
RUN go install golang.org/x/lint/golint@latest
RUN mkdir -p /transformer/tests

Expand Down
8 changes: 5 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ services:
dockerfile: Dockerfile.test
command: ["bash", "./scripts/run_tests.sh"]
environment:
- KAFKA_BOOTSTRAP_SERVER=kafka:29092
- KAFKA_BOOTSTRAP_SERVER=broker:29092
depends_on:
- kafka

zookeeper:
image: confluentinc/cp-zookeeper
hostname: zookeeper
ports:
- 2181:2181
environment:
Expand All @@ -20,6 +21,7 @@ services:

kafka:
image: confluentinc/cp-kafka
hostname: broker
depends_on:
- zookeeper
ports:
Expand All @@ -30,7 +32,7 @@ services:
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
2 changes: 2 additions & 0 deletions examples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:

zookeeper:
image: confluentinc/cp-zookeeper
hostname: zookeeper
ports:
- 2181:2181
environment:
Expand All @@ -16,6 +17,7 @@ services:

kafka:
image: confluentinc/cp-kafka
hostname: kafka
depends_on:
- zookeeper
ports:
Expand Down
5 changes: 2 additions & 3 deletions scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ function wait_for_kafka(){
for i in {1..20}
do
echo "Waiting for kafka cluster $1 to be ready ..."
# kafkacat has 5s timeout
# kafkacat -b "${server}" -L > /dev/null 2>&1 && break
kafkacat -b "${server}" -L && break
# kcat has 5s timeout
kcat -b "${server}" -L > /dev/null 2>&1 && break
done
}

Expand Down

0 comments on commit 4ac7726

Please sign in to comment.