Skip to content

Instantly share code, notes, and snippets.

@rmoff
Last active May 22, 2019 11:30
Show Gist options
  • Select an option

  • Save rmoff/da2e882a49a55740b242df893e48734f to your computer and use it in GitHub Desktop.

Select an option

Save rmoff/da2e882a49a55740b242df893e48734f to your computer and use it in GitHub Desktop.
Example Docker Compose showing Apache Kafka listener configuration
[…]
kafka0:
image: "confluentinc/cp-enterprise-kafka:5.2.1"
ports:
- '9092:9092'
- '29094:29094'
depends_on:
- zookeeper
environment:
[…]
# For more details see See https://rmoff.net/2018/08/02/kafka-listeners-explained/
KAFKA_LISTENERS: LISTENER_BOB://kafka0:29092,LISTENER_FRED://kafka0:9092,LISTENER_ALICE://kafka0:29094
KAFKA_ADVERTISED_LISTENERS: LISTENER_BOB://kafka0:29092,LISTENER_FRED://localhost:9092,LISTENER_ALICE://never-gonna-give-you-up:29094
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_BOB:PLAINTEXT,LISTENER_FRED:PLAINTEXT,LISTENER_ALICE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_BOB
[…]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment