Skip to content

Commit

Permalink
feat(kafka-connect): Added readiness check and test
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexnortung committed Nov 15, 2024
1 parent d80734e commit bc867b7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/modules/services/kafka-connect.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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";
};
};
};
};

}));
}
3 changes: 3 additions & 0 deletions tests/kafka-connect/.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set -e

curl http://localhost:8083/connectors -H "Content-Type: application/json"
10 changes: 10 additions & 0 deletions tests/kafka-connect/devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ pkgs, ... }:

{
services.kafka = {
enable = true;
connect = {
enable = true;
};
};
}

0 comments on commit bc867b7

Please sign in to comment.