Closed jahpola closed 1 year ago
An external service that sends and reads.
python http server to serve static test files, one for each gtfs realtime city, one for vehicle registry
python3 -m http.server -d served 8000
serves directory served
. This switches between the numerically ordered files in directory:
#!/bin/bash
set -Eeuo pipefail
for filename in source/*; do
echo 1>&2 "Set target to ${filename}"
ln -f -s "${filename}" 'served/target'
sleep 3
done
curl 'http://localhost:8000/target'
should ask for file target
but has some bugmosquitto_sub
and mosquitto_pub
or with npx mqtt sub
and npx mqtt pub
.Alternative:
coordination file with contents similar to this:
- scenario: bus-leaves-depot-or-something
inputMessages:
- path: input/http/vehicle-registry/all-vehicles.json
- path: input/http/jyvaskyla/no-service.json
- path: input/http/kuopio/en-route.json
- path: input/mqtt/acme-vendor/door-1-in-2.json
- path: input/mqtt/counting-corporation/door-2-out-1.json
- path: input/mqtt/first-stop.json
waitAfterInSeconds: 0.5 # Default as env var, value e.g. 0.1
- path: input/http/kuopio/left-stop.json
- path: input/http/jyvaskyla/bus-on-first-stop.json
outputMessages:
- path: output/mqtt/apc/authority-221/door-1-in-2.json
- alternative_paths:
- output/mqtt/anonymized-apc/authority-221/trip-y-empty.json
- output/mqtt/anonymized-apc/authority-221/trip-y-many-seats-available.json
00001-...
has the problem that most changes require renaming many filesI see two choices: