最近,我开始使用Cepheus,但是在文档之后,我无法让它插入orion实体中。查看accumulator.py的错误之处,我发现cepheus向orion发送xml。在orion中,xml不是被废弃了吗?
cepheus cep中使用的配置:
{
"host":"http://localhost:1028",
"in":[
{
"id":"Room.*",
"type":"Room",
"isPattern":true,
"providers":[
"http://localhost:1027"
],
"attributes":[
{ "name":"temperature", "type":"double" },
{ "name":"floor", "type":"string" }
]
}
],
"out":[
{
"id":"Floor1",
"type":"Floor",
"brokers":[
{
"url":"http://localhost:1029"
}
],
"attributes":[
{ "name":"temperature", "type":"double" }
]
}
],
"statements":[
"INSERT INTO Floor SELECT floor as id, avg(temperature) as temperature FROM Room.win:time(10 min) GROUP BY floor OUTPUT LAST EVERY 10 sec"
]
}我对accumulator.py的反应是:
127.0.0.1 - - [13/May/2016 05:50:46] "POST /ngsi10/updateContext HTTP/1.1" 200 -
POST http://localhost:1029/ngsi10/updateContext
Content-Length: 404
User-Agent: Apache-HttpAsyncClient/4.1 (Java/1.8.0_91)
Connection: Keep-Alive
Host: localhost:1029
Accept: application/xml
Content-Type: application/xml
<updateContextRequest><updateAction>APPEND</updateAction><contextElementList><contextElement><entityId type="Floor" isPattern="false"><id>Floor1</id></entityId><contextAttributeList><contextAttribute><name>temperature</name><type>double</type><contextValue>22.333333333333332</contextValue><metadata/></contextAttribute></contextAttributeList></contextElement></contextElementList></updateContextRequest>=======================================如果在Cepheus Broker如果我启用了
remote.forward.updateContext = true通过正确的代理配置,我得到以下错误:
2016-05-13 06:07:08.504 WARN 12977 --- [nio-1027-exec-8] c.o.c.broker.controller.NgsiController : UpdateContext failed for http://localhost:1026: org.springframework.web.client.HttpClientErrorException: 415 Unsupported Media Type我认为这个错误也是由于查询的xml格式而产生的。
发布于 2016-05-13 20:09:44
Cepheus 0.1.16在0.28之后与Orion不兼容,因为XML支持被删除了。为了跟踪这个问题,我向Cepheus添加了一个问题:https://github.com/Orange-OpenSource/fiware-cepheus/issues/51
更新是以JSON作为NGSI交换的默认格式发布的。
https://stackoverflow.com/questions/37208354
复制相似问题