colab-chat / colab-server

GNU General Public License v3.0
4 stars 1 forks source link

Add a healthcheck to the kafka docker service #19

Closed matthew-d-jones closed 7 years ago

matthew-d-jones commented 7 years ago

In docker-compose healthchecks can be added so that dependent services are not started up until the service is ready. This would be much better than the current method of waiting 15 seconds in boot.sh.

healthcheck:
        test: ["CMD", "curl", "-f", "http://localhost:15672"]
        interval: 30s
        timeout: 10s
        retries: 5

For Kafka a good healthcheck would be to query metadata with kafkacat -b mybroker -L. Can we add kafkacat to the kafka docker image?

A kafkacat docker-compose service config (in case it is useful):

kafkacat:
  image: ryane/kafkacat
  entrypoint:
    - kafkacat
    - -b kafka.local
  links:
- kafka:kafka.local