Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "targetActorSelection": "/system/sharding/connection",
- "headers": {
- "aggregate": false
- },
- "piggybackCommand": {
- "type": "connectivity.commands:createConnection",
- "connection": {
- "id": "mqtt-connection-target",
- "connectionType": "mqtt",
- "connectionStatus": "open",
- "failoverEnabled": true,
- "uri": "tcp://91.121.93.94:1883",
- "targets": [{
- "address": "my.mqtt.test.notifications/{{ thing:id }}",
- "topics": [
- "_/_/things/twin/events",
- "_/_/things/live/messages"
- ],
- "authorizationContext": ["ditto:observer"],
- "qos": 0
- }],
- "mappingContext": {
- "mappingEngine": "JavaScript",
- "options": {
- "incomingScript": "function mapToDittoProtocolMsg(headers, textPayload, bytePayload, contentType) {return null;}",
- "outgoingScript": "function mapFromDittoProtocolMsg(namespace, id, group, channel, criterion, action, path, dittoHeaders, value, status, extra) {let textPayload = '{\"temperature\": ' + value.measurements.properties.temperature + ', \"humidity\": ' + value.measurements.properties.humidity + ', \"thingId\": \"' + namespace + ':' + id + '\"}'; let bytePayload = null; let contentType = 'text/plain; charset=UTF-8'; return Ditto.buildExternalMsg(dittoHeaders, textPayload, bytePayload, contentType);}",
- "loadBytebufferJS": "false",
- "loadLongJS": "false"
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement