SMQD MQTT Bridge

License Build Status Sonatype Nexus (Releases) Sonatype Nexus (Snapshots)

Usage

    libraryDependencies += "com.thing2x.smqd" %% "smqd-bridge-mqtt" % "x.y.z"

Configuration

smqd {
  bridge {
    drivers = [
      {
        name = mqtt_br
        entry.plugin = com.thing2x.smqd.bridge.MqttBridgeDriver
        config {
            destination = "127.0.0.1:1883"
            client-id = bridge_client
            user = userid
            password = userpassword
            queue = 20
            overflow-strategy = drop-buffer
            keep-alive-interval = 10s
            bridges = [
                {
                  topic = "sensor/+/temperature"
                  qos = 0
                },
                {
                  topic = "sensor/+/humidity"
                  prefix = "bridged/data/"
                  suffix = "/json"
                  qos = 1
                }
              ] 
        }
      }
    ]
  }
}

driver settings

  • destination

    desitnation mqtt server's address and port

  • client-id

    client-id used to connect for destination mqtt server (default: MqttBridge-${driver's name})

  • user and password

    login user name and password. one or both of them can be omitted from config as Mqtt Specification

  • keep-alive-interval

    mqtt keepAliveInterval setting. default is 60 seconds

    smqd sends PINGREQ to destination mqtt server for every interval of this value

  • queue

    size of driver's queue, default is 10

  • overflow-strategy

    queue overflow strategy

    • drop-head
    • drop-tail
    • drop-buffer (default)
    • drop-new
    • backpressure
    • fail

bridge settings

  • topic

    topic filter that the bridge will subscribe

  • prefix & suffix

    if those settings are not defined, received messages will be published to destination mqtt server with same topic name.

    if exists, prefix and suffix will be appended at the head and tail of original topic path before published

  • qos

    0, 1, 2 (default: 0)