fiware-orion - 通知限制有不良行为
问题描述
我已经部署了一个空 Orion 并连接了一个每 10 秒发送一次更新的设备。我需要每 10 分钟收到一个通知,因此我创建了一个限制为 600 秒的通知。
问题是我在第一个通知之后的同一分钟甚至几秒钟内收到了两个通知。
1)orion版本的一个实例:2.2.0
2) 猎户座订阅
[
{
"id": "5e9ec90d9e2ba22996168d78",
"description": "Notificaciones a Arcgis",
"expires": "2040-01-01T14:00:00.00Z",
"status": "active",
"subject": {
"entities": [
{
"id": "id1",
"type": "aqss"
}
],
"condition": {
"attrs": []
}
},
"notification": {
"timesSent": 521026,
"lastNotification": "2020-05-21T10:52:53.00Z",
"attrs": [],
"attrsFormat": "normalized",
"http": {
"url": "http://test.eu/notify/"
},
"metadata": [
"dateCreated",
"dateModified"
],
"lastFailure": "2020-05-20T16:46:58.00Z",
"lastFailureReason": "Timeout was reached",
"lastSuccess": "2020-05-21T10:52:53.00Z",
"lastSuccessCode": 500
}
},
{
"id": "5e9ec96f9e2ba22996168d79",
"description": "Notificaciones a Arcgis",
"expires": "2040-01-01T14:00:00.00Z",
"status": "active",
"subject": {
"entities": [
{
"id": "id2",
"type": "aqss"
}
],
"condition": {
"attrs": []
}
},
"notification": {
"timesSent": 526757,
"lastNotification": "2020-05-21T10:52:50.00Z",
"attrs": [],
"attrsFormat": "normalized",
"http": {
"url": "http://test.eu/notify/"
},
"metadata": [
"dateCreated",
"dateModified"
],
"lastFailure": "2020-05-21T09:32:34.00Z",
"lastFailureReason": "Timeout was reached",
"lastSuccess": "2020-05-21T10:52:50.00Z",
"lastSuccessCode": 500
}
},
{
"id": "5e9ec9899e2ba22996168d7a",
"description": "Notificaciones a Arcgis",
"expires": "2040-01-01T14:00:00.00Z",
"status": "active",
"subject": {
"entities": [
{
"id": "id3",
"type": "aqss"
}
],
"condition": {
"attrs": []
}
},
"notification": {
"timesSent": 541814,
"lastNotification": "2020-05-21T10:52:47.00Z",
"attrs": [],
"attrsFormat": "normalized",
"http": {
"url": "http://test.eu/notify/"
},
"metadata": [
"dateCreated",
"dateModified"
],
"lastFailure": "2020-05-21T01:49:52.00Z",
"lastFailureReason": "Timeout was reached",
"lastSuccess": "2020-05-21T10:52:48.00Z",
"lastSuccessCode": 500
}
},
{
"id": "5e9ec9a69e2ba22996168d7b",
"description": "Notificaciones a Arcgis",
"expires": "2040-01-01T14:00:00.00Z",
"status": "active",
"subject": {
"entities": [
{
"id": "id3",
"type": "aqss"
}
],
"condition": {
"attrs": []
}
},
"notification": {
"timesSent": 470859,
"lastNotification": "2020-05-21T10:52:47.00Z",
"attrs": [],
"attrsFormat": "normalized",
"http": {
"url": "http://test.eu/notify/"
},
"metadata": [
"dateCreated",
"dateModified"
],
"lastFailure": "2020-05-20T21:01:32.00Z",
"lastFailureReason": "Timeout was reached",
"lastSuccess": "2020-05-21T10:52:47.00Z",
"lastSuccessCode": 500
}
},
{
"id": "5e9ec9c09e2ba22996168d7c",
"description": "Notificaciones a Arcgis",
"expires": "2040-01-01T14:00:00.00Z",
"status": "active",
"subject": {
"entities": [
{
"id": "id4",
"type": "aqss"
}
],
"condition": {
"attrs": []
}
},
"notification": {
"timesSent": 532901,
"lastNotification": "2020-05-21T10:52:44.00Z",
"attrs": [],
"attrsFormat": "normalized",
"http": {
"url": "http://test.eu/notify/"
},
"metadata": [
"dateCreated",
"dateModified"
],
"lastFailure": "2020-05-21T08:33:10.00Z",
"lastFailureReason": "Timeout was reached",
"lastSuccess": "2020-05-21T10:52:45.00Z",
"lastSuccessCode": 500
}
},
{
"id": "5e9ec9ff9e2ba22996168d7d",
"description": "Notificaciones a Arcgis",
"expires": "2040-01-01T14:00:00.00Z",
"status": "active",
"subject": {
"entities": [
{
"id": "id5",
"type": "aqss"
}
],
"condition": {
"attrs": []
}
},
"notification": {
"timesSent": 520974,
"lastNotification": "2020-05-21T10:52:53.00Z",
"attrs": [],
"attrsFormat": "normalized",
"http": {
"url": "http://test.eu/notify/"
},
"metadata": [
"dateCreated",
"dateModified"
],
"lastFailure": "2020-05-21T05:30:58.00Z",
"lastFailureReason": "Timeout was reached",
"lastSuccess": "2020-05-21T10:52:53.00Z",
"lastSuccessCode": 500
}
}
]
3) Orion 在 docker 实例中运行
[root@271386b095c6 /]# ps ax
PID TTY STAT TIME COMMAND
1 ? Ssl 320:12 /usr/bin/contextBroker -fg -multiservice -ngsiv1Autocast -dbhost mongo -corsOrigin __ALL -logLevel DEBUG
9248 pts/0 Ss 0:00 bash
9293 pts/0 R+ 0:00 ps ax
4) 待定...
5)实体和订阅属于同一个服务和服务路径
谢谢
解决方案
查看上面的信息,您似乎有很多订阅。如果我数对了,其中六个。
不确定它们是否都涵盖相同的实体/属性,但我的建议是简化您的方案,只留下一个订阅并再次测试。
您可以使用 删除订阅DELETE /v2/subscriptions/{subId}
。
推荐阅读
- java - Swing 的 KeyStroke.getKeyStroke() 返回 UNKNOWN
- excel - 如果满足条件,如何将范围从多张纸复制到一张纸(另一个范围下的一个范围)?
- android - FirebaseMessaging:找不到启动应用程序的活动
- php - 身份不明的 PHP 和 PDO 执行时间长
- python - 仅当传递的参数是字符串时,如何实例化类?
- api - (Quickbooks Online) 通过 API 触发字段自动填充
- javascript - 管道,带有动态参数的 ramda
- python-3.x - TypeError: 'Not JSON Serializable' while doing tf.keras.Model.save and using keras variable in loss_weights in tf.keras.Model.compile
- javascript - 如何在 JS 中创建一个管理商品的类?
- api - 如何使用 SOAP 请求 XML 请求从日期到日期的字段?