-
Notifications
You must be signed in to change notification settings - Fork 53
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
Use normal JSON object in message envelope payload instead of base64 #381
Comments
Looking at the existing message envelope, it provides two things that I think we can get by other means:
so I think we can remove the envelope as is suggested in this issue. Would we want to combine this with optional stripped-down event formats? We have some ideas around that but no fully-thought-through design as far as I know. For example, we could have the event contain only a list of {resource name, value, timestamp}, event recipients could get the device name from the topic and get resource type etc. information by looking up the device profile if needed. |
@eaton-coreymutter I just updated the description to include a clear example. |
I think it is a great idea to remove the base64 embedded message, as it makes readability very difficult without cutting and pasting into base64 decoders, and the fact that this is prevalent throughout so many APIs it is a developer's burden to use. My primary concern is that in Cloud's example the ContentType doesn't help to distinguish what format the payload would be (requiring Corey's payload examination to guess the format). Third party clients of the API will not know what was configured at run time. So this may require another field for the encoding. A few years ago I tried to raise the idea of using the CNCF standard CloudEvents (cloudevents.io) as they have really thought through the message/payload obstacles. If we were to make a breaking change I would just as soon adopt that standard than keep making our own path. From google: https://www.googlecloudcommunity.com/gc/Cloud-Product-Articles/Anatomy-of-a-CloudEvents-and-its-relevance-with-SAP-and-Google/ta-p/669542 |
We may use |
Understood - but my point is that a third party without access to the environment variable will have to deduce the payload format as Corey explained: evaluating characters to guess JSON vs base64. |
If the third party service consume the original message envelope (base64), they should set EdgeX env |
🚀 Feature Request
Relevant Package [REQUIRED]
This feature request is for allDescription [REQUIRED]
By default, Golang marshall the payload to base64 string, and it consumes much more memory
go-mod-messaging/pkg/types/message_envelope.go
Line 45 in 5dabfa0
It's more efficient and easier if the payload is a normal JSON
Describe the solution you'd like
Add a new configuration and environment variable to use the message payload with normal JSON object instead of base64 string
example from the original message:
propse to change to:
The text was updated successfully, but these errors were encountered: