-
Notifications
You must be signed in to change notification settings - Fork 4
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
MessageHandler interface enhancements #18
Comments
|
I agree with you, @e-grigorov. But I also have some comments:
|
stoyan-zoubev
added a commit
to SoftwareDefinedVehicle/kanto-azure-connector
that referenced
this issue
Oct 13, 2022
- Separate interfaces for c2d and d2c messages - CommandHandler and TelemetryHandler - Removed AzureSettings parameter from handler Init method, static parameters should be passed to handler constructors. - MessageHandler.Init method receives cloud connection info only (this is data that may not be known at the time of handler creation) - Device ID, Hostname, etc. - Simplified test methods Signed-off-by: Stoyan Zoubev <[email protected]>
stoyan-zoubev
added a commit
to SoftwareDefinedVehicle/kanto-azure-connector
that referenced
this issue
Oct 14, 2022
Fixed PR review comments. - CloudConnectionInfo is not a pointer inside AzureConnectionSettings - fixed typo Signed-off-by: Stoyan Zoubev <[email protected]>
stoyan-zoubev
added a commit
to SoftwareDefinedVehicle/kanto-azure-connector
that referenced
this issue
Oct 14, 2022
Fixed PR review comments. - CloudConnectionInfo renamed to RemoteConnectionInfo - SharedAccessKey struct removed, not really needed (SharedAccessKeyName is not applicable for Azure IoT Hub device connection string. - SharedAccessKey is now just a []byte field. Signed-off-by: Stoyan Zoubev <[email protected]>
stoyan-zoubev
added a commit
to SoftwareDefinedVehicle/kanto-azure-connector
that referenced
this issue
Oct 14, 2022
Fixed PR review comments. - CloudConnectionInfo renamed to RemoteConnectionInfo - SharedAccessKey struct removed, not really needed (SharedAccessKeyName is not applicable for Azure IoT Hub device connection string. - SharedAccessKey is now just a []byte field. Signed-off-by: Stoyan Zoubev <[email protected]>
stoyan-zoubev
added a commit
to SoftwareDefinedVehicle/kanto-azure-connector
that referenced
this issue
Oct 14, 2022
Fixed PR review comments. - CloudConnectionInfo renamed to RemoteConnectionInfo - SharedAccessKey struct removed, not really needed (SharedAccessKeyName is not applicable for Azure IoT Hub device connection string. - SharedAccessKey is now just a []byte field. Signed-off-by: Stoyan Zoubev <[email protected]>
e-grigorov
pushed a commit
that referenced
this issue
Oct 14, 2022
[#18] MessageHandler interface enhancements - Separate interfaces for c2d and d2c messages - CommandHandler and TelemetryHandler - Removed AzureSettings parameter from handler Init method, static parameters should be passed to handler constructors. - MessageHandler.Init method receives cloud connection info only (this is data that may not be known at the time of handler creation) - Device ID, Hostname, etc. - Simplified test methods Signed-off-by: Stoyan Zoubev <[email protected]>
Repository owner
moved this from In Review
to Done
in Eclipse Kanto
Oct 14, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the current version of the
MessageHandler
interface:First, it is used in both directions - cloud-to-device (command) messages and device-to-cloud (telemetry) messages. However, not all methods apply to both directions, e.g. communication between the device and Azure IoT Hub goes on with strictly-defined topics, so in case of cloud-to-device messaging
MessageHandler.Topics()
is never used. It is only used in case of device-to-cloud messages in order to specify local topics for subscriptions. It is better to have a clear separation between command and telemetry handler interfaces.Second, the handler registries required handlers to be instantiates empty and
Init
method to receive settings. If pluggability is improved with [#17 Improve message handler pluggability] then this no longer be needed and handler settings can be passed to handler constructor methods.Init
method may remain and receive only data that is not yet known upon handler creation -AzureConnectionSettings
, or even better a subset of this structure with only useful data for message handlers - e.g. device connection info like device ID, Azure IoT hub name, hostname.Additionally, on the
Topics
method - the underlying watermill library method uses typestring
, not[]string
. It is preferred to align the interface with the library by modifying the return type and avoid unnecessary conversions.Proposal:
where
config.DeviceInfo
is the device connection data in subset structure in config package:Also, the
handlers.go
source file may be moved directly intorouting/messages/handlers
directory, package handlers and get rid ofcommon
package.The text was updated successfully, but these errors were encountered: