From 2fab48084a0bbfc77e1d7aed669891669fab6a94 Mon Sep 17 00:00:00 2001 From: Cherry Wang <41656797+cherrycl@users.noreply.github.com> Date: Wed, 20 Oct 2021 06:06:30 +0800 Subject: [PATCH] feat: Add external-mqtt-trigger configuration file for TAF test (#338) Signed-off-by: Cherry Wang --- res/external-mqtt-trigger/configuration.toml | 108 +++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 res/external-mqtt-trigger/configuration.toml diff --git a/res/external-mqtt-trigger/configuration.toml b/res/external-mqtt-trigger/configuration.toml new file mode 100644 index 00000000..70fd12d0 --- /dev/null +++ b/res/external-mqtt-trigger/configuration.toml @@ -0,0 +1,108 @@ +[Writable] +LogLevel = "INFO" + + [Writable.StoreAndForward] + Enabled = false + RetryInterval = "5m" + MaxRetryCount = 10 + + [Writable.Pipeline] + ExecutionOrder = "MQTTExport" + UseTargetTypeOfByteArray = true + + [Writable.Pipeline.Functions] + [Writable.Pipeline.Functions.MQTTExport] + [Writable.Pipeline.Functions.MQTTExport.Parameters] + BrokerAddress = "tcp://localhost:1883" # Hive Public Test Broker + # Topic can have place holders in the form "{key-name}" that are replaced with matching Context values. Error occurs if no value match place holder(s). + Topic = "edgex-export" + SecretPath = "mqtt" + ClientId = "external-mqtt-export" + QOS="0" + AutoReconnect="false" + KeepAlive = "" # Empty indicates to use default value + ConnectTimeout = "" # Empty indicates to use default value + Retain="false" + SkipVerify = "false" + AuthMode = "none" + PersistOnError = "false" + +# InsecureSecrets are required for Store and Forward DB access and for authenticated MQTT exports with +# new MQTTSecretSend function when not using security services, i.e. Vault + [Writable.InsecureSecrets] + [Writable.InsecureSecrets.DB] + path = "redisdb" + [Writable.InsecureSecrets.DB.Secrets] + username = "" + password = "" + [Writable.InsecureSecrets.mqtt] + path = "mqtt" + [Writable.InsecureSecrets.mqtt.Secrets] + username = "" + password = "" + cacert = "" + clientcert = "" + clientkey = "" + +[Service] +HealthCheckInterval = "10s" +Host = "localhost" +Port = 59706 +ServerBindAddr = "" # if blank, uses default Go behavior https://golang.org/pkg/net/#Listen +StartupMsg = "app-external-mqtt-trigger has Started" +MaxResultCount = 0 # Not curently used by App Services. +MaxRequestSize = 0 # Not curently used by App Services. +RequestTimeout = "5s" + +[Registry] +Host = "localhost" +Port = 8500 +Type = "consul" + +# Database is require when Store and Forward is enabled or when using Redis for the Messagebus +# Note when running in docker from compose file set the following environment variables: +# - Database_Host: edgex-redis +[Database] +Type = "redisdb" +Host = "localhost" +Port = 6379 +Timeout = "30s" + +# SecretStore is required when Store and Forward is enabled and running with security +# so Database credentials can be pulled from Vault. Also now require when running with secure Consul +# Note when running in docker from compose file set the following environment variables: +# - SecretStore_Host: edgex-vault +[SecretStore] +Type = "vault" +Host = "localhost" +Port = 8200 +Path = "app-external-mqtt-trigger/" +Protocol = "http" +RootCaCertPath = "" +ServerName = "" +TokenFile = "/tmp/edgex/secrets/app-external-mqtt-trigger/secrets-token.json" + [SecretStore.Authentication] + AuthType = "X-Vault-Token" + +[Clients] + # Used for version check on start-up + [Clients.core-metadata] + Protocol = "http" + Host = "localhost" + Port = 59881 + +[Trigger] +Type="external-mqtt" + [Trigger.ExternalMqtt] + Url = "tcp://localhost:1883" # fully qualified URL to connect to the MQTT broker + SubscribeTopics="external-request/#" + PublishTopic="" # optional if publishing response back to the the External MQTT Broker + ClientId = "external-mqtt-trigger" + ConnectTimeout = "5s" # 5 seconds + AutoReconnect = true + KeepAlive = 10 # Seconds (must be 2 or greater) + QoS = 0 # Quality of Service 0 (At most once), 1 (At least once) or 2 (Exactly once) + Retain = true + SkipCertVerify = false + SecretPath = "mqtt-trigger" + AuthMode = "none"