简体   繁体   English

Fiware Orion Context Broker:订阅限制

[英]Fiware Orion Context Broker: Restrictions on subscriptions

Does Orion support restrictions on subscriptions? Orion是否支持订阅限制? Ex. 防爆。 I want to receive context updates only when temperature > 30 我只想在温度> 30时接收上下文更新

That functionality is not implemented in NGSIv1, but planned for NGSIv2 (see conditions field in "Subscriptions" at the NGSIv2 draft specification ). 该功能不是在NGSIv1中实现的,而是在NGSIv2中计划的(请参阅NGSIv2规范草案中“订阅”中 conditions字段)。 However, it has not been yet implemented in the last Orion version at the time of writting this (0.25.0). 但是,撰写本文时(0.25.0)尚未在上一个Orion版本中实现。

EDIT : this functionality has been finally implemented in Orion 0.27.0, eg: 编辑 :此功能终于在Orion 0.27.0中实现,例如:

POST /v2/subscriptions
...

{
    "subject": {
        "entities": [
            {
                "idPattern": ".*",
                "type": "device"
            }
        ],
        "condition": {
            "attributes": [ "temperature" ],
            "expression": {
               "q": "temperature>30"
            }
         }
    },
    "notification": {
        "callback": "http://foo.bar:5050/notify",
        "attributes": [ ]
    },
    "expires": "2050-04-05T14:00:00.00Z"
}

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

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