A notification is a message that is sent when an event occurs. Within the bridge there are three types of events that can occur: when a pipe opens a connection, when a pipe closes the connection under normal circumstances (that is, the user asked for the pipe to be stopped), and when a pipe is closed due to losing the connection or another error.
To receive these notification messages, a notification object must be defined. A notification specifies which events are of interest, the text to be sent when the events occur, and other properties such as the quality of service at which the notification messages should be sent. For example, if only connect and normal disconnect events are of interest and they are essential, a notification object can be created that defines the text to be received for connect and disconnect events. Connection opened
and Connection closed
could be set as the two events and the QoS would be set to 2. Any connection lost events would not be received with this notification object.
A notification object is added to a pipe as either a local or remote definition. A local definition will send the messages to the local micro broker and a remote definition will send messages to a remote messaging system. If the remote connection is not a broker (that is, not an MQTT connection), the remote definition will be ignored as only MQTT connections support the notification messages. At least one of the messages must be set for the notification to be valid but not all have to be set.
Notifications are optional components. Pipes can also have either one or both of the local and remote notifications set. The same notification object can be used for both the local and remote definition or they can be different. The same notification object can even be used in different pipes.
Parent topic: Components of the bridge: XPD622