-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
devenv up & | ||
DEVENV_PID=$! | ||
export DEVENV_PID | ||
|
||
function stop() { | ||
pkill -P "$DEVENV_PID" | ||
} | ||
|
||
trap stop EXIT | ||
|
||
timeout 60 bash -c 'until echo > /dev/tcp/localhost/9325; do sleep 0.5; done' | ||
|
||
QUEUE_NAME=$(curl http://localhost:9325/statistics/queues -s | jq .[].name -r) | ||
|
||
if [[ "$QUEUE_NAME" != "test-queue" ]]; then | ||
echo "The queue is not created" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ pkgs, ... }: | ||
|
||
{ | ||
services.elasticmq.enable = true; | ||
services.elasticmq.settings = '' | ||
queues { | ||
test-queue {} | ||
} | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
inputs: | ||
nixpkgs: | ||
url: github:NixOS/nixpkgs/nixpkgs-unstable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ pkgs, lib, config, ... }: | ||
|
||
let | ||
cfg = config.services.elasticmq; | ||
types = lib.types; | ||
in | ||
{ | ||
options.services.elasticmq = { | ||
enable = lib.mkEnableOption "elasticmq-server"; | ||
|
||
package = lib.mkOption { | ||
type = types.package; | ||
description = "Which package of elasticmq-server-bin to use"; | ||
default = pkgs.elasticmq-server-bin; | ||
defaultText = lib.literalExpression "pkgs.elasticmq-server-bin"; | ||
}; | ||
|
||
settings = lib.mkOption { | ||
type = types.lines; | ||
default = ""; | ||
description = "Configuration for elasticmq-server"; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
processes.elasticmq-server.exec = "JAVA_TOOL_OPTIONS=\"-Dconfig.file=${pkgs.writeText "elasticmq-server.conf" cfg.settings}\" ${cfg.package}/bin/elasticmq-server"; | ||
}; | ||
} |