Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
NotificationsYou must be signed in to change notification settings

node-ts/bus-redis

Repository files navigation

Known VulnerabilitiesCircleCILicense: 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 theBusRedisModule 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'constcontainer=newContainer()container.load(newLoggerModule())container.load(newBusModule())container.load(newBusRedisModule())constredisConfiguration: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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp