Skip to content

Queue configuration

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.

queue: { name: string };
  • name (required) — string. The logical service name. Used as the queue/endpoint name and as the sourceAddress on every outgoing envelope.
BehaviourConfig 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 queuetransport.consumer.maxRetries (default 3)
Delay between retriestransport.consumer.retryDelay ms (default 3000)
Audit queue / mirroringtransport.consumer.auditQueue + auditEnabled
Dead-letter unhandled messagestransport.consumer.deadLetterUnhandled
Custom queue arguments (TTL, quorum, etc.)transport.consumer.queueArguments
Connection name in management UItransport.connectionName
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' },
},
}),
});