# Kafka 4.3.x in KRaft mode. # # Single broker on purpose: this compose file exists to reproduce the platform's Stable profile # locally, not to model a production cluster. The settings below are the ones the profile guard # enforces, so a local run fails the same way a misconfigured deployment would. services: kafka: image: apache/kafka:4.3.0 container_name: messaging-kafka ports: - "9092:9092" environment: KAFKA_NODE_ID: 1 KAFKA_PROCESS_ROLES: broker,controller KAFKA_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093 KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER KAFKA_CONTROLLER_QUORUM_VOTERS: 1@localhost:9093 KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT # acks=all is only a durability guarantee when more than one replica must acknowledge. # With a single broker the platform still requires acks=all; min.insync.replicas is 1 here # and is expected to be 2 in any environment that claims replication evidence. KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 KAFKA_MIN_INSYNC_REPLICAS: 1 # Topology is created by infrastructure, never by the application. KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false" healthcheck: test: ["CMD-SHELL", "/opt/kafka/bin/kafka-broker-api-versions.sh --bootstrap-server localhost:9092 >/dev/null 2>&1"] interval: 5s timeout: 10s retries: 20