Queue configuration
Overview
Section titled “Overview”BusOptions.queue is intentionally tiny: just { name: string }. The queue name is fixed at bus construction — it is both the queue the bus consumes from and the sourceAddress stamped on every outgoing envelope. Everything else you might think of as “queue settings” — per-consumer prefetch, the error queue, retry policy, retry delay, audit mirroring, dead-lettering, custom queue arguments — lives on the transport’s consumer.* block, not on BusOptions.queue.
If you reach for queue.prefetch and the type-checker pushes back, you want transport.consumer.prefetch instead.
Signature
Section titled “Signature”queue: { name: string };name(required) —string. The logical service name. Used as the queue/endpoint name and as thesourceAddresson every outgoing envelope.
Where to tune queue behaviour
Section titled “Where to tune queue behaviour”| Behaviour | Config location |
|---|---|
| Per-consumer parallelism (prefetch) | transport.consumer.prefetch (default 100) |
| Error queue name (or disable routing) | transport.consumer.errorQueue (default 'errors', null to disable) |
| Max retries before error queue | transport.consumer.maxRetries (default 3) |
| Delay between retries | transport.consumer.retryDelay ms (default 3000) |
| Audit queue / mirroring | transport.consumer.auditQueue + auditEnabled |
| Dead-letter unhandled messages | transport.consumer.deadLetterUnhandled |
| Custom queue arguments (TTL, quorum, etc.) | transport.consumer.queueArguments |
| Connection name in management UI | transport.connectionName |
Example
Section titled “Example”import { createBus } from '@serviceconnect/core';import { createRabbitMQTransport } from '@serviceconnect/rabbitmq';
const bus = createBus({ queue: { name: 'orders' }, transport: createRabbitMQTransport({ url: 'amqp://localhost', consumer: { prefetch: 32, maxRetries: 5, errorQueue: 'orders.errors', queueArguments: { 'x-queue-type': 'quorum' }, }, }),});