WorkersBroker.prototype.dispatch(batch: IQueueMessageBatch): Promise<void>
Dispatches one delivered batch into the registered subscribers and responders.
Every message is acked or retried exactly once:
- a body that is not a readable envelope →
retry(), because a foreign producer or a version skew is a configuration problem and acking would discard the message permanently and silently; - a publish whose topic has no subscriber →
ack(), because publishing to a topic nobody listens on is ordinary pub/sub, and retrying would burn the queue's retry budget and dead-letter every fire-and-forget message; - a publish whose handler throws →
retry(), leaving the queue's ownmax_retriesand dead-letter configuration to decide what happens next; - a request whose topic has no responder, or whose responder throws →
ack()after sending the caller a failed reply, because the caller is waiting and a redelivery would re-run a handler that already ran.
batch: IQueueMessageBatch
The delivered batch