Transports
A transport is the message broker the bus sends messages through and reads them from. This page lists the transports that are maintained with the bus, and what to use in development.
By default the bus uses an in-memory queue, InMemoryQueue, which needs nothing to run. It's only useful for development and tests: a bus can only receive the messages it sends itself, and they're lost when the process stops. In production, use one of these:
@node-ts/bus-rabbitmqRabbitMQAn AMQP broker. The transport declares the exchanges and queues, and retries messages after the retry strategy's delay.@node-ts/bus-sqsAmazon SQSAWS' managed queues, with SNS topics for events. The transport creates the topics, queues and subscriptions, or uses yours.@node-ts/bus-sqs-lambdaSQS and LambdaHandle SQS messages in AWS Lambda, which reads the queue and passes batches to the bus.Custom transportsAdapt another broker by implementing the Transport interface, and check it with the conformance suite.
Transports are interchangeable: messages, handlers and workflows are written the same way whichever one you use. Each transport instance holds one queue and one connection, so each bus needs its own.
See also
- Persistence, for storing workflow state
Transportin the API reference