Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add external-mqtt-trigger configuration file for TAF test #338

Merged
merged 1 commit into from
Oct 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"