Module @mdf.js/redis-provider

@mdf.js/redis-provider

Node Version Typescript Version Known Vulnerabilities Documentation

netin

Mytra Development Framework - @mdf.js/redis-provider

Typescript tools for development

Redis provider for @mdf.js based on ioredis.

Using npm:

npm install @mdf.js/redis-provider

Using yarn:

yarn add @mdf.js/redis-provider

Check information about @mdf.js providers in the documentation of the core module @mdf.js/core.

Checks included in the provider:

  • status: Checks the ping messages from the server.
    • observedValue: actual state of the consumer/producer provider instance [error, running, stopped] based in the last ping event. stopped if the provider is stopped or has not been initialized yet, running if the provider is running and the last ping event was successful, error if the provider is running and the last ping event was not successful.
    • status: pass if the status is running, warn if the status is stopped, fail if the status is error.
  • memory:
    • observedValue: actual memory usage of the provider instance. The values are in expressed in bytes: used memory / max memory.
    • observedUnit: used memory / max memory.
    • status: fail if there is a problem getting the memory usage, or if the memory usage is greater or equal than 100% of the maximum memory, warn if the memory usage is greater than 80% of the maximum memory, pass in other case.
  • CONFIG_REDIS_HOST (default: '127.0.0.1'): REDIS connection host
  • CONFIG_REDIS_PORT (default: 6379): REDIS connection port
  • CONFIG_REDIS_DB (default: 0): REDIS connection database
  • CONFIG_REDIS_PASSWORD (default: undefined): REDIS connection password
  • CONFIG_REDIS_RETRY_DELAY_FACTOR (default: 2000): REDIS connection retry delay factor
  • CONFIG_REDIS_RETRY_DELAY_MAX (default: 60000): REDIS connection retry delay max
  • CONFIG_REDIS_KEEPALIVE (default: 10000): REDIS connection keepAlive
  • CONFIG_REDIS_CONNECTION_TIMEOUT (default: 10000): REDIS connection keepAlive
  • CONFIG_REDIS_CHECK_INTERVAL (default: 60000): REDIS status check interval
  • CONFIG_REDIS_DISABLE_CHECKS (default: false): Disable Redis checks
  • NODE_APP_INSTANCE (default: undefined): Used as default container id, receiver name, sender name, etc. in cluster configurations.

Copyright 2024 Mytra Control S.L. All rights reserved.

Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.

Modules

<internal>

Namespaces

Redis