📘
@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. Getting started

Installation

Install the npm package into your application.

npm i @node-ts/bus-core @node-ts/bus-messages --save

Configure and initialize the bus when your application starts up.

import { Bus } from '@node-ts/bus-core'
​
async function run () {
  const bus = await Bus.configure().initialize()
}

This is the most basic of setups and your app is running an in memory queue capable of receiving messages from itself. In production, it's strongly recommended to configure a transport so that your application can be distributed and survive restarts.

PreviousGetting startedNextHandling messages

Last updated 3 years ago

Was this helpful?