简体   繁体   English

Fiware:NGSI v2怀疑:仅获得有关已更改属性的通知

[英]Fiware: NGSI v2 susbcription: getting notified only about the attribute that has changed

I have this subscription: 我有此订阅:

{
    "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"
    }
}

Using it I can get notified about new entities whithout specifiying a particular entity ID. 使用它,我可以在没有指定特定实体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? 是否可以仅获得有关已更改属性的通知,并同时保留发现新实体的可能性?

Something like in if attribut x changed in the condition part, get notified about it: 如果条件部分中的属性x发生变化,例如会收到通知:

 "condition": {
                "attrs": [attribute_X]
            }
 "notification": {
            "attrs": [attribute_X]
}

Thanks! 谢谢!

It works the way you mention. 它以您提到的方式工作。 I mean, using: 我的意思是,使用:

"condition": {
  "attrs": [ "attribute_X" ]
}
...
"notification": {
   "attrs": [ "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 每当名为attribute_X发生更改(或首次出现,通常在实体创建时)时,您将收到仅包含attribute_X的通知

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM