The Message Queueing and Telemetry Transport (MQTT) is a lightweight, broker-based publish/subscribe messaging protocol, which enables a an extremely lightweight publish/subscribe messaging model in an extremely lightweight way. WSO2 MB 3.0.0 and later versions fully supports support MQTT version 3.1.0, and partially supports version 3.1.1.
The MQTT protocol allows a message to be sent to a topic based on three levels of QoS (Quality of Service) as explained below.
...
QoS 3 - Exactly Once - At this level, the message is delivered only once to its subscriber. This level is also defined as Assured Delivery.
Enabling the transport
The <MB_HOME>/repository/conf/broker.xml
file contains parameters relating the the configuration of the related to configuring the MQTT transport. The transport can be enabled as shown in the following extract of the broker.xml
file.
Code Block | ||
---|---|---|
| ||
<mqtt enabled="true"> <port>1883</port> <sslPort>8883</sslPort> <!-- put proper default ssl port --> <inboundBufferSize>32768</inboundBufferSize> <deliveryBufferSize>32768</deliveryBufferSize> <security> <authentication>OPTIONAL</authentication> <authenticator>org.wso2.carbon.andes.authentication.andes.CarbonBasedMQTTAuthenticator</authenticator> </security> </mqtt> |
...
Related Parameters
Parameter Name | Description | Default Value |
---|---|---|
enabled | If the value for this parameter is true , the MQTT transport is enabled and the MQTT protocol will be applied to messages that are sent to the specified listening port. | true |
port | The listening port for the MQTT transport. The MQTT broker will be initialized with the specified port by default. This value would be incremented based on the offset specified in the carbon.xml . | 1883 |
sslPort | The listening SSL port for the MQTT transport. The MQTT secure socket will be initialized with the specified port by default. | 8883 |
...