-
Notifications
You must be signed in to change notification settings - Fork 265
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
NGSIv2 based forwarding for CPrs #3068
Comments
Two important things, major drawbacks in v1 forwards:
|
Any update on this? |
We have been recently talking about this @dcalvoalonso @jmcanterafonseca and me so your comment is very timely :) There is a proposal for forwarding in NGSIv2 (described at FIWARE/specifications#2) but it is too complex to be implemented at once. Thus, we are going to opt to implement something simpler in the first step but compatible with the specification if at the end we decide to do a full implementation. In particular, NGSIv1 forwarding is based in the following operations:
So in a first step we are going just to change there for their NGSIv2 counteparts:
Note that they are the same operations described in the full proposal (https://github.com/Fiware/specifications/blob/5a83a7117bb5cb952546c385b900055dbb0a0417/ContextSource_Forwarding/contextsource_forwarding_spec.md#context-source-interface) so they should be compatible in the future. @jaimeventura maybe you want to help in this (given that you benefit from it in your CPr implementation)? The task of implementing the new forwarding is not very complex and I can guide during the process. Do you have background in C/C++? |
More detail on the operations to implement:
|
My first doubt about forwarding is the following: Different possibilities:
I always prefer the method that gives the most liberty to the user, in this case, the third option, where the "registrator" decides what protocol to use for the forwarded messages. |
legacyForwarding: false will indicate that v2 should be used, right?
|
Ah, great. Totally forgot about "legacyForwarding". |
Correct. In addition, omitting legacyForwarding field also indicates that v2 should be used. |
PR #3467 implements NGSIv2 based forwarding for queries with basic .test coverage. What is pending after that PR is:
|
Correct. It was a typo. Now fixed above. |
As part of telefonicaid/iotagent-node-lib#762, I am doing some integrations tests of this PR with some IOTAs. In particular, I am working with the LWM2M IoT Agent. You can check the WIP PR in telefonicaid/lightweightm2m-iotagent#186. I think that there is a problem with entities containing attributes with spaces in the name. For instance, using in the registration: {
"url": "http://localhost:1026/v2/registrations",
"method": "POST",
"json": {
"dataProvided": {
"entities": [
{
"type": "Light",
"id": "TestClient:Light"
}
],
"attrs": [
"luminescence"
]
},
"provider": {
"http": {
"url": "http://localhost:4041/v2"
}
},
"expires": "2019-05-10T09:44:02.907Z"
},
"headers": {
"fiware-service": "smartgondor",
"fiware-servicepath": "/gardens"
}
} Then I can do:
And the endpoint in the IoT Agent is correctly called. However, if I use |
Spaces are not allowed in NGSIv2 attribute names (along with other identifiers, please have a look to "Field syntax restrictions" section in the NGSIv2 specification). In fact, you shouldn't be able even to register an attribute like that (CB failing to detect it would be a bug). Could you confirm the response you get when you try to register an registration with |
The issue reported by @dcalvoalonso has been spinned out to #3468 |
Basic NGSIv2 forwarding implemented in Orion 2.3.0. Possible continuation of the work in issue #3485. The present issue gets closed. |
NGSIv2 based forwarding (i.e. forward NGSIv2 queries/updates from CB to CPr, based in existing registrations) has not been yet defined.
First task with regard to this issue is specificaiton of the mechanism. In order to do so, I have recovered some previous discussion on PR #2990 comments that may be useful.
@jmcanterafonseca comment:
@fgalan comment:
Second task regarding this issue is to implement the mechanism in CB.
CC: @dcalvoalonso as the specified mechanism is relevant in the context of the IOTAs NGSIv2 implementation in which you are involved (pasive attributes and commands).
The text was updated successfully, but these errors were encountered: