[ https://jira.fiware.org/browse/HELP-6588?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fernando Lopez reassigned HELP-6588:
------------------------------------
Assignee: Backlog Manager
> FIWARE.Question.Tech.How to configure Cepheus CEP so it returns json to orion instead of xml?.
> ----------------------------------------------------------------------------------------------
>
> Key: HELP-6588
> URL: https://jira.fiware.org/browse/HELP-6588
> Project: Help-Desk
> Issue Type: Monitor
> Components: FIWARE-TECH-HELP
> Reporter: Backlog Manager
> Assignee: Backlog Manager
> Labels: fiware, fiware-orion
>
> Created question in FIWARE Q/A platform on 13-05-2016 at 13:05
> {color: red}Please, ANSWER this question AT{color} http://stackoverflow.com/questions/37208354/how-to-configure-cepheus-cep-so-it-returns-json-to-orion-instead-of-xml
> +Question:+
> How to configure Cepheus CEP so it returns json to orion instead of xml?
> +Description:+
> Recently I started using Cepheus CEP but following the documentation I can't make it insert in orion entities. Looking what I made wrong with the accumulator.py I found out that cepheus cep sends xml querys to orion. Isn't xml deprecated in orion?
> The configuration used in 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"
> ]
> }
> 1029 Orion Broker
> 1028 Cepheus CEP
> 1027 Cepheus Broker
> The response I'm getting with 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>=======================================
> And if in Cepheus Broker if I enabled
> remote.forward.updateContext = true
> with the correct broker config I get the following error:
> 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
> I think this error is also produced because the xml format of the querys.
--
This message was sent by Atlassian JIRA
(v6.4.1#64016)
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy