-
Notifications
You must be signed in to change notification settings - Fork 480
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(data): Make Core Data publish events to <TopicPrefix>/<DeviceProfile>/<DeviceName> #3002
Conversation
@lenny-intel All of your comments have been addressed by the second commit 66ea3a1 Please kindly take a look. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, we now just need to resolve the issue of multiple AddEventRequest vs single AddEventRequest published to the MessageBus (JSON & CBOR).
rebased and squashed 2 commits into 1 commit. |
Per discussion over edgexfoundry/edgex-go#3002 (comment), AddEvent V2 API shall be updated to deal with single AddEventRequest DTO instead of AddEventRequest DTO array. As a result, func AddEventReqToEventModels shall be updated accordingly. fix edgexfoundry#429 Signed-off-by: Jude Hung <jude@iotechsys.com>
Per discussion over edgexfoundry/edgex-go#3002 (comment), AddEvent V2 API shall be updated to deal with single AddEventRequest DTO instead of AddEventRequest DTO array. As a result, func AddEventReqToEventModels shall be updated accordingly. fix edgexfoundry#429 Signed-off-by: Jude Hung <jude@iotechsys.com>
Per discussion over edgexfoundry/edgex-go#3002 (comment), AddEvent V2 API shall be updated to deal with single AddEventRequest DTO instead of AddEventRequest DTO array. As a result, func AddEventReqToEventModels shall be updated accordingly. fix edgexfoundry#429 Signed-off-by: Jude Hung <jude@iotechsys.com>
Per discussion over edgexfoundry/edgex-go#3002 (comment), AddEvent V2 API shall be updated to deal with single AddEventRequest DTO instead of AddEventRequest DTO array. As a result, func AddEventReqToEventModels shall be updated accordingly. fix edgexfoundry#429 Signed-off-by: Jude Hung <jude@iotechsys.com>
Per discussion over edgexfoundry#3002 (comment), AddEvent V2 API shall be updated to deal with single AddEventRequest DTO instead of AddEventRequest DTO array. This commit makes such changes. Signed-off-by: Jude Hung <jude@iotechsys.com>
Per discussion over edgexfoundry#3002 (comment), AddEvent V2 API shall be updated to deal with single AddEventRequest DTO instead of AddEventRequest DTO array. This commit makes such changes and also updates the swagger API doc. Signed-off-by: Jude Hung <jude@iotechsys.com>
Per discussion over edgexfoundry#3002 (comment), AddEvent V2 API shall be updated to deal with single AddEventRequest DTO instead of AddEventRequest DTO array. This commit makes such changes and also updates the swagger API doc. Signed-off-by: Jude Hung <jude@iotechsys.com>
Per discussion over edgexfoundry#3002 (comment), AddEvent V2 API shall be updated to deal with single AddEventRequest DTO instead of AddEventRequest DTO array. This commit makes such changes and also updates the swagger API doc. Signed-off-by: Jude Hung <jude@iotechsys.com>
…eName> Per https://github.com/edgexfoundry/edgex-docs/blob/master/docs_src/design/adr/013-Device-Service-Events-Message-Bus.md, Core data shall publish Events to <TopicPrefix>/<DeviceProfile>/<DeviceName>. This commit made following changes: 1. Add new property PublishTopicPrefix into MessageQueue configuration. 2. Update Core Data configuration.toml to add PublishTopicPrefix set it to: PublishTopicPrefix = 'edgex/events' # /<device-profile-name>/<device-name> will be added to this Publish Topic prefix 3. Change V2 Add Event endpoint to be /event/{DeviceProfileName}/{DeviceName} 4. When publishing V2 Event DTO use topic PublishTopicPrefix+ /{DeviceProfileName}/{DeviceName} Update the codes per review comments: 1. Add TODO to remove Topic when V1 code is removed. 2. Remove empty string validation as it will catch by event deive/profile name match check 3. Change validateEvent to ValidateEvent and move the validation to protocal layer(event controller) 4. Remove event id return from apllication layer 5. Update swagger doc for API path changes and profile/device name consistency check 6. Add reader back to event controller, and have AddEvent reuse the reader from event controller. Signed-off-by: Jude Hung <jude@iotechsys.com>
Per discussion over edgexfoundry#3002 (comment), AddEvent V2 API shall be updated to deal with single AddEventRequest DTO instead of AddEventRequest DTO array. This commit makes such changes and also updates the swagger API doc. Signed-off-by: Jude Hung <jude@iotechsys.com>
1. Update go doc for func PublishEvent 2. Update debug log when publishing event on the message queue 3. Update description for core-data V2 swagger API doc Signed-off-by: Jude Hung <jude@iotechsys.com>
rebased and updated code per review comments from Lenny. |
Codecov Report
@@ Coverage Diff @@
## master #3002 +/- ##
==========================================
- Coverage 40.34% 40.27% -0.08%
==========================================
Files 159 159
Lines 13961 13962 +1
==========================================
- Hits 5633 5623 -10
- Misses 7997 8011 +14
+ Partials 331 328 -3
Continue to review full report at Codecov.
|
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Checklist
Please check if your PR fulfills the following requirements:
If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/master/.github/Contributing.md.
What is the current behavior?
Issue Number:
fix #2934
fix #2995
What is the new behavior?
Per https://github.com/edgexfoundry/edgex-docs/blob/master/docs_src/design/adr/013-Device-Service-Events-Message-Bus.md, Core data shall publish Events to //.
This PR made following changes:
Add new property PublishTopicPrefix into MessageQueue configuration.
Update Core Data configuration.toml to add PublishTopicPrefix set it to:
PublishTopicPrefix = 'edgex/events' # // will be added to this Publish Topic prefix
Change V2 Add Event endpoint to be /event/{DeviceProfileName}/{DeviceName}
When publishing V2 Event DTO use topic PublishTopicPrefix+ /{DeviceProfileName}/{DeviceName}
Publish []AddEventRequestDTO instead of single EventDTO to message queue
Does this PR introduce a breaking change?
New Imports