question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix/clarify handling of empty telemetry/event message payload

See original GitHub issue

From 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:closed
  • Created a year ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
calohmncommented, Aug 24, 2022

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 than application/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?

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.

0reactions
sophokles73commented, Aug 24, 2022

It might even be a bit confusing for downstream application developers seeing messages from MQTT/AMQP devices without content type and payload being mapped to the empty-notification content type, when such empty-notification content type messages are otherwise associated with ttd-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 than application/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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found