diff --git a/src/modules/services/kafka-connect.nix b/src/modules/services/kafka-connect.nix index 6ea1e4b48..000c0800e 100644 --- a/src/modules/services/kafka-connect.nix +++ b/src/modules/services/kafka-connect.nix @@ -98,6 +98,7 @@ in "plugin.path" = lib.mkOption { type = types.nullOr (types.listOf (types.either types.str types.path)); + default = null; description = '' The list should consist of top level directories that include any combination of: a) directories immediately containing jars with plugins and their dependencies @@ -176,6 +177,19 @@ in ''; in (lib.mkIf cfg.enable (lib.mkIf kafkaCfg.enable { - processes.kafka-connect.exec = "${startKafkaConnect}/bin/start-kafka-connect"; + processes.kafka-connect = { + exec = "${startKafkaConnect}/bin/start-kafka-connect"; + + process-compose = { + readiness_probe = { + initial_delay_seconds = 2; + http_get = { + path = "/connectors"; + port = "8083"; + }; + }; + }; + }; + })); } diff --git a/tests/kafka-connect/.test.sh b/tests/kafka-connect/.test.sh new file mode 100755 index 000000000..e9690a205 --- /dev/null +++ b/tests/kafka-connect/.test.sh @@ -0,0 +1,3 @@ +set -e + +curl http://localhost:8083/connectors -H "Content-Type: application/json" diff --git a/tests/kafka-connect/devenv.nix b/tests/kafka-connect/devenv.nix new file mode 100644 index 000000000..8017851e0 --- /dev/null +++ b/tests/kafka-connect/devenv.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + services.kafka = { + enable = true; + connect = { + enable = true; + }; + }; +}