` input: opcua: endpoint: 'opc.tcp://192.168...
# umh-support
d
Copy code
input:
  opcua:
    endpoint: 'opc.tcp://192.168.2.101:4840'
    nodeIDs: ['ns=3;s="DB_00CommunicationDayResults"', 'ns=3;s="DB_00CommunicationMachineStatus"']
    subscribeEnabled: true

pipeline:
  processors:
    - bloblang: |
        root = {
          meta("opcua_path"): this,
          "timestamp_ms": (timestamp_unix_nano() / 1000000).floor(),
          "is_machine_status": this.contains("DB_00CommunicationMachineStatus")
        }

output:
  broker:
    pattern: fan_out
    outputs:
      - switch:
          cases:
            - check: 'this.is_machine_status == true'
              output:
                mqtt:
                  urls:
                    - tcp://192.168.2.31:1883
                  topic: 'umh/v1/TLT/Muzzroom/Meulebekestraat/ProductionLine1/SortingUnit1/originID/_historian/machineStatus/${!meta("opcua_tag_group")}/${!meta("opcua_tag_name")}'
                  client_id: 'benthos-umh'

            - check: 'this.is_machine_status == false'
              output:
                mqtt:
                  urls:
                    - tcp://192.168.2.31:1883
                  topic: 'umh/v1/TLT/Muzzroom/Meulebekestraat/ProductionLine1/SortingUnit1/originID/_historian/${!meta("opcua_tag_group")}/${!meta("opcua_tag_name")}'
                  client_id: 'benthos-umh'
j
You can check what we do in the protocol converters 🙂 you can set the mqtt_topic also in the processing part:
Copy code
yaml
topic: '${! meta("my-cool-meta-variable") }'
with a similar logic you can also rename variables
also I recommend using
useHeartbeat: true
with the heartbeat, benthos will reconnect if the OPC UA server servertimestamp does not have changed within 10 seconds (and some special cases for prosys servers, where the server timestamp never changes...)
d
this fixes my problem indeed! thanks for the recommendation! should have checked there first
i've played around with the useHearthbeat but didn't want to use it, it added a tag in my mqtt explorer and my costumer didnt want that so i deleted it again :p
btw, with the new version of benthos we have not seen stability issues at larger scale either! so that seems to be fixed as well!
thanks again for all support!
we're collecting around 5000 tags atm over 6 benthos deployments to
one UNS
j
wow nice!