Skip to content

Commit

Permalink
feat: Add external-mqtt-trigger configuration file for TAF test (#338)
Browse files Browse the repository at this point in the history
Signed-off-by: Cherry Wang <cherry@iotechsys.com>
  • Loading branch information
cherrycl authored Oct 19, 2021
1 parent 09c5c1f commit 2fab480
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions res/external-mqtt-trigger/configuration.toml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 2fab480

Please sign in to comment.