This project is a Redis to NATS bridge. It listens for Redis connections and uses NATS Key-Value store to store the data.
DECR DEL EXISTS EXPIRE GET HDEL HEXISTS HGET HGETALL
HKEYS HLEN HSET INCR KEYS LPOP LPUSH LRANGE MGET MSET
PING SELECT SET SETNX TTL
To build the project, run the following command:
make build
To run the project, run the following command:
./bin/redis2nats
To build the Docker image, run the following command:
docker build -t redis2nats .
To run the Docker container, run the following command:
docker run -d --name redis2nats redis2nats
To run the Docker container using Docker Compose, run the following command:
docker-compose up redis2nats -d
If you want to run NATS server as well, run the following command:
docker-compose up -d
To run the project using Go, run the following command:
make run
Redis2NATS has a configuration file that can be used to set the Redis and NATS connection details. The example configuration file is located at conf/redis2nats.yaml
.
redis:
address: ":6379"
numDB: 16
nats:
url: "nats://localhost:4222"
bucketPrefix: "redisnats"
timeout: "10s"
persist: false
description of the configuration options:
redis.address
: The address of the Redis2NATS server.redis.numDB
: The number of Redis databases.nats.url
: The URL of the NATS server.nats.bucketPrefix
: The prefix for the NATS bucket.nats.timeout
: The timeout for the NATS connection/operations.nats.persist
: The flag to enable/disable persistence.
© Simone Vellei, 2024~time.Now()
Released under the MIT License