我在orion 1.2.1中订阅了以下内容:
curl --include \
--header 'Content-Type: application/json' \
--request POST \
--data-binary '{
"description": "subscription",
"subject": {
"entities": [
{
"idPattern": "event-.*",
"type": "Event"
}
],
"condition": {
"attrs": [
"IdEvent",
"mFlag"
],
"expression": {
"q": "mFlag>0"
}
}
},
"notification": {
"attrsFormat":"legacy",
"http": {
"url" : "http://localhost:5050/notify"
},
"attrs": [
"IdEvent"
]
}
}' \
'http://localhost:1026/v2/subscriptions'当我发送这样的实体更新时:
curl --include \
--request PATCH \
--header "Content-Type: application/json" \
--data-binary '{
"mFlag":{
"value":"5",
"type":"int"
}
}' \
'http://localhost:1026/v2/entities/event-2/attrs'猎户座没有通知,它使我疯狂,不知道什么是错的。有什么想法吗?
当我删除订阅的这一部分时:
"expression": {
"q": "mFlag>0"
}它可以工作,但我需要它在任何属性更改时通知,并且满足条件。
发布于 2016-07-04 09:49:54
注意,在NGSIv2 "5"中是一个字符串,而不是数字。因此,为了使"q": "mFlag>0"过滤器按预期工作,请使用以下更新:
curl --include \
--request PATCH \
--header "Content-Type: application/json" \
--data-binary '{
"mFlag":{
"value":5,
"type":"int"
}
}' \
'http://localhost:1026/v2/entities/event-2/attrs'https://stackoverflow.com/questions/38076588
复制相似问题