微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

FIWARE 的订阅不通知

如何解决FIWARE 的订阅不通知

我对不同的实体有多个订阅,并且在某个随机时间,其中一个订阅停止收到通知

这是因为 lastNotification 属性是在以后设置的。这是一个例子:

 curl 'http://localhost:1026/v2/subscriptions/xxxxxxxxxxxxxxx'

{
    "id": "xxxxxxxxxxxxxxx",...
    "status": "active",...
    "notification": {
        "timesSent": 1316413,"lastNotification": "2021-01-20T18:33:39.000Z",...
        "lastFailure": "2021-01-18T12:11:26.000Z","lastFailureReason": "Timeout was reached","lastSuccess": "2021-01-20T17:12:09.000Z","lastSuccessCode": 204
    }
}

在这个例子中,lastNotification 是提前的。直到 2021-01-20T18:33:39.000Z 才会再次通知订阅

我试图修改 mongo 数据库中的 lastNotification 但这并没有改变它。看起来值 2021-01-20T18: 33: 39.000Z 已被缓存。

解决方法

字段 Undefined command: "$sp". Try "help" 指定与该订阅关联的最后一次通知失败的原因。 diagnose notification reception problems section in the documentation 解释了 “已达到超时” 的可能原因。如果您的网络连接不稳定,那么随机失败是有意义的。

关于未来的时间戳(无论是 lastFailureReasonlastNotification 还是 lastFailure)非常奇怪,可能与 Orion Context Broker 操作无关。 Orion 从它运行的系统的内部时钟中获取时间戳,所以也许你的系统时钟是在未来设置的。

除非您使用 lastSuccess(通常为 is not recommended)运行 Orion Context Broker,否则会缓存订阅。因此,如果您在数据库中“破解”它们,您将不会看到效果,直到下一次缓存刷新(刷新定期发生,由 -noCache 参数定义)。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。