Home
Softono

Redis Streams 101 Node

Open source Apache-2.0 JavaScript
21
Stars
3
Forks
2
Issues
1
Watchers
4 years
Last Commit

 About Redis Streams 101 Node

Getting started with Redis Streams & Node.js

Platforms

Web Self-hosted

Languages

JavaScript

Links

Need Help Installing Redis Streams 101 Node?

We provide expert installation service for this software. Our team will install, configure, and secure Redis Streams 101 Node on your server. plans start at just $30.

Redis Streams 101 Node

View on GitHub

Getting Started with Redis Streams & Node.js

This project shows how to use Redis Node client to publish and consume messages using consumer groups.

This is a first basic example that use a single consumer.

Build

> cd redis-streams-101-node

> npm install


Run

You have access to a Redis instance/cluster.

Open 2 terminal windows

Run the Producer

> cd redis-streams-101-node

> node producer.js loop=1000 sleep=500

Where:

  • loop is the number of messages sent by the program (in a lopp)
  • sleep the time in milliseconds between each message post

Run the Consumer

> cd redis-streams-101-node

> node consumer.js 

This will print all the messages that have not yet been consumed by the group.