首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何配置Cepheus,使其将json返回orion而不是xml?

如何配置Cepheus,使其将json返回orion而不是xml?
EN

Stack Overflow用户
提问于 2016-05-13 11:01:56
回答 1查看 111关注 0票数 1

最近,我开始使用Cepheus,但是在文档之后,我无法让它插入orion实体中。查看accumulator.py的错误之处,我发现cepheus向orion发送xml。在orion中,xml不是被废弃了吗?

cepheus cep中使用的配置:

代码语言:javascript
复制
{
  "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"
  ]
}
  • 1029猎户座经纪人
  • 1028头仙
  • 1027 Cepheus经纪人

我对accumulator.py的反应是:

代码语言:javascript
复制
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如果我启用了

代码语言:javascript
复制
remote.forward.updateContext = true

通过正确的代理配置,我得到以下错误:

代码语言:javascript
复制
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格式而产生的。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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交换的默认格式发布的。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37208354

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档