Fix/clarify handling of empty telemetry/event message payload
See original GitHub issueFrom https://github.com/eclipse/hono/pull/3215#discussion_r857397317:
A device trying to send a telemetry/event message with an empty payload will get a code 400 error if the content type of the message wasn’t set to application/vnd.eclipse-hono-empty-notification
.
That behaviour/requirement is not documented.
It’s not obvious why messages with an empty payload require that content type. Before the introduction of that content-type, empty payloads were even not supported at all (see https://github.com/eclipse/hono/pull/596/files#diff-8a5c90291d6bfbbcbd7ae69c43de9a5a5e77532137e677c23fd3e655545d67c5L489).
At least the documentation should be adapted here.
Issue Analytics
- State:
- Created a year ago
- Comments:15 (15 by maintainers)
Top Results From Across the Web
2.1.0 - GitHub
Fix/clarify handling of empty telemetry/event message payload #3222 opened by calohmn. AMQP Adapter CoAP Adapter HTTP Adapter MQTT Adapter
Read more >IV89802: 'MESSAGE=' (PAYLOAD) IS BLANK FOR ... - IBM
Wincollect version 7.2.4 doesn't display any event payload data after "Message=" when an XPath Query is configured/enabled in a.
Read more >SAP PI Empty Payload handling
Hi All, I am developing a File to Proxy scenario to send some business information. ( PI - 7.5 Single stack ) I...
Read more >Ms Teams Bot Event sending empty ... - Microsoft Community
Hi, I've been creating ms teams app and attaching a bot to it after all the steps has been completed and the bot...
Read more >Client receiving empty payload - webMethods
Did you check the outbound EDIINT message see if it has payload/Inputs shows correctly and Tasks (DONE) no issues there? Also you can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, so then the only change for this issue here and Hono 2.1.0 would be allowing messages with empty payload and any non-null content-type. For Hono 3.0 we could do the change towards allowing an empty content-type along with an empty payload.
Concerning the case that an empty device message with no content-type is received and there is a default configured for the device: If the default is
application/json
for example, setting that content-type for an empty message would result in an inconsistent/invalid message, as an empty payload would not represent valid JSON. Therefore I think it would be better to apply the device-default content type only for non-empty messages.I see your point. AMQP and/or MQTT devices actually have no reason to send empty notifications in the first place.
I can also see the benefit of using the existence of a
hono-ttd
request parameter in conjunction with an empty and empty content type in the HTTP and CoAP adapters. For CoAP and HTTP devices this would allow them to omit the explicit content-type, thus further reducing request message size.I am still not convinced of using
application/octet-stream
as a fallback content type for other empty messages, though. We currently do not support sending empty messages with another content-type thanapplication/vnd.eclipse-hono-empty-notification
at all. So I can also imagine to relax this a little and allow devices to send empty messages with any non-null content type instead. WDYT?