Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Has anyone been able to start a topic using Docker Compose? #75

Open
andrewterra opened this issue Aug 7, 2017 · 6 comments
Open

Has anyone been able to start a topic using Docker Compose? #75

andrewterra opened this issue Aug 7, 2017 · 6 comments

Comments

@andrewterra
Copy link

I attempted to put

kafka:
    image: spotify/kafka
    ports:
      - "9092:9092"
      - "2181:2181"
    hostname: kafka
    expose:
      - "9092"
      - "2181"
    environment:
      TOPICS: test-topic

But this failed to work, is there something that I'm missing? (I tried with quotes around the topic as well)

Also, if anyone has had any luck using Spring to connect to a topic, I would greatly appreciate some help connecting to the topics.

@pugna0
Copy link

pugna0 commented Sep 18, 2017

TOPICS env is for spotify/kafkaproxy image.

@shankarshastri
Copy link

kafka:
  image: spotify/kafka
  ports:
  - "2181:2181"
  - "9092:9092"
  hostname: kafka
  container_name: kafka
  environment:
  - "ADVERTISED_HOST=kafka"
  - "ADVERTISED_PORT=9092"
  - "AUTO_CREATE_TOPICS=true"
  command: >
      bash -c
      "(sleep 15s &&
      /opt/kafka_2.11-0.10.1.0/bin/kafka-topics.sh
      --create
      --zookeeper
      localhost:2181 --replication-factor 1 --partitions 1
      --topic dummy_topic &) && (supervisord -n)"

@terrabl, you can do it like this.

@Dusanlex
Copy link

Hi there, I have a question.
How can I create producer and consumer in "command" section like this topic was created?

@pravinsakthivel
Copy link

Hi there, I have a question.
How can I create producer and consumer in "command" section like this topic was created?
Refer below link:
https://gist.github.com/abacaphiliac/f0553548f9c577214d16290c2e751071

@jmayday
Copy link

jmayday commented Jul 5, 2019

AUTO_CREATE_TOPICS

Is this variable really needed? I've managed to get my topic created even without this variable. Could you please explain reason why we need it?

@pavanarya
Copy link

I did a NuGet package update and that solved my issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants