Module @mdf.js/mqtt-provider

@mdf.js/mqtt-provider

Node Version Typescript Version Known Vulnerabilities Documentation

netin

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

Typescript tools for development

MQTT provider for @mdf.js based on mqtt.

Using npm:

npm install @mdf.js/mqtt-provider

Using yarn:

yarn add @mdf.js/mqtt-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.
    • observedUnit: status.
    • status: fail if the observed value is error, warn if the observed value is stopped, pass in other case.
  • lastError:
    • observedValue: last error message from the provider.
    • observedUnit: Last error.
    • status: pass.
    • output: last error message from the provider.
  • CONFIG_MQTT_URL (default: 'mqtt://localhost:1883'): URL of the server
  • CONFIG_MQTT_PROTOCOL (default: 'mqtt'): Protocol to use
  • CONFIG_MQTT_USERNAME (default: undefined): Username
  • CONFIG_MQTT_PASSWORD (default: undefined): Password
  • CONFIG_MQTT_CLIENT_ID (default: 'mqtt-client'): Client ID
  • CONFIG_MQTT_KEEPALIVE (default: 60): Keepalive in seconds
  • CONFIG_MQTT_CLIENT_CA_PATH (default: undefined): CA file path
  • CONFIG_MQTT_CLIENT_CLIENT_CERT_PATH (default: undefined): Client cert file path
  • CONFIG_MQTT_CLIENT_CLIENT_KEY_PATH (default: undefined): Client key file path
  • 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.

Namespaces

MQTT