2.6.1 • Published 24 hours ago

@mashroom/mashroom-session-provider-redis v2.6.1

Weekly downloads
36
License
MIT
Repository
github
Last release
24 hours ago

Mashroom Session Redis Provider

Plugin for Mashroom Server, a Microfrontend Integration Platform.

This plugin adds a Redis session store that can be used by Mashroom Session. Actually this is just a wrapper for the connect-redis package.

Usage

If node_modules/@mashroom is configured as plugin path just add @mashroom/mashroom-session-provider-redis as dependency.

Activate this session provider in your Mashroom config file like this:

{
  "plugins": {
        "Mashroom Session Redis Provider": {
            "provider": "Mashroom Session MongoDB Provider"
        }
    }
}

And to change the default config of this plugin add:

{
  "plugins": {
      "Mashroom Session Redis Provider": {
          "client": {
              "redisOptions": {
                  "host": "localhost",
                  "port": "6379",
                  "maxRetriesPerRequest": 3,
                  "enableOfflineQueue": false
              },
              "cluster": false,
              "clusterNodes": null,
              "clusterOptions": null
          },
          "prefix": "mashroom:sess:"
          "ttl": 86400
      }
  }
}
  • client: Options for the Redis client. redisOptions are just to the Redis constructor of ioredis(https://github.com/luin/ioredis Checkout out the ioredis documentation for all available options.
  • prefix: The key prefix. Appends to whatever prefix you may have set on the client itself. (Default: mashroom:sess:)
  • ttl: TTL in seconds (Default: 86400 - one day)

Usage with Sentinel

For a high availability cluster with Sentinel the configuration would look like this:

{
  "plugins": {
      "Mashroom Session Redis Provider": {
         "client": {
             "redisOptions": {
                 "sentinels": [
                     { "host": "localhost", "port": 26379 },
                     { "host": "localhost", "port": 26380 }
                 ],
                 "name": "myMaster",
                 "keyPrefix": "mashroom:sess:"
             }
         }
      }
  }
}
  • sentinels: list of sentinel nodes to connect to
  • name: identifies a group of Redis instances composed of a master and one or more slaves

Checkout out the Sentinel section of the ioredis documentation for all available options.

Usage with a cluster

For a sharding cluster configure the plugin like this:

{
  "plugins": {
      "Mashroom Session Redis Provider": {
         "client": {
             "cluster": true,
             "clusterNodes": [
                 {
                     "host": "redis-node1",
                     "port": "6379"
                 },
                 {
                     "host": "redis-node2",
                     "port": "6379"
                 }
             ],
             "clusterOptions": {
                 "maxRedirections": 3
             },
             "redisOptions": {
                 "keyPrefix": "mashroom:sess:"
             }
         }
      }
  }
}
  • cluster: Enables cluster support, must be true
  • clusterNodes: Cluster start nodes
  • clusterOptions: Passed as second argument of the Redis.Cluster constructor of ioredis
  • redisOptions: Passed as redisOptions in the clusterOptions

Checkout out the Cluster section of the ioredis documentation for all available options.

2.6.1

24 hours ago

2.6.0

1 month ago

2.5.4

4 months ago

2.5.3

4 months ago

2.5.2

4 months ago

2.5.1

4 months ago

2.5.0

4 months ago

2.4.3

10 months ago

2.4.5

6 months ago

2.4.4

8 months ago

2.4.1

11 months ago

2.4.0

11 months ago

2.4.2

11 months ago

2.3.0

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

2.2.3

1 year ago

2.2.2

1 year ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.3

2 years ago

2.1.0

2 years ago

2.0.3

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.2

2 years ago

2.0.0-alpha.4

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

2.0.0-alpha.3

2 years ago

2.0.0-alpha.0

2 years ago

2.0.0-alpha.1

2 years ago

2.0.0-alpha.2

2 years ago

1.9.4

2 years ago

1.9.3

2 years ago

1.9.1

3 years ago

1.9.2

2 years ago

1.9.0

3 years ago

1.8.3

3 years ago

1.8.2

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.10

3 years ago

1.7.9

3 years ago

1.7.8

3 years ago

1.7.7

3 years ago

1.7.6

3 years ago

1.7.5

3 years ago

1.7.4

3 years ago

1.7.3

3 years ago

1.7.2

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.4

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

4 years ago

1.5.4

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.5

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago