Bring the application, own tests, Dockerfile, toolchain, compose stack,
HAProxy, k6, RustFS and RabbitMQ configuration, migrations, hooks,
scenario scripts and the CI job from the lab 5 solution commit 64d5c67,
keep the lab 5 Makefile targets on top of the unchanged skeleton
targets, and append the lab 5 solution variables to the skeleton
.env.example. The package and the application follow the contract
version 1.6.0, and the image, the throwaway test containers and the
broker vhost description are tagged lab6 so they do not collide with a
lab 5 stand on the same host.
This is the starting point of the lab 6 cycle: lint, own tests and the
offline skeleton check pass before any lab 6 change.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
22 lines
818 B
Bash
Executable File
22 lines
818 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
cd "$(dirname "$0")/.."
|
|
COMPOSE=${COMPOSE:-docker compose}
|
|
service=${BROKER_SERVICE:-broker}
|
|
dlq() {
|
|
$COMPOSE exec -T "$service" sh -c 'RABBITMQADMIN_USERNAME=messenger-ops \
|
|
RABBITMQADMIN_PASSWORD="$(cat /run/secrets/rabbitmq_ops_password)" \
|
|
exec rabbitmqadmin --non-interactive -V messenger get messages \
|
|
-q attachments.process.dlq -c "$1" -a ack_requeue_true' sh "${1:-10}"
|
|
}
|
|
queues() {
|
|
$COMPOSE exec -T "$service" rabbitmqctl -q list_queues -p messenger \
|
|
name type messages_ready messages_unacknowledged consumers
|
|
}
|
|
case "${1:-}" in
|
|
restart) $COMPOSE restart -t 20 "$service" && $COMPOSE up -d --no-deps --no-recreate --wait --wait-timeout 90 "$service" ;;
|
|
queues) queues ;;
|
|
dlq) dlq "${2:-10}" ;;
|
|
*) echo "usage: $0 restart|queues|dlq [count]" >&2; exit 2 ;;
|
|
esac
|