Skip to content

Support Clusters #224

@cetchebarne-fff

Description

@cetchebarne-fff

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

Add support for Redis clusters

Motivation

I tried to use this plugin to connect to a Redis Cluster but I couldn't do it. Is not specified in the docs and I couldn't find any options in the interface so I'm assuming this is not supported but it would be a great feature.

Currently I couldn't find any workaround other than using a custom implementation directly with ioredis.

Example

import { fastifyRedis } from '@fastify/redis';
import type { FastifyInstance } from 'fastify';
import fp from 'fastify-plugin';
export default fp(async function (fastify: FastifyInstance) {
  const { REDIS_HOST, REDIS_PORT } = fastify.getEnvs<EnvSchema>();

fastify.register(fastifyRedis, {
// Something like this would be nice.
clusterOptions: {
    host: REDIS_HOST,
    port: parseInt(REDIS_PORT),
     ...
  });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions