我使用Cepheus GE作为我的用例,我在多租户模式下启用它并将config.json
文件上传到它,但是当我开始向Cepheus代理发送更新以便将它们转发给CEP,Cepheus经纪人只是接收更新,但没有将它们转发给Cepheus上限,因为它无法识别config.json
中设置的服务和服务路径。当我尝试将更新直接发送到Cepheus-CEP时,它接受了它们并成功处理了它们。所以我想知道为什么Cepheus经纪人在多租户模式下启用时无法识别Fiware服务。
配置文件服务定义如下
"brokers":[
{
"url":"http://XXX.XX.XX.XX:1026",
"serviceName": "f",
"servicePath": "/f",
"authToken": "XXX"
}
]
这是仙王座经纪人的日志。
2017-09-02 08:55:32,546 [/O dispatcher 1] WARN c.o.c.b.c.NgsiController - NotifyContext failed for http://localhost:8080/ngsi10/notifyContext$
2017-09-02 09:05:33,358 [nio-8081-exec-1] WARN c.o.c.b.c.NgsiController - UpdateContext failed for http://localhost:8082: Connection refused
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_72-internal]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[na:1.8.0_72-internal]
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:173) ~[httpcore-nio-4.4.1.$
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:147) ~[httpcore-nio-4.4.1$
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:350) ~[httpcore-nio-4.4.1.j$
at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:191) ~[httpasync$
at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64) ~[httpasyncclient-4.1.jar!$
at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_72-internal]
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_72-internal]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[na:1.8.0_72-internal]
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:173) ~[httpcore-nio-4.4.1.$
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:147) ~[httpcore-nio-4.4.1$
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:350) ~[httpcore-nio-4.4.1.j$
at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:191) ~[httpasync$
at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64) ~[httpasyncclient-4.1.jar!$
at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_72-internal]
2017-09-02 09:33:12,316 [pool-2-thread-1] WARN c.o.c.b.c.NgsiController - UpdateContext failed for http://localhost:8082: Connection refused
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_72-internal]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[na:1.8.0_72-internal]
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:173) [httpcore-nio-4.4.1.j$
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:147) [httpcore-nio-4.4.1.$
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:350) ~[httpcore-nio-4.4.1.j$
at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:191) ~[httpasync$
at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64) ~[httpasyncclient-4.1.jar!$
at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_72-internal]
发送更新的脚本文件如下
(curl XXX.XXX.XXX.XXX:8081/v1/updateContext/ -s -S --header 'Content-Type: application/json' --header "Fiware-Service: f" --header "Fiware-ServicePath:/f " --header 'Accept: application/json' -d @- | python -mjson.tool ) <<EOF
{ "contextElements": [
{
"type": "Lab",
"isPattern": "false",
"id": "Lab111",
"attributes": [
{
"name": "priority",
"type": "double",
"value": "1"
},
{
"name": "controller",
"type": "string",
"value": "Controller111"
}
]
}
],
"updateAction": "UPDATE"
}
EOF
现在请问我想知道问题出在哪里?
答案 0 :(得分:0)
截至今天,Fiware-Cepheus代理不支持多租户请求(使用Fiware-Service
和Fiware-ServicePath
标头),只有CEP可以处理多租户。更一般地说,与像猎户座这样的全权经纪人相比,经纪人的功能很少。
如果您需要多租户代理,请使用猎户座上下文代理:https://fiware-orion.readthedocs.io/en/master/user/multitenancy/index.html