Components#

Junction ships as four services, plus Postgres and RabbitMQ as infrastructure dependencies. Each service is independently deployable and independently scalable.

API service (PHP)#

The single entrypoint for all inbound events and the system of record — it’s the only component with database access. Built on the Meritum ecosystem.

Responsibilities:

  • Accepts inbound events at POST /relay, resolves subscribed destinations, and routes a queue envelope per destination
  • Serves the management API — events, destinations, destination types, and delivery history (/v0/*)
  • Serves internal endpoints used by workers — destination type registration and delivery status updates (/system/*)

See the API reference for the full endpoint contract.

CLI#

Setup and maintenance tooling — not a long-running service. Runs as a one-shot job.

Responsibilities:

  • Migrations — creates and evolves the database schema. Run as a Job on Helm install/upgrade.
  • Token generation — issues signed API tokens (relay, system, or management type) for calling systems, workers, and management API clients. Run manually by the operator when a new token is needed.

HTTP destination worker (Go)#

A stateless, purpose-built worker for the http destination type. Has no database access and no general API knowledge — only enough to register itself and report delivery outcomes.

Responsibilities:

  • Consumes delivery messages from junction.destinations.http
  • Delivers the payload via an outbound HTTP POST to the destination’s configured URL
  • Registers its destination type with the API directly on startup (PUT /system/destination-types/register) — the first worker to start creates the destination_types record; later starts are no-ops
  • Publishes a delivery status message to junction.status after every attempt

New destination types (gRPC, a message broker, anything) are added the same way: implement a worker against this same contract — consume from your own queue, deliver, register your type, report status. No API or schema changes required.

System worker (Go)#

The single point of API coupling for delivery status. Decouples destination workers from ever needing to call the API for anything but their own registration.

Responsibilities:

  • Consumes junction.status
  • Calls POST /system/status to update the delivery binding (event_log_destinations) to dispatched or errored

Infrastructure dependencies#

Postgres — the API’s database. Owns events, destinations, destination_types, event_logs, destination_events, and event_log_destinations.

RabbitMQ — the message broker. One queue per destination type (junction.destinations.http, etc.) for delivery, plus junction.status for delivery status reporting back to the system worker.

Both are bundled as part of the Helm chart’s default install and can be swapped for externally-managed instances — see the installation guide .