The general subscription/notification mechanism works with Cygnus in Orion 0.13.0 (and, in general, in any version, except maybe very ancient ones). The procedure will be, in general terms, assuming you have the Orion and Cygnus instances properly configured and running:
First, create a subscription at Orion, using as reference the host/port in which Cygnus is listening to. Example subscription:
{
"entities": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1"
}
],
"attributes": [ ],
"reference": "cygnus_host:cygnus_port/cygnus_url",
"duration": "P1M",
"notifyConditions": [
{
"type": "ONCHANGE",
"condValues": [
"pressure",
"temperature"
]
}
]
}
Second, update at Orion any of the entity attributes at condValues in the subscription. Considering the above example, updates in "pressure" or "temperature" would case notifications. E.g. update on temperature:
{
"contextElements": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1",
"attributes": [
{
"name": "temperature",
"type": "centigrade",
"value": "26.5"
}
]
}
]
}
Finally, the above update will cause a notification being sent to Cygnus with in sequence will persit in on the configured sink(s), e.g. Cosmos BigData, MySQL (from Cygnus 0.2.1) or CKAN (from Cygnus 0.3).
Additional observations:
- The notification may include all the attributes of the entity or a subset of them. In addition, you can subscribe to particular entities or to groups using entity patterns. Check Orion Context broker notifications documentation for details.
- The cygnus_port above must match with the value of the parameter
cygnusagent.sources.http-source.port
in Cygnus configuration
- The cygnus_url above must match with the value of the parameter
cygnusagent.sources.http-source.handler.notification_target
in Cygnus
- If you are using Cygnus 0.2.1 or older, the value of
cygnusagent.sources.http-source.handler.orion_version
must match the version of Orion you are using (Cygnus 0.3 will not use any longer this mechanism).
Please, have a look to Cygnus documentation for more details.
(NOTE: Include http:// before the reference element, I cannot add it myself due to StackOverFlow editing limitations)