【问题标题】:Error Cepheus broker not forwards updates to Cepheus CEP错误 Cepheus 代理未将更新转发到 Cepheus CEP
【发布时间】:2017-09-05 17:10:25
【问题描述】:

我将 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

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

【问题讨论】:

  • @Marc 你有什么想法吗?

标签: fiware complex-event-processing


【解决方案1】:

截至今天,Fiware-Cepheus 代理不支持多租户请求(使用 Fiware-ServiceFiware-ServicePath 标头),只有 CEP 可以处理多租户。更一般地说,与 Orion 这样的成熟代理相比,代理的功能非常少。

如果您需要多租户代理,请使用 Orion 上下文代理:https://fiware-orion.readthedocs.io/en/master/user/multitenancy/index.html

【讨论】:

  • 我尝试将 Orion Context Broker 用于具有 CEP 的多租户代理,但 Orion 的任何更改都不会影响 CEP 如何以正确的方式将 CEP 与 Orion 连接
  • 当我订阅 orion 时,我在 *** cepheus Request method 'POST' not supported ***
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-12-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-12
  • 1970-01-01
相关资源
最近更新 更多