Sample Files

docker-compose.yml
version: "3.0"

services:
  protocol_translator_mqtt:
    image: "protocol-adapter-mqtt-amd64:latest"
    environment:
      config: "/config/config.json"
    healthcheck:
      timeout: 5s
      retries: 3
      interval: 5s
    networks:
      - predix-edge-broker_net

networks:
  predix-edge-broker_net:
    external: true

config.json

The sample configuration below receives data from the MQTT broker located at remote.hostname.or.ip.com on port 1883 via the block named mqtt_source. This block is of type cdpin, the generic input CDP block. It then forwards that data directly to the local Predix Edge Broker which has the hostname predix-edge-broker.
{
    "blocks": {
        "mqtt_source": {
            "type": "cdpin",
            "config": {
                "transport_addr": "mqtt-tcp://remote.hostname.or.ip.com:1883",
                "method": "sub",
                "node_ref": "data/temperature",
                "log_level": "info",
                "log_name": "mqtt_source_test"
            }
        },
        "mqtt_sink": {
            "type": "cdpout",
            "config": {
                "transport_addr": "mqtt-tcp://predix-edge-broker",
                "method": "pub",
                "node_ref": "remote-device0/data/temperature",
                "log_level": "info",
                "log_name": "mqtt_sink_test",
                "options": {
                    "qos": 2
                }
            }
        }
    },
    "mappings": {
        "mqtt_source:output": "mqtt_sink:input",
    }
}