Skip to content

Commit

Permalink
refactor!: Adjust configuration for reworked MessageBs config (#499)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: MessageBus configuration is now standalone from Trigger

closes #489

Signed-off-by: Leonard Goodell <leonard.goodell@intel.com>

Signed-off-by: Leonard Goodell <leonard.goodell@intel.com>
  • Loading branch information
Lenny Goodell authored Jan 11, 2023
1 parent a0e8a3c commit fd65586
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 162 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/edgexfoundry/app-service-configurable

go 1.18

require github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.11
require github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.15

require (
bitbucket.org/bertimus9/systemstat v0.5.0 // indirect
Expand All @@ -11,10 +11,10 @@ require (
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/diegoholiveira/jsonlogic/v3 v3.2.6 // indirect
github.com/eclipse/paho.mqtt.golang v1.4.2 // indirect
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.5 // indirect
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.7 // indirect
github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.2 // indirect
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.2 // indirect
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.2 // indirect
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.3 // indirect
github.com/edgexfoundry/go-mod-registry/v3 v3.0.0-dev.3 // indirect
github.com/edgexfoundry/go-mod-secrets/v3 v3.0.0-dev.1 // indirect
github.com/fatih/color v1.9.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ github.com/diegoholiveira/jsonlogic/v3 v3.2.6 h1:EV607wRY72hT3V90ZOQw+zjXR9KIUV9
github.com/diegoholiveira/jsonlogic/v3 v3.2.6/go.mod h1:9oE8z9G+0OMxOoLHF3fhek3KuqD5CBqM0B6XFL08MSg=
github.com/eclipse/paho.mqtt.golang v1.4.2 h1:66wOzfUHSSI1zamx7jR6yMEI5EuHnT1G6rNA5PM12m4=
github.com/eclipse/paho.mqtt.golang v1.4.2/go.mod h1:JGt0RsEwEX+Xa/agj90YJ9d9DH2b7upDZMK9HRbFvCA=
github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.11 h1:0TMi4ZOFssWd/WnaPZlgoJTTvUZFknZTqcSJ7WH+S9s=
github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.11/go.mod h1:rDrEMtfZDpnDXR4ocLNi+9IowvjqpRaTGHVgkKU+WpY=
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.5 h1:3WMWQ0oi++KFrau/e8BOTqgzORCa3G7bLG0w/wO72Io=
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.5/go.mod h1:cGXMUtbbzw+npJpMcFHPlXIN+ZPF71aiimhJ6v8kaSc=
github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.15 h1:dJnD514JgWFYKOMVFJtiwDgM34622Zdbxe/bmEC0xVw=
github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.15/go.mod h1:Tx5zi/LgGvjElKzwCFaHWRSFYGBpVII7rOxB0BwYvvg=
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.7 h1:e0H7V7aFl9vC06ZUUQUzNpjqTQWs/XvdV/EKmk8zF/E=
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.7/go.mod h1:yW5dumg9IyfrHx4NYC5Ii0WVVB5OjTXQ/8/NkHHif5Q=
github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.2 h1:xp5MsP+qf/fuJxy8fT7k1N+c4j4C6w04qMCBXm6id7o=
github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.2/go.mod h1:1Vv4uWAo6r7k6jUlqVJW8JOL6YKVBc6sRL8Al3DrMck=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.2 h1:tleTxhbBISfDNn596rU71n+GOy27dMIme+v8Vl0uhpw=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.2/go.mod h1:7RwSq896VqelvSU7zYKs2tpZhgELVFECkiGf6XGLKfQ=
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.2 h1:bNXJHfxTo/1SzQbiJQUnySUGVP5i2FNwFsXQ+RzqR8Q=
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.2/go.mod h1:G0Vxoc8+JXwUqRH5ggyOZ/f/CIVPTswI5Ld7dI5uhIY=
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.3 h1:+el2HxEt02uFXXBmHK8gWETPklNbPg4wvYln/4/ooHo=
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.3/go.mod h1:G0Vxoc8+JXwUqRH5ggyOZ/f/CIVPTswI5Ld7dI5uhIY=
github.com/edgexfoundry/go-mod-registry/v3 v3.0.0-dev.3 h1:QgZF9f70Cwpvkjw3tP1aiVGHc+yNFJNzW6hO8pDs3fg=
github.com/edgexfoundry/go-mod-registry/v3 v3.0.0-dev.3/go.mod h1:2w8v0sv+i21nY+DY6JV4PFxsNTuxpGAjlNFlFMTfZkk=
github.com/edgexfoundry/go-mod-secrets/v3 v3.0.0-dev.1 h1:dib+mZUuHqwVHt9pKAWC4lh60Fbc+6vKrD919LaknwI=
Expand Down
3 changes: 3 additions & 0 deletions res/external-mqtt-trigger/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ TokenFile = "/tmp/edgex/secrets/app-external-mqtt-trigger/secrets-token.json"
Host = "localhost"
Port = 59881

[MessageBus]
Disabled = true

[Trigger]
Type="external-mqtt"
[Trigger.ExternalMqtt]
Expand Down
3 changes: 3 additions & 0 deletions res/functional-tests/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,8 @@ TokenFile = "/tmp/edgex/secrets/app-functional-tests/secrets-token.json"
EndpointSocket = "/tmp/edgex/secrets/spiffe/public/api.sock"
RequiredSecrets = "redisdb"

[MessageBus]
Disabled = true

[Trigger]
Type="http"
61 changes: 30 additions & 31 deletions res/http-export/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -175,36 +175,35 @@ TokenFile = "/tmp/edgex/secrets/app-http-export/secrets-token.json"
Host = "localhost"
Port = 59881

[MessageBus]
Disabled = false # Set to true if not using edgex-messagebus Trigger below and don't want Metrics or Commands via MessageBus
Protocol = "redis"
Host = "localhost"
Port = 6379
Type = "redis"
AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure).
SecretName = "redisdb"
[MessageBus.Topics]
SubscribeTopics = "edgex/events/#"
[MessageBus.Optional]
# Default MQTT Specific options that need to be here to enable evnironment variable overrides of them
ClientId ="app-http-export"
Qos = "0" # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
KeepAlive = "10" # Seconds (must be 2 or greater)
Retained = "false"
AutoReconnect = "true"
ConnectTimeout = "5" # Seconds
SkipCertVerify = "false"
# Additional Default NATS Specific options that need to be here to enable evnironment variable overrides of them
Format = "nats"
RetryOnFailedConnect = "true"
QueueGroup = ""
Durable = ""
AutoProvision = "true"
Deliver = "new"
DefaultPubRetryAttempts = "2"
Subject = "edgex/#" # Required for NATS Jetstram only for stream autoprovsioning

[Trigger]
Type="edgex-messagebus"
[Trigger.EdgexMessageBus]
Type = "redis"
[Trigger.EdgexMessageBus.SubscribeHost]
Host = "localhost"
Port = 6379
Protocol = "redis"
SubscribeTopics="edgex/events/#"
[Trigger.EdgexMessageBus.PublishHost]
Host = "localhost"
Port = 6379
Protocol = "redis"
[Trigger.EdgexMessageBus.Optional]
authmode = "usernamepassword" # required for redis messagebus (secure or insecure).
secretname = "redisdb"
# Default MQTT Specific options that need to be here to enable environment variable overrides of them
ClientId ="app-http-export"
Qos = "0" # Quality of Service values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
KeepAlive = "10" # Seconds (must be 2 or greater)
Retained = "false"
AutoReconnect = "true"
ConnectTimeout = "5" # Seconds
SkipCertVerify = "false"
# Default NATS Specific options that need to be here to enable environment variable overrides of them
Format = "nats"
RetryOnFailedConnect = "true"
QueueGroup = ""
Durable = ""
AutoProvision = "true"
Deliver = "new"
DefaultPubRetryAttempts = "2"
Subject = "edgex/#" # Required for NATS JetStream only for stream auto provisioning

56 changes: 29 additions & 27 deletions res/metrics-influxdb/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,32 +108,34 @@ TokenFile = "/tmp/edgex/secrets/app-metrics-influxdb/secrets-token.json"
Host = "localhost"
Port = 59881

[MessageBus]
Disabled = false # Set to true if not using edgex-messagebus Trigger below and don't want Metrics or Commands via MessageBus
Protocol = "redis"
Host = "localhost"
Port = 6379
Type = "redis"
AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure).
SecretName = "redisdb"
[MessageBus.Topics]
SubscribeTopics = "edgex/telemetry/#"
[MessageBus.Optional]
# Default MQTT Specific options that need to be here to enable evnironment variable overrides of them
ClientId ="app-metrics-influxdb"
Qos = "0" # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
KeepAlive = "10" # Seconds (must be 2 or greater)
Retained = "false"
AutoReconnect = "true"
ConnectTimeout = "5" # Seconds
SkipCertVerify = "false"
# Additional Default NATS Specific options that need to be here to enable evnironment variable overrides of them
Format = "nats"
RetryOnFailedConnect = "true"
QueueGroup = ""
Durable = ""
AutoProvision = "true"
Deliver = "new"
DefaultPubRetryAttempts = "2"
Subject = "edgex/#" # Required for NATS Jetstram only for stream autoprovsioning

[Trigger]
Type="edgex-messagebus"
[Trigger.EdgexMessageBus]
Type = "redis"
[Trigger.EdgexMessageBus.SubscribeHost]
Host = "localhost"
Port = 6379
Protocol = "redis"
SubscribeTopics="edgex/telemetry/#"
[Trigger.EdgexMessageBus.Optional]
authmode = "usernamepassword" # required for redis messagebus (secure or insecure).
secretname = "redisdb"
# Default MQTT Specific options that need to be here to enable environment variable overrides of them
ClientId ="app-metrics-influxdb"
Qos = "0" # Quality of Service values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
KeepAlive = "10" # Seconds (must be 2 or greater)
Retained = "false"
AutoReconnect = "true"
ConnectTimeout = "5" # Seconds
SkipCertVerify = "false"
# Default NATS Specific options that need to be here to enable environment variable overrides of them
Format = "nats"
RetryOnFailedConnect = "true"
QueueGroup = ""
Durable = ""
AutoProvision = "true"
Deliver = "new"
DefaultPubRetryAttempts = "2"
Subject = "edgex/#" # Required for NATS JetStream only for stream auto provisioning
60 changes: 29 additions & 31 deletions res/mqtt-export/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -167,36 +167,34 @@ TokenFile = "/tmp/edgex/secrets/app-mqtt-export/secrets-token.json"
Host = "localhost"
Port = 59881

[MessageBus]
Disabled = false # Set to true if not using edgex-messagebus Trigger below and don't want Metrics or Commands via MessageBus
Protocol = "redis"
Host = "localhost"
Port = 6379
Type = "redis"
AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure).
SecretName = "redisdb"
[MessageBus.Topics]
SubscribeTopics = "edgex/events/#"
[MessageBus.Optional]
# Default MQTT Specific options that need to be here to enable evnironment variable overrides of them
ClientId ="app-mqtt-export"
Qos = "0" # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
KeepAlive = "10" # Seconds (must be 2 or greater)
Retained = "false"
AutoReconnect = "true"
ConnectTimeout = "5" # Seconds
SkipCertVerify = "false"
# Additional Default NATS Specific options that need to be here to enable evnironment variable overrides of them
Format = "nats"
RetryOnFailedConnect = "true"
QueueGroup = ""
Durable = ""
AutoProvision = "true"
Deliver = "new"
DefaultPubRetryAttempts = "2"
Subject = "edgex/#" # Required for NATS Jetstram only for stream autoprovsioning

[Trigger]
Type="edgex-messagebus"
[Trigger.EdgexMessageBus]
Type = "redis"
[Trigger.EdgexMessageBus.SubscribeHost]
Host = "localhost"
Port = 6379
Protocol = "redis"
SubscribeTopics="edgex/events/#"
[Trigger.EdgexMessageBus.PublishHost]
Host = "localhost"
Port = 6379
Protocol = "redis"
[Trigger.EdgexMessageBus.Optional]
authmode = "usernamepassword" # required for redis messagebus (secure or insecure).
secretname = "redisdb"
# Default MQTT Specific options that need to be here to enable environment variable overrides of them
ClientId ="app-mqtt-export"
Qos = "0" # Quality of Service values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
KeepAlive = "10" # Seconds (must be 2 or greater)
Retained = "false"
AutoReconnect = "true"
ConnectTimeout = "5" # Seconds
SkipCertVerify = "false"
# Default NATS Specific options that need to be here to enable environment variable overrides of them
Format = "nats"
RetryOnFailedConnect = "true"
QueueGroup = ""
Durable = ""
AutoProvision = "true"
Deliver = "new"
DefaultPubRetryAttempts = "2"
Subject = "edgex/#" # Required for NATS JetStream only for stream auto provisioning
3 changes: 3 additions & 0 deletions res/push-to-core/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,8 @@ TokenFile = "/tmp/edgex/secrets/app-push-to-core/secrets-token.json"
EndpointSocket = "/tmp/edgex/secrets/spiffe/public/api.sock"
RequiredSecrets = "redisdb"

