diff --git a/src/modules/services/kafka-connect.nix b/src/modules/services/kafka-connect.nix index 000c0800e..f18af9a10 100644 --- a/src/modules/services/kafka-connect.nix +++ b/src/modules/services/kafka-connect.nix @@ -188,6 +188,12 @@ in port = "8083"; }; }; + + depends_on = { + kafka = { + condition = "process_healthy"; + }; + }; }; }; diff --git a/src/modules/services/kafka.nix b/src/modules/services/kafka.nix index 250e8b061..c33868aae 100644 --- a/src/modules/services/kafka.nix +++ b/src/modules/services/kafka.nix @@ -225,22 +225,16 @@ in processes.kafka = { exec = "${startKafka}/bin/start-kafka"; - # process-compose = { - # readiness_probe = { - # # exec.command = "${pkgs.curl}/bin/curl -f -k http://localhost:9092/topics"; - # http_get = { - # host = "localhost"; - # scheme = "http"; - # path = "/topics"; - # port = 9092; - # }; - # initial_delay_seconds = 5; - # period_seconds = 10; - # timeout_seconds = 5; - # success_threshold = 1; - # failure_threshold = 3; - # }; - # }; + process-compose = { + readiness_probe = { + exec.command = "${cfg.package}/bin/kafka-topics.sh --list --bootstrap-server localhost:9092"; + initial_delay_seconds = 5; + period_seconds = 10; + timeout_seconds = 5; + success_threshold = 1; + failure_threshold = 3; + }; + }; }; }) ];