错误Cepheus代理未将更新转发给Cepheus CEP [英] Error Cepheus broker not forwards updates to Cepheus CEP

查看:86
本文介绍了错误Cepheus代理未将更新转发给Cepheus CEP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用案例中使用Cepheus GE,并在多租户模式下启用了它,并将我的config.json文件上传到其中,但是当我开始向Cepheus代理发送更新以将更新转发给CEP时, Cepheus代理仅接收更新,但不会将更新转发给Cepheus封顶,因为它无法识别config.json中设置的服务和服务路径.当我尝试将更新直接发送给Cepheus-CEP时,它接受了更新并成功处理了它们.因此,我想知道为什么Cepheus代理在多租户模式下启用后无法识别Fiware-service.

I use Cepheus GE for my use case and I enabled it in the multi tenant mode and uploaded my config.json file to it, But when I start to send updates to the Cepheus broker in order to forward them to the CEP, the Cepheus broker just receives the updates but doesn't forward them to the Cepheus cap as it couldn't recognize the service and service-path that are set in the config.json. And when I tried to send my updates directly to the Cepheus-CEP, it accepted them and processed them successfully. So I wonder why the Cepheus broker cannot recognize the Fiware-service when it's enabled in the multi tenant mode.

配置文件服务定义如下

"brokers":[
    {
      "url":"http://XXX.XX.XX.XX:1026",
      "serviceName": "f",
      "servicePath": "/f",
      "authToken": "XXX"
    }
]

这是Cepheus经纪人的日志.

this is the Logs of Cepheus broker.

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]

发送更新的脚本文件如下

And the script file that sends the updates is as follows

(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

现在,我想知道问题可能在哪里?

Now please I want to know where the problem could be?

推荐答案

到目前为止,Fiware-Cepheus代理不支持多租户请求(使用Fiware-ServiceFiware-ServicePath标头),只有CEP可以处理多租户.一般来说,与像Orion这样的全面经纪人相比,该经纪人几乎没有功能.

As of today, the Fiware-Cepheus broker does not support multi-tenant requests (using Fiware-Service and Fiware-ServicePath headers), only the CEP can handle multi-tenancy. More generally, the broker has very few features compared to a full-fledge broker like Orion.

如果您需要多租户代理,请使用Orion上下文代理:

If you need a multi-tenant broker, use the Orion Context Broker: https://fiware-orion.readthedocs.io/en/master/user/multitenancy/index.html

这篇关于错误Cepheus代理未将更新转发给Cepheus CEP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