-
Notifications
You must be signed in to change notification settings - Fork 137
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
HTTP-based adapters should be allowed to customize their return http codes #360
Comments
is this only relevant for the case when the upload succeeds, i.e. if the REST adapter responds with a 204? Or do you need to be able to customize the responses to certain error cases as well, e.g. no more downstream credits, device unknown/disabled, no more device registration credits? |
Whoops sorry i overlooked your reply to this. In the specific Sigfox case, its only interested in 200 (yes there is some downlink data) or 204 (nope. no downlink, just uplink). If data is not being sent across etc, you can send back an error like 500 or 404 and this would be shown to the administrator (i.e. the person owning the device) but it won't have any specific meaning to the Sigfox Backend itself. Also I would imagine if the uplink from Sigfox to Hono fails (due to there being no credits), a downlink response is still warranted since a downlink message could have been sent to the adapter say..a day ago and since then all consumers may have left/disconnected BUT the downlink message still needs to be sent down. Does that make sense? |
Hey Hono, Do you folks have any updates on this issue? Oh and a Happy New Year and here's to a successful 0.5! Z |
Hi @zubairhamed, there is currently no one working on this. I think we could address this issue as part of 0.6 where we also want to add support for Gateways publishing data on behalf of other devices (#416). |
Hi @zubairhamed , we would like to support the Use case described by configuration options of the HTTP adapter. Currently there would be no case where an error status code returns a command (but this might change in the future). Since the change is so small, we do not think it is worth to enforce a custom adapter to achieve this, but rather make the returned status code configurable per tenant for:
Would this solve your issue? |
Hey Karsten, I can test this out if this works with 0.6 but yep from the sound of it i believe it does solve it. Z |
Hey Z, cool, thanks for the reply. Let me know if I can assist (or if I shall provide the patch for |
Hey again Z, I just provided a branch called honoSigfoxBranch (https://github.com/eclipse/hono/tree/honoSigfoxBranch), which is hardcoded to Let me know if you need further assistance. |
@zubairhamed : any news regarding this issue? |
Currently, hono seems to implicitly return response directly to the client (e.g. http 200) and there seem not be a way to intercept this so that a custom http-based adapter could customize the http code being sent.
Use-case:
Sigfox, for example expects a 200 response if a downlink (up to 8 bytes of data to be sent to the device) is expected. If no downlink is expected (i.e. no data is to be sent to the device), a 204 should be sent.
The text was updated successfully, but these errors were encountered: