-
Notifications
You must be signed in to change notification settings - Fork 82
API
-
options
is the client connection options. Defaults:-
connectOnCreate
:true
-
hostname
:'localhost'
-
port
:1884
-
protocol
:'ws'
-
path
:'/'
-
-
client
is a already created MQTT.js client instance
IMqttServiceOptions
extends IClientOptions
of mqtt
which has a lot of more fields.
With this method, you can observe messages for a mqtt topic. The observable will only emit messages matching the filter. The first one subscribing to the resulting observable executes a mqtt subscribe. The last one unsubscribing this filter executes a mqtt unsubscribe.
-
filter
the mqtt filter to subscribe
This method publishes a message for a topic with optional options. The returned observable will complete, if publishing was successfull and will throw an error, if the publication fails
-
topic
the topic to publish the message to -
message
any message to publish -
options
the options to publish with-
qos
the qos level -
retain
set totrue
if message should be retained
-
This method publishes a message for a topic with optional options. Although this method does return void, it will throw an error, if the publication fails
-
topic
the topic to publish the message to -
message
any message to publish -
options
the options to publish with-
qos
the qos level -
retain
set totrue
if message should be retained
-
This static method shall be used to determine whether an MQTT topic matches a given filter. The matching rules are specified in the MQTT standard documenation and in the library test suite.
-
filter
A filter may contain wildcards like '#' and '+'. -
topic
A topic may not contain wildcards.