Documentation (Beta)
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

MQTT Integration v2 API

Overview

Tektelic Network Servers provides an interface to establish connection with external MQTT broker. Connection can be configured via UI (contains most common options) or using REST API (full set of configuration options) That pages specifies configuration details for MQTT v2 Integration.

General MQTT_V2 UL processing flow:

MQTT_V2_UL_simple


Create new MQTT_V2 integration using REST API

Request example: POST https://lorawan-ns-na.tektelic.com/api/integration

POST Body structure:

{
    "name": "test_mqttv2",
    "type": "MQTT_V2",
    "applicationId": {
        "entityType": "APPLICATION",
        "id": "f2f3bef0-4c39-11ec-8bc3-61bf5466d195"
    },
    "converterId": {
        "entityType": "CONVERTER",
        "id": "53be8400-3f0e-11ed-bea9-cd6f9aef98c7"
    },
    "allowAllPorts": true,
    "allowPortsArray": [],
    "configuration": {
        "integrationInitializationRetryIntervalS": 120,
        "pendingQueueMaxSize": 1000,
        "pendingQueueOnErrorProcessingRetryIntervalS": 60,
        "mqttVersion": null,
        "port": 1883,
        "ssl": false,
        "clientKeyPassword": "",
        "token": "userT",
        "password": "userP",
        "autoreconnectIntervalS": 30,
        "connectionTimeoutS": 30,
        "keepAliveIntervalS": 60,
        "cleanSession": false,
        "maxInflight": 5,
        "pushQos": "AT_LEAST_ONCE",
        "pullQos": "AT_LEAST_ONCE",
        "pushRetained": false,
        "host": "0.tcp.eu.ngrok.io",
        "pushTopic": "pushTopic",
        "pullTopic": "pullTopic"
    },
    "httpEndpoint": "/api/v1/integration/http/"
}

Fields:

  • name
    Integration Name
    Possible values:
    String
    Example:
    "mqtt_v2_integration_name"


  • type
    Integration Type
    MQTT_V2 has to be specified to use all features of MQTT_V2 Integration
    Example:
    "MQTT_V2"


  • applicationId
    Identifier of the Application Entity
    Example:
    "f2f3bef0-4c39-11ec-8bc3-61bf5466d195"


  • converterId
    Identifier of the Converter Entity.
    NOTE: converter_V2 must be used for MQTT_V2 Integration
    Example:
    "53be8400-3f0e-11ed-bea9-cd6f9aef98c7"


  • configuration.integrationInitializationRetryIntervalS
    Retry interval in case of internal server errors during initialization.
    Possible values:
    int
    Example:
    120
    API only


  • configuration.pendingQueueMaxSize
    Set the maximum number of outgoing messages with QoS>0 that can be pending in the outgoing message queue.
    Possible values:
    int
    >= 1
    <= 10000
    Example:
    1000


  • configuration.pendingQueueOnErrorProcessingRetryIntervalS
    Retry interval in case of internal server errors during UL processing.
    Possible values:
    int
    >= 1
    Example:
    60
    API only


  • configuration.host
    Domain Name or IP of external MQTT broker. Port is NOT allowed
    Possible values:
    String
    Example:
    "test.mosquitto.org"


  • configuration.port
    Port of external MQTT broker
    Possible values:
    int
    Example:
    1883


  • configuration.ssl
    Enable or disable TLS usage. True means TLS will be used.
    Possible values:
    boolean
    Example:
    false


  • configuration.connectionTimeoutS
    This value defines the maximum time interval the client will wait for the network connection to the MQTT broker to be established.
    Possible values:
    int
    >= 1
    Example:
    30


  • configuration.autoreconnectIntervalS
    Perform automatic reconnect to MQTT broker on connection failure or connection lost.
    Possible values:
    int
    >= 1
    Example:
    30
    API only


  • configuration.keepAliveIntervalS
    This interval defines the longest period of time that the broker and client can endure without sending a message. The client commits to sending regular PING Request messages to the broker. The broker responds with a PING response.
    Possible values:
    int
    >= 1
    Example:
    60


  • configuration.mqttVersion
    MQTT protocol version to be used
    Possible values:
    "MQTT_VERSION_3_1"
    "MQTT_VERSION_3_1_1"
    Optional, default:
    "MQTT_VERSION_3_1_1" first, dropping back to "MQTT_VERSION_3_1" if that fails
    API only


  • configuration.token
    Username
    Possible values:
    String
    Example:
    "rw"


  • configuration.password
    Password
    Possible values:
    String
    Example:
    "readwrite"


  • configuration.clientId
    Client ID
    Possible values:
    String
    according to MQTT protocol
    MQTT v3.1 → max len 23 symbols
    MQTT v3.1.1, v5.0→ max len 256 symbols
    Optional, default: random clientId
    API only


  • configuration.cleanSession
    Tells the broker whether the client wants to establish a persistent session or not. In a persistent session (CleanSession = false), the broker stores all subscriptions for the client and all missed messages for the client that subscribed with a Quality of Service (QoS) level 1 or 2. If the session is not persistent (CleanSession = true), the broker does not store anything for the client and purges all information from any previous persistent session.
    Possible values:
    boolean
    Example:
    false


  • configuration.pushTopic
    Topic where Network Server will publish UL messages.
    Possible values:
    String
    not empty
    Example:
    "ttt_push_xxassss000123"


  • configuration.pullTopic
    Topic on which Network Server will listen for DL messages.
    Possible values:
    String
    Optional
    Example:
    "ttt_pull_xxassss000123"

  • configuration.pushQos
    QoS for push topic
    Possible values:
    "AT_MOST_ONCE"
    "AT_LEAST_ONCE"
    "EXACTLY_ONCE"
    Optional, default:
    "AT_LEAST_ONCE"


  • configuration.pullQos
    QoS for pull topic
    Possible values:
    "AT_MOST_ONCE"
    "AT_LEAST_ONCE"
    "EXACTLY_ONCE"
    Optional, default:
    "AT_LEAST_ONCE"
    API only


  • configuration.maxInflight
    Set the maximum number of UL messages with QoS>0 that can be part way through their network flow at once.
    Possible values:
    int
    >= 1
    <=100
    Example:
    5


  • configuration.pushRetained
    Retained defines whether the message is saved by the broker as the last known good value for a specified topic. When a new client subscribes to a topic, they receive the last message that is retained on that topic.
    Possible values:
    boolean
    Example:
    false


  • configuration.clientPrivateKey
    Client’s Private Key in case MQTT broker uses certificate to establish a connection with Network Server (MQTT client)
    Possible values:
    String
    Optional
    API only


  • configuration.clientCertificate
    Client’s Certificate
    Possible values:
    String
    Optional
    API only


  • configuration.clientKeyPassword
    Client’s Password for private key
    Possible values:
    String
    Optional
    API only


  • configuration.caCertificate
    Certificate which identifies Certificate Authority
    Possible values:
    String
    Optional
    API only