I am using "onlyChangedAttrs" = true in my Draco subsciption, but it doesn't seem to be working. It is still sending all the attributes irrespective of it is modified or not. Does this feature work in a particular version of Orion? However I am using the latest version of Orion "2.4.0-next". Can you please help me fix this. Thanks for your help! My draco subscription attached here:
curl -iX POST 'http://localhost:1026/v2/subscriptions' \
-H 'Content-Type: application/json' \
-H 'fiware-service: tk' \
-H 'fiware-servicepath: /' \
-d '{
"description": "Notify Draco of all context changes",
"subject": {
"entities": [
{
"idPattern": ".*"
}
]
},
"notification": {
"http": {
"url": "http://52.172.34.29:3003/v2/notify"
},
"onlyChangedAttrs":true,
},
"throttling": 0
}'
Also the payload sent to Draco after an attribute is modified is attached below (please note all attributes sent though we modified only the attribute named "Temp"):
{
"subscriptionId":"5eb290700d76dc473d3a5ace",
"data":[
{
"id":"urn:ngsi-ld:SENSOR:Wireless_Sensor-10",
"type":"SENSOR",
"A02":{
"type":"Number",
"value":20,
"metadata":{
}
},
"Description":{
"type":"Text",
"value":"",
"metadata":{
}
},
"Temp":{
"type":"Number",
"value":30,
"metadata":{
}
},
"hasParent":{
"type":"Text",
"value":"urn:ngsi-ld:HVAC:HVAC1",
"metadata":{
}
},
"isPartofContextTree":{
"type":"Text",
"value":"",
"metadata":{
}
},
"name":{
"type":"Text",
"value":"Wireless_Sensor-10",
"metadata":{
}
}
}
]
}
Version details of Orion: GET /version
{
"orion" : {
"version" : "2.4.0-next",
"uptime" : "0 d, 0 h, 1 m, 7 s",
"git_hash" : "4f26834ca928e468b091729d93dabd22108a2690",
"compile_time" : "Tue Mar 31 16:21:23 UTC 2020",
"compiled_by" : "root",
"compiled_in" : "3369cff2fa4c",
"release_date" : "Tue Mar 31 16:21:23 UTC 2020",
"doc" : "https://fiware-orion.rtfd.io/"
}
}
Output of /v2/subscriptions:
[
{
"id":"5eb3e7fa331ff6cb547598e1",
"description":"Notify Draco of all context changes",
"status":"active",
"subject":{
"entities":[
{
"idPattern":".*"
}
],
"condition":{
"attrs":[
]
}
},
"notification":{
"attrs":[
],
"attrsFormat":"normalized",
"http":{
"url":"http://52.172.34.29:3003/v2/notify"
},
"onlyChangedAttrs":true
}
}
]
And below is the JSON from mongodb -> orion schema -> csubs collection:
{
"_id":"ObjectId(" "5eb3e7fa331ff6cb547598e1" ")",
"expiration":"NumberLong(" "9223372036854775807" ")",
"reference":"http://52.172.34.29:3003/v2/notify",
"custom":false,
"throttling":NumberLong(0),
"servicePath":"/",
"description":"Notify Draco of all context changes",
"status":"active",
"entities":[
{
"id":".*",
"isPattern":"true"
}
],
"attrs":[
],
"metadata":[
],
"blacklist":false,
"onlyChanged":true,
"conditions":[
],
"expression":{
"q":"",
"mq":"",
"geometry":"",
"coords":"",
"georel":""
},
"format":"normalized"
}