[MessageBus]
Disabled = true

[Trigger]
Type="http"
61 changes: 29 additions & 32 deletions res/rules-engine/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,38 +115,35 @@ TokenFile = "/tmp/edgex/secrets/app-rules-engine/secrets-token.json"
Host = "localhost"
Port = 59881

[MessageBus]
Disabled = false # Set to true if not using edgex-messagebus Trigger below and don't want Metrics or Commands via MessageBus
Protocol = "redis"
Host = "localhost"
Port = 6379
Type = "redis"
AuthMode = "usernamepassword" # required for redis messagebus (secure or insecure).
SecretName = "redisdb"
[MessageBus.Topics]
SubscribeTopics = "edgex/events/#"
PublishTopic="rules-events"
[MessageBus.Optional]
# Default MQTT Specific options that need to be here to enable evnironment variable overrides of them
ClientId ="app-rules-engine"
Qos = "0" # Quality of Sevice values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
KeepAlive = "10" # Seconds (must be 2 or greater)
Retained = "false"
AutoReconnect = "true"
ConnectTimeout = "5" # Seconds
SkipCertVerify = "false"
# Additional Default NATS Specific options that need to be here to enable evnironment variable overrides of them
Format = "nats"
RetryOnFailedConnect = "true"
QueueGroup = ""
Durable = ""
AutoProvision = "true"
Deliver = "new"
DefaultPubRetryAttempts = "2"
Subject = "edgex/#" # Required for NATS Jetstram only for stream autoprovsioning

[Trigger]
Type="edgex-messagebus"
[Trigger.EdgexMessageBus]
Type = "redis"
[Trigger.EdgexMessageBus.SubscribeHost]
Host = "localhost"
Port = 6379
Protocol = "redis"
SubscribeTopics="edgex/events/#"
[Trigger.EdgexMessageBus.PublishHost]
Host = "localhost"
Port = 6379
Protocol = "redis"
PublishTopic="rules-events"
[Trigger.EdgexMessageBus.Optional]
authmode = "usernamepassword" # required for redis messagebus (secure or insecure).
secretname = "redisdb"
# Default MQTT Specific options that need to be here to enable environment variable overrides of them
ClientId ="app-rules-engine"
Qos = "0" # Quality of Service values are 0 (At most once), 1 (At least once) or 2 (Exactly once)
KeepAlive = "10" # Seconds (must be 2 or greater)
Retained = "false"
AutoReconnect = "true"
ConnectTimeout = "5" # Seconds
SkipCertVerify = "false"
# Default NATS Specific options that need to be here to enable environment variable overrides of them
Format = "nats"
RetryOnFailedConnect = "true"
QueueGroup = ""
Durable = ""
AutoProvision = "true"
Deliver = "new"
DefaultPubRetryAttempts = "2"
Subject = "edgex/#" # Required for NATS JetStream only for stream auto provisioning
Loading

0 comments on commit fd65586

Please sign in to comment.