Topics
Publish and subscribe topics
Tip
To understand MQTT's publish and subscribe architecture, refer to
1. Common Settings
1.1. Quality of Service (QoS)
All topics in Webview Kiosk will allow the Quality of Service to be configured using one of:
| QoS | Description |
|---|---|
| At most once (0) | The message is delivered at most once, with no acknowledgment. Delivery is not guaranteed. |
| At least once (1) | The message is delivered at least once. It may be delivered multiple times if acknowledgment is lost. |
| Exactly once (2) | The message is guaranteed to be delivered exactly once by using a two-step handshake between sender and receiver. |
The default is At most once (0).
For more information, see:
1.2. Retained Messages
For publish topics, the retain property (type boolean) can be configured (default: false)
For subscribe topics, the retain as published property (type boolean, default false) can be configured,
as well as retain handling, which can be:
| Retain Handling | Description |
|---|---|
| Send (0) | The broker sends the retained message to the subscriber when it subscribes. |
| Send if Subscription Does not Exist (1) | The broker sends the retained message only if the subscription is new and didn't exist before. |
| Do Not Send (2) | The broker does not send any retained messages when the subscription is made. |
The default retain handling is Do Not Send (2).
For more information, see:
2. Shared Publish Payload Properties
2.1. Message ID
For published topics, a UUID will be generated for all messages.
Example in Payload:
{
"messageId": "e5e7cb82-cff4-11f0-a32b-5a93ec0e6f92"
}2.2. App Instance ID
For published topics, the appInstanceId, which you can find
in the Settings -> About screen, will be included
in each message, both in the payload and as a
user property.
Example in Payload:
{
"appInstanceId": "c345e39c-accd-11f0-9ea0-5a93ec0e6f91"
}2.3. Username
For published topics, the MQTT connection username will be included
in each message, both in the payload and as a
user property.
Example in Payload:
{
"username": "test-user-001"
}3. Shared Subscribe Payload Properties
3.1. Message ID
For subscribed topics, the messageId can be optionally specified, which
will be displayed and highlighted in the debug logs
For request-response, the response payload will include a requestMessageId
property with the value you've provided when making the request.
{
"messageId": "example-001"
}3.2. Target Instances & Target Usernames
Warning
These properties are intended for convenience and testing purposes, with all messages being received and filtered client-side.
It is better practice subscribe only to topics that the client needs, e.g. by modifying the default topic names and making use of the global variables.
For subscribed topics, the targetInstances and targetUsernames (type: string array)
can be optionally provided.
Webview Kiosk will ignore messages that contain these properties if neither
of its appInstanceId or username were specified in the array.
When the arrays are empty (or null/undefined), all messages will be processed.
{
"targetInstances": [
"4f79ca9c-d0c6-11f0-953d-5a93ec0e6f90",
"55ebdc6c-d0c6-11f0-8fcc-5a93ec0e6f90"
]
}