Fiware:NGSI v2怀疑:仅获得有关已更改属性的通知 [英] Fiware: NGSI v2 susbcription: getting notified only about the attribute that has changed
问题描述
我有此订阅:
{
"id": "5a27abba56256c402cec5654",
"description": "my subscription",
"status": "active",
"subject": {
"entities": [
{
"idPattern": ".*"
}
],
"condition": {
"attrs": []
}
},
"notification": {
"timesSent": 56939,
"lastNotification": "2018-01-29T09:06:45.00Z",
"attrs": [],
"attrsFormat": "normalized",
"http": {
"url": "http://notif_url"
},
"lastFailure": "2018-01-24T15:10:08.00Z",
"lastSuccess": "2018-01-29T09:06:45.00Z"
}
}
使用它,我可以在未指定特定实体ID的情况下得到有关新实体的通知. 问题是,当一个实体属性更改时,我会收到有关所有属性的通知. 是否可以仅获得有关已更改属性的通知,并同时保留发现新实体的可能性?
Using it I can get notified about new entities whithout specifiying a particular entity ID. The problem is that when one entity attribute changes I get notified about all attributes. Is it possible to get notified only about the attribute that has changed and keeping in the same time the possibility to discover new entities?
如果属性x在条件部分中发生了变化,就会收到通知:
Something like in if attribut x changed in the condition part, get notified about it:
"condition": {
"attrs": [attribute_X]
}
"notification": {
"attrs": [attribute_X]
}
谢谢!
推荐答案
它以您提到的方式工作.我的意思是,使用:
It works the way you mention. I mean, using:
"condition": {
"attrs": [ "attribute_X" ]
}
...
"notification": {
"attrs": [ "attribute_X" ]
}
每当名为attribute_X
的属性发生更改(或首次出现,通常在实体创建时),您将收到一条仅包含attribute_X
Whenever attribute named attribute_X
changes (or appears first time, typically at entity creation time) you will receive a notification including only attribute_X
这篇关于Fiware:NGSI v2怀疑:仅获得有关已更改属性的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!