Socket
Book a DemoInstallSign in
Socket

@node-ts/bus-redis

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@node-ts/bus-redis

A redis transport adapter for @node-ts/bus-core.

0.1.8
latest
Source
npmnpm
Version published
Maintainers
2
Created
Source

@node-ts/bus-redis

Known Vulnerabilities CircleCILicense: MIT

A redis transport adapter for @node-ts/bus.

Installation

Install all packages and their dependencies

npm i reflect-metadata inversify @node-ts/bus-redis @node-ts/bus-core

Once installed, load the BusRedisModule to your inversify container alongside the other modules it depends on:

import { Container } from 'inversify'
import { LoggerModule } from '@node-ts/logger-core'
import { BusModule } from '@node-ts/bus-core'
import { BUS_REDIS_SYMBOLS, BusRedisModule, RedisTransportConfiguration } from '@node-ts/bus-redis'

const container = new Container()
container.load(new LoggerModule())
container.load(new BusModule())
container.load(new BusRedisModule())

const redisConfiguration: RedisTransportConfiguration = {
  queueName: 'accounts-application-queue',
  connectionString: 'redis://127.0.0.1:6379',
  maxRetries: 3,

}
container.bind(BUS_REDIS_SYMBOLS.TransportConfiguration).toConstantValue(redisConfiguration)

Configuration Options

The Redis transport has the following configuration:

  • queueName (required) The name of the service queue to create and read messages from.
  • connectionString (required) A redis formatted connection string that's used to connect to the Redis instance
  • maxRetries (optional) The number of attempts to retry failed messages before they're routed to the dead letter queue. Default: 10
  • visibilityTimeout (optional) The time taken before a message has been deemed to have failed or stalled. Once this time has been exceeded the message will be re-added to queue. Default: 30000
  • subscriptionsKeyPrefix (optional) Different queues may want to be aware of the same event being sent on the bus. We need to store a set of queue names that are interested in events being published on the bus and where better than redis at a certain key. Default: 'node-ts:bus-redis:subscriptions:'

Development

Local development can be done with the aid of docker to run the required infrastructure. To do so, run:

docker run --name redis -e ALLOW_EMPTY_PASSWORD=yes -p 6379:6379 bitnami/redis

Keywords

esb

FAQs

Package last updated on 28 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.