【发布时间】:2018-03-23 21:57:28
【问题描述】:
我无法让累积服务器正常工作。我开始了它,但是如果 OCB 收到例如新订阅,它不会给出任何结果。流程如下:
我开始记账。如tutorial 中所述的服务器,来自 OCB 的新克隆回购。结果我进入控制台:
tmp@tmp-VirtualBox:~/fiware-orion/scripts$ ./accumulator-server.py --port 1028 --url /accumulate --host ::1 --pretty-print -v
verbose mode is on
port: 1028
host: ::1
server_url: /accumulate
pretty: True
https: False
Running on http://[::1]:1028/ (Press CTRL+C to
在这之后什么都没有发生。如果我进行订阅(本教程中最基本的订阅),我会在发出请求的媒体中获得响应:
< HTTP/1.1 201 Created
< Connection: Keep-Alive
< Content-Length: 0
< Location: /v2/subscriptions/5ab5248e50bfc821d0a1b1e0
< Fiware-Correlator: 45df4ff6-2eb3-11e8-912c-0242ac110003
< Date: Fri, 23 Mar 2018 16:00:14 GMT
但是,这可能是罪魁祸首,订阅状态设置为失败(通过要求列出所有订阅和在 Orion Context Explorer 中进行检查)。例如,不能更改为非活动状态。一切都按预期运行(我猜)。 OCB 在 docker 中作为容器运行,该容器安装在 LUbuntu 上,并且运行良好。这可能是我的错误,因为我正在使用 Insomnia 与 OCB 进行通信并且可能会混合一些东西,但 OCB 的回应是一切都很好。任何帮助将不胜感激。
编辑: 会计。服务器不工作。我得到了:
* Trying 127.0.0.1...
* TCP_NODELAY set
* connect to 127.0.0.1 port 1028 failed: Connection refused
* Failed to connect to localhost port 1028: Connection refused
* Closing connection 0
curl: (7) Failed to connect to localhost port 1028
运行检查命令后(curl -vvvv localhost:1028/accumulate)。
关于订阅我发布此有效负载:
{
"description": "A subscription to get info about Room1",
"subject": {
"entities": [
{
"id": "Room1",
"type": "Room"
}
],
"condition": {
"attrs": [
"pressure"
]
}
},
"notification": {
"http": {
"url": "http://localhost:1028/accumulate"
},
"attrs": [
"temperature"
]
},
"expires": "2040-01-01T14:00:00.00Z",
"throttling": 5
}
到 localhost:1026/v2/subscriptions URL。事先实体及其参数和类型都可以。创建后,我请求获取所有订阅并获取:
[
{
"id": "5ab7d819209f52528cc2faf7",
"description": "A subscription to get info about Room1",
"expires": "2040-01-01T14:00:00.00Z",
"status": "failed",
"subject": {
"entities": [
{
"id": "Room1",
"type": "Room"
}
],
"condition": {
"attrs": [
"pressure"
]
}
},
"notification": {
"timesSent": 1,
"lastNotification": "2018-03-25T17:10:49.00Z",
"attrs": [
"temperature"
],
"attrsFormat": "normalized",
"http": {
"url": "http://localhost:1028/accumulate"
},
"lastFailure": "2018-03-25T17:10:49.00Z"
},
"throttling": 5
}
]
我猜他失败了,因为没有发送通知,但我不确定。
【问题讨论】:
-
首先,确保蓄能器工作正常。请在同一主机上执行
curl -vvvv localhost:1028/accumulate并编辑您的问题帖子以包含结果。 -
第二,您能否编辑您的问题帖子以包含您用于创建订阅的请求,好吗?谢谢!
标签: fiware-orion