Is there any reason, why the resource path for command & control responses doesn't match the ResourceIdentifier?
Seems that close to no adapter is using it. It makes pain for command and control, so is it OK to remove that from the CoAP adapter?
@boaks what exactly do you mean here (what should match what)?
The ResourceIdentifier maps the resource-path to tenant id and device id.
Though Command and Control responses inserted "res" into the path before them, it's not working for command and control resource paths.
e.g.:
http://127.0.0.1:8080/event/DEFAULT_TENANT/4711
http://127.0.0.1:8080/command/res/DEFAULT_TENANT/4711/req-id-uuid?hono-cmd-status=200
So my impression: the usage of that ResourceIdentifier is not longer intended.
The ResourceIdentifier class is primarily used for the telemetry, event, command and command_response AMQP endpoints in Hono, using addresses of the basic scheme <endpoint>/[tenant]/[resource-id].
The resource path command/res/DEFAULT_TENANT/4711/req-id-uuid?hono-cmd-status=200 you mentioned above (used also in the HTTP adapter), doesn't fit into this scheme, yes. But the ResourceIdentifier class isn't intended to be used with such a path. Do you see an issue somewhere in the existing code in that regard?
Not in the http code.
But coap now either must differ from http or adapt the usage of that ResourceIdentifier.
@boaks can this be closed?
If it's OK to remove that ResourceIdentifier from VertxBasedCoapAdapter.getExtendedDevice(CoapExchange exchange), then we can close it.
FMPOV there is no need to repeat the mistake that we made with the HTTP adapter when we put the res into the the resource path for sending a command response. For the CoAP adapter we could as well use something like
command_response/$TENANT/$DEVICE_ID/$REQUEST_ID[?$QUERY_PARAMS]
That would allow us to use ResourceIdentifier as-is, wouldn't it?
WDYT @boaks @calohmn ?
For me this will be OK.
I adapt my PR accordingly.
The PR is adapted.
Most helpful comment
FMPOV there is no need to repeat the mistake that we made with the HTTP adapter when we put the
resinto the the resource path for sending a command response. For the CoAP adapter we could as well use something likecommand_response/$TENANT/$DEVICE_ID/$REQUEST_ID[?$QUERY_PARAMS]That would allow us to use
ResourceIdentifieras-is, wouldn't it?WDYT @boaks @calohmn ?