Function: serveBroker()
serveBroker(
wire,receiver,logger?):BrokerServer
Defined in: packages/messaging/src/serve.ts:43
Serves a module's handlers from the broker. One subscription per registered key, in the queue group named for the MODULE (chapter 02), so every replica of the hosting deployable shares the work and an extracted module's new replicas can join the same group during a cut-over.
The broker path hands the receiver no caller: a subscriber cannot see who published, and the permission table the broker file is generated from is what restricted it.
A request is answered only on a caller's own inbox. The broker's
allow_responses lets a server publish to whatever reply subject the request names,
and the requester chooses that subject. So a request whose reply subject is not under
_INBOX.<principal>. for a principal that calls the key over the broker
(replyPrefixes in @oktoid/contracts), or that has none, is dropped before it is
handled, and logged as broker.reply_refused. Nothing is executed for it.
Parameters
wire
A connection as the principal that hosts the module.
receiver
The module's receiver.
logger?
MessagingLogger = silentLogger
Defaults to a logger that discards.
Returns
The running server.