ContextBroker Vectors UPDATE 值未更改会导致 ONCHANGE 订阅通知

问题描述 投票:0回答:1

我有一个 JSON 格式如下:

{
"contextElements": [
    {
        "type": "environment",
        "isPattern": "false",
        "id": "labMax",
        "attributes": [
        {
            "name": "users",
            "type": "vector",
            "value": [{"userId":"0001", "status":"0"},{"userId":"0002", "status":"0"}]
        },
        {
            "name": "rooms",
            "type": "vector",
            "value": [{"room1": [ {"id":"room1"}, {"owner":"1"}]},{"id":"room2"}, {"owner":"2"}]
        },
        {
            "name": "sensors",
            "type": "vector",
            "value": [
          {"sensor1": [ {"id":"1"}, {"location":"room1"},{"value":"11"},{"status":"ok"}]},
          {"sensor2": [ {"id":"2"}, {"location":"room1"},{"value":"22"},{"status":"update"}]}
          ]
        }

        ]
    }
],
"updateAction": "APPEND"
}

我还在属性“传感器”上订阅了ONCHANGE,当我更新它时,而不更改向量内的任何值,它会发出通知。这可能是错误的行为,因为只有当值发生变化时才应通知订阅者。另一方面,如果我使用 stringsinteger 作为属性值,它可以正常工作。

fiware-orion
1个回答
0
投票

至少在 Orion 0.16.0 之前,这是已知行为。 一个问题已在 Orion github.com 存储库中公开讨论。

更新:自 Orion 3.11.0(2024 年 1 月 29 日发布)以来,此问题已解决。

顺便说一句,强烈建议您使用NGSIv2 API。问题帖子中显示的 NGSIv1 已弃用,可能很快就会被删除。

© www.soinside.com 2019 - 2024. All rights reserved.