-
Notifications
You must be signed in to change notification settings - Fork 43
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
notifications on deletion of entities #1307
Comments
Yes, it is documented in the NGSI-.LD API spec v1.6.1. |
Thx for the clarification Ken! We need this feature in Orion-LD, so yes please move its priority higher :-) |
ok! :) |
#280 (Look at the very first line of the ToDo) |
Orion is a full fledged FIWARE GE component. Who is the owner is not actually relevant as far it is open source. The main difference is that Orion implements NGSIv2 with a strong production scenarios commitment while Orion-LD implements NGSI-LD. |
Implemented notifications for "delete entity" in PR #1309 Just one thing, you need to use the "new implementation" for it to work. |
So, please test and let me know (by closing the issue if all is A-OK). The "data" of the notification of a deleted entity looks like this:
|
I can certainly do some testing. And also looking forward to test the performance improvements. |
Just use the lat4est you can find (nota bene, don't ever use the tag "latest", unless it's pure testing) |
I switched from 1.1.1 to 1.2.0-PRE-1247 and added -experimental and I'm facing issues with subscriptions. Need to dig some deeper, but after removing all subscriptions manually from the DB and restarting everything, I don't get any updates anymore. |
I heard about subscription problems elsewhere, just a few hours ago. |
I created new issues for the subscription problems: |
Hi @kzangeli, I was trying out the delete notification on the latest version of the orion-ld (docker container), and I noticed that the notification sent by the context broker does not forward the fiware-correlator. I use the fiware-correlator to implement a mechanism that prevents a context producer from receiving (through subscription) the updates that itself has generated. Basically it prevents self notification loops. I use this solution since, as far as I know, orion-ld does not provide such function out-of-the-box, correct? Could you add forwarding for the fiware-correlator in delete notifications? It is very useful to me. Thank you very much, P.S: I have also seen that in the Planning you have the "fiware-correlator" in the priority discussions list where you are evaluating whether you need it or not. As I have mentioned, I need it for the purpose I have illustrated above. Will you keep the fiware-correlator? If not, how could I implement a self-notification loop protection? Thank you very much again |
ok, sure, I can do that. |
Ok, thank you very much, appreciated.
Ok, thank you again! |
So, I looked into this and the mechanism I mentioned (for any header to be included in a forwarded message) is the receiverInfo key-value array in the Subscription. We implemented a special string ("urn:ngsi-ld:request") so that the broker would instead of blindly copy the value from the subscription, instead take the value from the initial request (the creation/update that triggered the notification), and thus have "real forwarding" of HTTP headers. BUT, we did that only for distributed opertations. Anyway, I contacted my colleagues in ETSI ISG CIM (where we define the NGSI-LD API) and we agreed to add this feature also to notifications. So, I went ahead and implemented it. The PR should be in by tonight. This is how to use it (tailor-made for FIWARE-Correlator, but works for any header): In your subscription, use the field "receiverInfo".
The part you need to use is the "notification::endpoint::receiverInfo::FIWARE-Correlator" |
Great! I look forward to trying it out |
Hi @kzangeli, I was testing the latest version. Whilst I can see the FIWARE-Correlator forwarded in the notifications for creation and update requests I still cannot see it for the deletion requests. |
ok, never tested that. Just to clarify, you mean you don't get the header in the notification triggered by the delete request, right? |
Exactly, I set the header in the deletion request but I don't see it arriving in the notification triggered by the delete request. |
So, I extended the functest I had for notifications on deletion of entities to include a FIWARE-Correlator header
So, not able to reproduce. Paste your complete payload for creation of the subscription and deletion of the entity. |
Hi @kzangeli, I've tested it again but I found a strange behaviour. Here are the requests that I make with curl and a description of what happens Subscription
This is the payload you used. I've only removed 'id' from the 'entities' object and changed the type to 'Room' Entity Creation
Entity Deletion Here is what happens. However, when I send the deletion request this is what I get:
This time I see the FIWARE-Correlator but there's also "H1: 123" appended to that header and I don't see the other two I've also tried starting again from scratch and if I remove H1, H2 and H3 from the subscription payload and try to delete the entity again, this time I don't receive the notification at all. Thank you again |
Ok, that clearly looks like a bug. |
Another thing I'm noticing in the Orion-LD logs for the deletion notification is:
while in the other cases it says "notification sent successfully" |
Yeah, that last thing is nothing to worry about. |
Found the other thing. It's a bug. IDIOT bug ! I was just "lucky" that in my functest I used an example "FIWARE-Correlator: abc", the string is shorter than is was (with "urn:ngsi-ld:request"). Your example uses a longer value and of course, it provokes a memory corruption. Stupid mistake, easy fix (recalculate the total length), ready in an hour or so. |
The PR has been merged. Please test and let me know |
Ok, tested it and it works! I tried both with only the FIWARE-Correlator header in receiverInfo and also with the other three H1, H2 and H3. The behaviour is as expected. Thank you very much again @kzangeli! |
ok, happy to hear it. |
I'm doing some tests with 1.3.0 (coming from 1.1.1)
Any idea what I'm doing wrong ? |
I found following telefonicaid#3561 (comment) regarding notifications on deletion of entities.
Is there any documentation on how to subscribe for such notifications ?
The text was updated successfully, but these errors were encountered: