-
Notifications
You must be signed in to change notification settings - Fork 71
Description
Describe the bug
Running a basic docker compose file with kafka and zilla clogs up CPU with "invalid number of brokers" message. Consumes every available cycle.
To Reproduce
Copy mqtt.kafka.broker from zilla-examples.
Replace ./docker/compose/docker-compose.yaml with the following file and run docker compose up in the directory.
version: '3'
services:
zookeeper:
image: wurstmeister/zookeeper
container_name: zookeeper
ports:
- "2181:2181"
networks:
- default
kafka:
image: confluentinc/cp-kafka:7.1.3
container_name: kafka
depends_on:
- zookeeper
ports:
- "9093:9093"
environment:
KAFKA_ADVERTISED_LISTENERS: BROKER://kafka:9092,OUTSIDE://localhost:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_LISTENERS: BROKER://0.0.0.0:9092,OUTSIDE://0.0.0.0:9093
KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CREATE_TOPICS: "poopootopic:1:1"
KAFKA_BROKER_ID: '1'
networks:
- default
zilla:
image: ghcr.io/aklivity/zilla
container_name: zilla
pull_policy: always
restart: unless-stopped
depends_on:
kafka-init:
condition: service_completed_successfully
ports:
- 7114:7114
- 7143:7143
- 7183:7183
- 7883:7883
environment:
KEYSTORE_PASSWORD: generated
KAFKA_HOST: kafka
KAFKA_PORT: 9092
volumes:
- ../../zilla.yaml:/etc/zilla/zilla.yaml
- ../../tls:/etc/zilla/tls
command: start -v -e
kafka-init:
image: bitnami/kafka:3.2
command:
- "/bin/bash"
- "-c"
- |
/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server kafka:9092 --create --if-not-exists --topic mqtt-messages
/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server kafka:9092 --create --if-not-exists --topic mqtt-sessions --config cleanup.policy=compact
/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server kafka:9092 --create --if-not-exists --topic mqtt-retained --config cleanup.policy=compact
depends_on:
- kafka
init: true
networks:
default:
driver: bridge
Running on Windows 10,
Expected behavior
I expect to run this docker compose stack and have Kafka available on port 9093 and zilla's mqtt functionality available on port 7183.
Desktop (please complete the following information):
- OS: Windows 10
- Docker Compose V2, Docker Desktop v4.26.1
Additional context
Temporary solution seems to be running a stack with at least 3 brokers. Will try this with a kraft stack later.
If this problem is unique to zilla, it'd be nice to have a timeout on these requests so my CPU doesn't get bogged down.

