3

I've got two questions regarding Orion subscriptions.

  1. If we register entity with provider application url in Orion and create a subscription for it (e.g. sending updates every 15 minutes), what will happen if there is no data in Orion's local DB? Will it query data provider to fetch data from specified url and then return this a subscription update, or will it return nothing?

  2. This is somewhat related to the first one. Is there an option to specify "max duration" of an attribute value in Orion's local DB (e.g. if an attribute is not updated in 1 hour, delete it's value)? We have the following example in mind: A subscription is set up for an entity to send update every 15 minutes to our server. Updates from sensors to Orion should be done every 5 minutes. Now, if something is not working with the sensor and it stops sending updates, we will get the last value stored in Orion DB forever, unless there's the "max-duration" option for that attribute that deletes the value if it's not changed in specified time period. When subscription update is triggered, in case that there's no value for that attribute in Orion's local DB, it should query the provider application for data (Q1).

dgebaei
  • 51
  • 2

1 Answers1

0

Regarding 1, I guess you refer to ONTIMEINTERVAL subscriptions. At the present moment at Orion 0.23.0 (it may change in the future) the notifications sent due to that kind of subscriptions are populated from Orion entities database, without querying Context Providers.

Regarding 2, there isn't such option (duration applies to registrations and subscriptions, but not to entity attributes). However, it would be easy to implement at client side: you can have an attribute named X_last_update to store the last update time of the X attribute and check regularly for attributes which last update is two old to be deleted.

fgalan
  • 11,732
  • 9
  • 46
  • 89
  • NGSIv2 (a mayor rework of the NGSI API implemented by Orion) will include mechanisms to query for entities that are older/newer than an specific date (thus making easy the solution proposed at item 2), but such functionality isn't yet available at Orion 0.23.0. – fgalan Sep 11 '15 at 12:45