Back to Medusa

README

packages/modules/event-bus-redis/README.md

2.13.53.6 KB
Original Source
<p align="center"> <a href="https://www.medusajs.com"> </a> </p> <h1 align="center"> @medusajs/event-bus-redis </h1> <h4 align="center"> <a href="https://docs.medusajs.com">Documentation</a> | <a href="https://www.medusajs.com">Website</a> </h4> <p align="center"> An open source composable commerce engine built for developers. </p> <p align="center"> <a href="https://github.com/medusajs/medusa/blob/master/LICENSE"> </a> <a href="https://circleci.com/gh/medusajs/medusa"> </a> <a href="https://github.com/medusajs/medusa/blob/master/CONTRIBUTING.md"> </a> <a href="https://www.producthunt.com/posts/medusa"></a> <a href="https://discord.gg/xpCwq3Kfn8"> </a> <a href="https://twitter.com/intent/follow?screen_name=medusajs"> </a> </p>

Overview

Redis Event Bus module for Medusa. When installed, the events system of Medusa is powered by BullMQ and io-redis. BullMQ is responsible for the message queue and worker. io-redis is the underlying Redis client, that BullMQ connects to for events storage.

Getting started

Install the module:

bash
yarn add @medusajs/event-bus-redis

Add the module to your medusa-config.js:

js
module.exports = {
  // ...
  modules: [
    {
      resolve: "@medusajs/event-bus-redis",
      options: {
        redisUrl: "redis:..",
      },
    },
  ],
  // ...
}

Configuration

The module can be configured with the following options:

OptionTypeDescriptionDefault
redisUrlstringURL of the Redis instance to connect to.events-worker
queueNamestring?Name of the BullMQ queue.events-queue
queueOptionsobject?Options for the BullMQ queue. See BullMQ's documentation.{}
redisOptionsobject?Options for the Redis instance. See io-redis's documentation{}

Info: See how the options are applied in the RedisEventBusService and loader.

If you do not provide a redisUrl in the module options, the server will fail to start.