Skip to content

Commit

Permalink
refactor!: Replace internal topics from config with new constants and…
Browse files Browse the repository at this point in the history
… use base topic (#154)

BREAKING CHANGE: Internal topics no longer configurable, except the base topic. Trigger topics for edgex-messagebus and external-mqtt now directly under Trigger section. All configured topics (subscribe and function pipeline) now automatically have the base topic (default of "edgex/") prepended.

Signed-off-by: Leonard Goodell <[email protected]>
  • Loading branch information
Lenny Goodell authored Mar 8, 2023
1 parent 0e6798d commit 0d101ae
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
8 changes: 7 additions & 1 deletion Attribution.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,10 @@ github.com/nats-io/nkeys (Apache-2.0) https://github.com/nats-io/nkeys
https://github.com/nats-io/nkeys/blob/master/LICENSE

github.com/nats-io/nuid (Apache-2.0) https://github.com/nats-io/nuid
https://github.com/nats-io/nuid/blob/master/LICENSE
https://github.com/nats-io/nuid/blob/master/LICENSE

golang.org/x/mod (BSD-3) https://github.com/golang/mod
https://github.com/golang/mod/blob/master/LICENSE

golang.org/x/tools (BSD-3) https://github.com/golang/tools
https://github.com/golang/tools/blob/master/LICENSE
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module edgexfoundry/app-rfid-llrp-inventory
go 1.18

require (
github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.29
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.10
github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.31
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.14
github.com/google/uuid v1.3.0
github.com/gorilla/mux v1.8.0
github.com/pkg/errors v0.9.1
Expand All @@ -18,9 +18,9 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/diegoholiveira/jsonlogic/v3 v3.2.7 // indirect
github.com/eclipse/paho.mqtt.golang v1.4.2 // indirect
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.22 // indirect
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.24 // indirect
github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.3 // indirect
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.7 // indirect
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.9 // 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.7 // indirect
github.com/fatih/color v1.9.0 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ github.com/diegoholiveira/jsonlogic/v3 v3.2.7 h1:awX07pFPnlntZzRNBcO4a2Ivxa77NMt
github.com/diegoholiveira/jsonlogic/v3 v3.2.7/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.29 h1:9Qtfvkk5NRPfMpjg1emn98g/JnTjqC9MFrCNasJdmhY=
github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.29/go.mod h1:pYkbsBEQP2JXFo1QXyxUGpXJK+KTaqMNEOmSQaexV0o=
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.22 h1:DrtTbcDU6VMoMmsAn9tQpxQ+MIwgtSBmSwuZLgFuDEQ=
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.22/go.mod h1:rVklwwUju+/MGOij+KJeBJZ+/HIo6YsQwlFv7UmsA+8=
github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.31 h1:hivdzLAGSlzE+pBHjPrKtw0R6F9Sj5gL9vknEHKreKY=
github.com/edgexfoundry/app-functions-sdk-go/v3 v3.0.0-dev.31/go.mod h1:AZvJxuxhvwUuV/UIZTE0sb2/ydB7wFtn1ywTd789irI=
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.24 h1:H9MC0ahbkMw4w1SHeX6/GVR5tC6E+Bz6ZiPECmnzO3c=
github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.24/go.mod h1:iv/czxi4ciFWMgrO+3nnanGfkT2X1QW5L3iCb+deewk=
github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.3 h1:0Ew4PzLSFJ+sb7AYtvb9m1mRN45Sh0ELU1HdMCel5t8=
github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.3/go.mod h1:ESOWI4GokQfQ3Bn2hGsdfOVx5idj7QEdCPT/SAQDd9M=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.10 h1:o5yenvmLn8+0AOz0d5GIek011Tt5ZRbvPlgE4VhozEU=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.10/go.mod h1:4lpZUM54ZareGU/yuAJvLEw0BoJ43SvCj1LO+gsKm9c=
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.7 h1:jgDQA/7SENURXQkIX11pNgA/pX9IK9ZULenj/vF17Vw=
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.7/go.mod h1:r6Klfz+QBDx1Z5UV0z70MKdK2/cgHwhtqTm2HFXoWug=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.14 h1:o7CFEIyKn/quin5lrAlUbUu9x1dnecK0tZs5waLhdCc=
github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.14/go.mod h1:4lpZUM54ZareGU/yuAJvLEw0BoJ43SvCj1LO+gsKm9c=
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.9 h1:CUUieXQ8roD4M770GXj1he707V3V9Jiygk302+dwvKk=
github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.9/go.mod h1:iKBxmZkc7jdOrT99+IR1nyg7PlRgooAQMhZxDh2mTUQ=
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.7 h1:9Mn389IHlgoPgGUpwnLzoe/shylkQI+nXI3E/AfnYDA=
Expand Down
9 changes: 2 additions & 7 deletions res/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,17 @@ StartupMsg = "RFID LLRP Inventory Service"
[Clients.core-command]
UseMessageBus = true
[Clients.core-command.Topics]
QueryRequestTopicPrefix = "edgex/core/commandquery/request"
QueryResponseTopic = "edgex/core/commandquery/response"
CommandRequestTopicPrefix = "edgex/core/command/request"
CommandResponseTopic = "edgex/core/command/response/#"

[MessageBus]
[MessageBus.Topics]
SubscribeTopics = "edgex/events/+/device-rfid-llrp/+/+/ROAccessReport,edgex/events/+/device-rfid-llrp/+/+/ReaderEventNotification"
PublishTopic="edgex/events/device/app-rfid-llrp/{profilename}/{devicename}/{sourcename}" # publish to same topic format the Device Services use
[MessageBus.Optional]
# Default MQTT Specific options that need to be here to enable evnironment variable overrides of them
ClientId ="app-rfid-llrp-inventory"

[Trigger]
# Note that the MessaegBus connection above is used by edgex-messagebus trigger
Type="edgex-messagebus"
SubscribeTopics = "events/+/device-rfid-llrp/+/+/ROAccessReport,edgex/events/+/device-rfid-llrp/+/+/ReaderEventNotification"
PublishTopic="events/device/app-rfid-llrp/{profilename}/{devicename}/{sourcename}" # publish to same topic format the Device Services use

[AppCustom]
# Every device(reader) + antenna port represents a tag location and can be assigned an alias
Expand Down

0 comments on commit 0d101ae

Please sign in to comment.