npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nestjstools/messaging-redis-extension

v1.4.1

Published

Extension to handle messages and dispatch them over Redis

Downloads

5

Readme

@nestjstools/messaging-redis-extension

A NestJS library for managing asynchronous and synchronous messages with support for buses, handlers, channels, and consumers. This library simplifies building scalable and decoupled applications by facilitating robust message handling pipelines while ensuring flexibility and reliability.


Documentation

https://nestjstools.gitbook.io/nestjstools-messaging-docs


Installation

npm install @nestjstools/messaging @nestjstools/messaging-redis-extension 

or

yarn add @nestjstools/messaging @nestjstools/messaging-redis-extension

Redis Integration: Messaging Configuration Example


import {MessagingModule} from '@nestjstools/messaging';
import {SendMessageHandler} from './handlers/send-message.handler';
import {MessagingRedisExtensionModule, RedisChannelConfig} from '@nestjstools/messaging-redis-extension';

@Module({
   imports: [
      MessagingRedisExtensionModule,
      MessagingModule.forRoot({
         buses: [
            {
               name: 'message.bus',
               channels: ['my-channel'],
            },
            {
               name: 'command.bus', //The naming is very flexible
               channels: ['redis-command'], //be sure if you defined same channels name as you defined below, you can bind multiple channels there, like send message to rabbitmq and redis at the same time 
            },
            {
               name: 'event.bus',
               channels: ['redis-event'],
            },
         ],
         channels: [
            new InMemoryChannelConfig({
               name: 'my-channel',
               middlewares: [],
               avoidErrorsForNotExistedHandlers: true,
            }),
            new RedisChannelConfig({
               name: 'redis-command',
               middlewares: [],
               avoidErrorsForNotExistedHandlers: false,
               queue: 'command-queue',
               connection: {
                  port: 6379,
                  host: '127.0.0.1',
               },
            }),
            new RedisChannelConfig({
               name: 'redis-event',
               middlewares: [],
               avoidErrorsForNotExistedHandlers: true,
               queue: 'event-queue',
               connection: {
                  port: 6379,
                  host: '127.0.0.1',
               },
            }),
         ],
         debug: true,
      }),
   ],
})
export class AppModule {
}

Key Features:

  1. Multiple Message Buses:

    • Configure distinct buses for commands, and events:
      • command.bus (command processing).
      • event.bus (event processing).
  2. In-Memory Channel:

    • Simple and lightweight channel suitable for non-persistent messaging or testing purposes.
  3. Redis Channels:

    • Fully integrated Redis configuration using RedisChannelConfig.
  4. Channel Details:

    • connection: Specifies the Redis server connection.
    • queue: Specify a Redis queue name to consume messages from.
  5. Error Handling:

    • Use avoidErrorsForNotExistedHandlers in redis-event to gracefully handle missing handlers for event messages.
  6. Debug Mode:

    • Enable debug: true to assist in monitoring and troubleshooting messages.

This configuration provides a solid foundation for integrating redis as part of your messaging system. It facilitates the decoupling of commands, events, and in-memory operations, ensuring reliable and scalable communication across distributed systems.


Configuration options

RedisChannel

RedisChannelConfig

| Property | Description | Default Value | |----------------------------------------|----------------------------------------------------------------------|-------------------| | name | Name of the Redis channel (e.g., 'redis-command'). | | | connection | Redis connection configuration (host, port, password, db). | | | queue | The Redis queue to consume messages from (e.g., 'my_app.command'). | | | enableConsumer | Enables or disables the consumer for this channel. | true | | avoidErrorsForNotExistedHandlers | Avoid errors if no handler is available for the message. | false | | keyPrefix | Optional prefix for keys stored in Redis. | |


Real world working example with RabbitMQ & Redis

https://github.com/nestjstools/messaging-rabbitmq-example