From 0d101ae6821c8ff83b48d3de973276031649eb12 Mon Sep 17 00:00:00 2001 From: Lenny Goodell Date: Wed, 8 Mar 2023 14:07:07 -0700 Subject: [PATCH] refactor!: Replace internal topics from config with new constants and 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 --- Attribution.txt | 8 +++++++- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- res/configuration.toml | 9 ++------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Attribution.txt b/Attribution.txt index 0be70536..0b46f9b5 100644 --- a/Attribution.txt +++ b/Attribution.txt @@ -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 \ No newline at end of file +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 diff --git a/go.mod b/go.mod index 7b699f08..b62d8b50 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 diff --git a/go.sum b/go.sum index 0f95f939..dab3adcf 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/res/configuration.toml b/res/configuration.toml index 708d75ac..23ab60f2 100644 --- a/res/configuration.toml +++ b/res/configuration.toml @@ -9,15 +9,8 @@ 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" @@ -25,6 +18,8 @@ StartupMsg = "RFID LLRP Inventory Service" [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