telefonicaid / fiware-orion

Context Broker and CEF building block for context data management, providing NGSI interfaces.
https://fiware-orion.rtfd.io/
GNU Affero General Public License v3.0
212 stars 265 forks source link

Notifications for attributes from CPr #3704

Open SBlechmann opened 3 years ago

SBlechmann commented 3 years ago

Orion holds an entity that gets some attributes from an external CPr. When I querry the entity I see all the attributes (attributes orion holds and the ones from the CPr).

In the end I would like to have all the attributes' values in my timeseries db routed through QL. But apperently, the orion only raises a notification for attributes orion holds.

Obviously, you can create a workaround script that just taked the value and saves it in a similar named attribute which is hold in Orion. But I'd ask if this option (similar to #3693 ) can be integrated into the subscriptions in order to forward non-hold attributes as well from Orion directly to QL.

Thanks so far and I'm happy for your contributions :)

fgalan commented 3 years ago

I think we can distinguish between two diferent scenarios:

(triggering attribute = the attribute which change triggers the notification)

  1. The triggering attribute is in the CPr. This scenario is hard to solve, as Orion doesn't know what is happening in CPrs. In other words, if an attribute update takes place in the CPr, Orion doesn't know about that so Orion cannot trigger any notification about that. However, architectural alternatives are possible (i.e. transform CPr in an "active" element so it progress to Orion modifications on its attributes).
  2. The triggering attribute is not in the CPr, but the notification include attributes in the CPr. In that case, Orion could do a query to CPrs to "cover" their attributes. This is pretty similar to a query on the CPr caused by a client request (e.g. GET /v2/entities). This could be an interesteing extension to Orion functionaly. If anybody volunteers to implemented that I can try to guide her/him during the process :)