Skip to main content
The Message Dispatcher receives messages from the EdgePort, runs the configured middlewares, and forwards each message to the first Processor whose matchFunc returns true. It is stateless.

Docker image

fonoster/routr-dispatcher The image reads its configuration from /etc/routr/dispatcher.yaml (CONFIG_PATH).

Ports

Configuration file

The Dispatcher reads a YAML or JSON file and validates it against a JSON schema at startup. matchFunc receives the JSON form of the MessageRequest protobuf (sipmessage.proto). These are typical match functions:

Environment variables

gRPC contract

The Dispatcher serves the same contract as a Processor, so the EdgePort can talk to either. It is also a client of that contract toward each Processor and middleware. See processor.proto.

Minimal example

This configuration sends every message to the Connect processor.
This command runs the Dispatcher with that file.

Notes

  • You need a Dispatcher only with more than one Processor or at least one middleware. Otherwise, point the EdgePort at the Processor directly.
  • Order matters. The first Processor whose matchFunc returns true gets the message, so put catch-all functions last.
  • Set postProcessor on every middleware. A middleware without it runs in neither phase.
  • The schema does not enforce the fields inside spec.processors[*], so a Processor entry without matchFunc or methods is not rejected at startup. Check each entry yourself.