簡體   English   中英

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的情況下獲得有關新實體的通知。 問題是,當一個實體屬性更改時,我會收到有關所有屬性的通知。 是否可以僅獲得有關已更改屬性的通知,並同時保留發現新實體的可能性?

如果條件部分中的屬性x發生變化,例如會收到通知:

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

謝謝!

它以您提到的方式工作。 我的意思是,使用:

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

每當名為attribute_X發生更改(或首次出現,通常在實體創建時)時,您將收到僅包含attribute_X的通知

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM