An MQTT extension for LoopBack 4.
Run the following command to install
npm i -s lb4-extension-mqtt
lb4-extension-mqtt package is installed, bind it to your application with
;;;// Keep in mind that some extra configuration is required// as shown in the following stepsapp.componentMqttComponent;
To make a connection, you'll have to bind some values that will be provided to the extension.
|MqttBinding||Binding Key||What we need|
||Configuration, see MqttServerConfig|
Mqtt Server Config
The MQTT Server config holds the configuration for the server connection.
MqttServerConfig type from
When a message is received from the message queue, it is stored in an array with type
Message is imported from
The extension exports the messages using a Provider. You can use the inject the value of this provider using the following key:
When injecting in your class, you'll only receive the value once since you can't inject the value multiple times in the same instance.
An example to retrieve the value with an interval:
Development & issues
If you need help with using this extension, feel free to open an issue.
If you think that this extension could use some improvements, feel free to open a PR.