# thanks:
#  https://www.linkedin.com/pulse/local-kafka-setup-using-docker-sandeep-khurana/
#  https://towardsdatascience.com/kafka-python-explained-in-10-lines-of-code-800e3e07dad1

# 
# start kafka (uses this file)
#   docker compose -f integration/kafka/dockercompose_start_kafka.yml up
#
# in docker terminal, create a topic, list topics, monitor order_shipping
#   kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 3  --topic order_shipping
#   kafka-topics.sh --bootstrap-server localhost:9092 --list
#   kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic order_shipping --from-beginning
#
# start als, and run the sample trans (see integration_services_readme.md -- test it)
#

version: "3"

services:

  kafka:
    restart: always
    image: docker.io/bitnami/kafka:latest
    volumes:
      - ./.volumes/kafka/data:/integration/kafka/volume
    ports:
      - 9092:9092
      - 9093:9093
    container_name: broker1
    environment:
      KAFKA_ENABLE_KRAFT: yes
      KAFKA_CFG_NODE_ID: 1
      KAFKA_CFG_PROCESS_ROLES: 'broker,controller'
      KAFKA_CFG_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
      KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
      KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
      KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
      KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://broker1:9092
      KAFKA_CFG_BROKER_ID: 1
      KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: '1@broker1:9093'
      ALLOW_PLAINTEXT_LISTENER: yes
      KAFKA_KRAFT_CLUSTER_ID: r4zt_wrqTRuT7W2NJsB_GA