79480251

Date: 2025-03-03 05:48:42
Score: 3
Natty:
Report link

I’m leaving the solution here for anyone who encounters the same issue!

Separate External and Internal Exposed Addresses for Kafka

kafka/server.properties

listeners=INTERNAL://0.0.0.0:9092,EXTERNAL://0.0.0.0:9093
advertised.listeners=INTERNAL://kafka:9092,EXTERNAL://localhost:9093
listener.security.protocol.map=INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT

docker-compose.yml

service:
  kafka:
    build:
      context: ./kafka
      dockerfile: Dockerfile
    image: simple-sns-kafka:latest
    container_name: 'simple-sns-kafka'
    ports:
      - '9092:9092'
      - '9093:9093' # added code
      - '8083:8083' # Kafka Connect REST API Port

Change Spring Configuration to Use External Address

  kafka:
    consumer:
      bootstrap-servers: localhost:9093
    producer:
      bootstrap-servers: localhost:9093

This is my first time using Stack Overflow. If there’s any better way for me to express my gratitude, please let me know!!

Reasons:
  • RegEx Blacklisted phrase (2.5): please let me know
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: snorlax