📘
@node-test/bus
  • @node-ts/bus
  • Getting started
    • Installation
    • Handling messages
    • Shutting down cleanly
  • Reference
    • Bus
    • BusConfiguration
    • BusInstance
  • Getting help
  • Guide
    • Messages
      • Events
      • Commands
      • System messages
    • Message attributes
      • Correlation id
      • Attributes
      • Sticky attributes
    • Workflows
      • Creating a workflow
      • Starting
      • Handling
      • State
      • Completing
      • Example
    • Transports
      • RabbitMQ
      • Amazon SQS
      • Redis
      • Custom transports
    • Persistence
      • Postgres
      • MongoDB
      • Creating a persistence
    • Serializers
      • Class serializer
    • Loggers
      • Custom loggers
    • Middleware
    • Lifecycle hooks
    • Retry Strategies
    • Dependency injection
    • Long running processes
Powered by GitBook
On this page

Was this helpful?

  1. Guide
  2. Transports

Amazon SQS

SQS is a fully managed queue provider from AWS that's officially supported by @node-ts/bus. Once configured, @node-ts/bus will automatically create all SNS topics, SQS queues and manage subscriptions for the handlers of your application.

Installation

Install the @node-ts/bus-sqs package

npm install @node-ts/bus-sqs

Configure the transport and provide this to the bus configuration

import { Bus } from '@node-ts/bus-core'
import { SqsTransport, SqsTransportConfiguration } from '@node-ts/bus-sqs'

const sqsConfiguration: SqsTransportConfiguration = {
  awsRegion: AWS_REGION,
  awsAccountId: AWS_ACCOUNT_ID,
  queueName: 'service-queue',
  deadLetterQueueName: `service-queue-dead-letter`
}
const sqsTransport = new SqsTransport(sqsConfiguration)
await Bus
  .configure()
  .withTransport(sqsTransport)
  .initialize()

PreviousRabbitMQNextRedis

Last updated 3 years ago

Was this helpful?