Striim 3.9.6 documentation

MQTT Writer

Writes messages to an MQTT broker.

See the MQTT FAQ for information on firewall settings.

property

type

default value

notes

brokerUri

java.lang.String

format is tcp://<broker address>:<broker port>

clientId

java.lang.String

MQTT client ID (maximum 23 characters). Must be unique (not used by any other client) in order to identify this instance of MQTTWriter. The MQTT broker will use this ID close the connection when MQTTWriter goes offline and resend events after it restarts.

QoS

java.lang.Integer

0

  • 0: at most once

  • 1: at least once

  • 2: exactly once

Topic

java.lang.String

This adapter has a choice of formatters. See Supported writer-formatter combinations for more information.

Sample:

CREATE CQ ConvertTemperatureToControl
INSERT INTO controlstream
SELECT TO_STRING(data.get('roomName') ),
  TO_STRING(data.get('temperature'))
FROM tempstream;
CREATE TARGET accontrol USING MQTTWriter(
  brokerUri:'tcp://m2m.eclipse.org:1883',
  Topic:'/striim/room687/accontrol',
  QoS:0,
  clientId:"StriimMqttSource"
) 
FORMAT USING JSONFormatter (
    members:'roomName,targetTemperature'
) 
INPUT FROM controlstream;