上下文代理,ONTIMEINTERVAL 订阅立即发送请求参考

Context Broker, ONTIMEINTERVAL subscribe immediatelly sends request to reference

问题是,即使我将 condValues 放入 PT10S,当我向 contextBroker 发送请求时,它会立即请求返回引用 url,而不是在 10 秒之后,然后它会在 10 秒后继续发送请求. 我的问题:有没有办法避免第一个初始请求?

这是我发送到安装了 contextBroker 的服务器的请求正文。

{
    "entities": [{
        "type": "Cycle",
        "isPattern": "false",
        "id": "someid"
    }],
    "attributes": [
        ...
    ],
    "reference": "someurl"
    "duration": "P1M",
    "notifyConditions": [{
        "type": "ONTIMEINTERVAL",
        "condValues": [
            "PT10S"
        ]
    }]
}

目前(Orion 1.1)无法避免初始通知。然而,能够配置该行为将是未来开发的一个有趣的功能,因此,a github issue 是在很久以前创建的。

此外,请注意 ONTIMEINTERVAL 订阅是 no longer supported,因此您应该避免使用它们:

ONTIMEINTERVAL subscriptions have several problems (introduce state in CB, thus making horizontal scaling configuration much harder, and makes it difficult to introduce pagination/filtering). Actually, they aren't really needed, as any use case based on ONTIMEINTERVAL notification can be converted to an equivalent use case in which the receptor runs queryContext at the same frequency (and taking advantage of the features of queryContext, such as pagination or filtering).

编辑: Orion 终于实现了避免初始通知的可能性。详细信息位于 this section of the documentation。它现在在 master 分支中(所以如果你使用 fiware/orion:latest docker 你会得到它)并将包含在下一个 Orion 版本 (2.2.0) 中。