A module that listens is served, not run

`run` imports an entrypoint without binding a broker — it exists for a step that
works offline and exits. Both the catalogue and amqp-ping subscribe on import,
so both died on the first on() with no broker bound.
This commit is contained in:
2026-09-13 01:30:39 +02:00
parent c774d5dbe0
commit 9387f8b040
3 changed files with 7 additions and 12 deletions
-4
View File
@@ -51,10 +51,6 @@
"env-file": [
"/var/lib/amqp-ping/amqp.env"
],
"args": [
"run",
"/app/modules/amqp-ping/dist/index.js"
],
"restart-on": [
"amqp-env"
],
+7 -4
View File
@@ -36,7 +36,10 @@ COPY --from=build /app/modules/mesh-catalog/dist /app/modules/mesh-catalog/dist
# base image's own node_modules — the module gets its extra dependency without shadowing the sdk it
# was compiled against.
COPY --from=build /deps/node_modules /app/modules/mesh-catalog/node_modules
# What a tool host should load: the catalogue's tools. Its consumer of `module.builder.built` is the
# other entrypoint, and is what this module's own container runs — named in the declaration's `args`
# rather than here, because which one runs is the declaration's business.
ENV MESH_TOOL_MODULES=/app/modules/mesh-catalog/dist/tools/index.js
# Both entrypoints, loaded in serve mode.
#
# **A consumer cannot be started with `run`.** That mode imports an entrypoint without binding a
# broker — it is for a step that does its work offline and exits — and the catalogue's whole job is
# to listen for what the builder announces. Serve binds the broker first, then imports these, so
# `on()` has something to subscribe to.
ENV MESH_TOOL_MODULES=/app/modules/mesh-catalog/dist/index.js,/app/modules/mesh-catalog/dist/tools/index.js
-4
View File
@@ -72,10 +72,6 @@
"/var/lib/mesh-catalog/db.env"
],
"artifact": "runtime",
"args": [
"run",
"/app/modules/mesh-catalog/dist/index.js"
],
"restart-on": [
"db-env"
]