Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
Labels:
-
HD-Chapter:IoT
-
HD-Enabler:Cepheus
Description
Created question in FIWARE Q/A platform on 13-05-2016 at 13:05
Please, ANSWER this question AT 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":"floor", "type":"string" } ]
}
],
"out":[
{
"id":"Floor1",
"type":"Floor",
"brokers":[
],
"attributes":[
]
}
],
"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.
Activity
Field | Original Value | New Value |
---|---|---|
Component/s | FIWARE-TECH-HELP [ 10278 ] |
HD-Enabler | Unknown [ 10910 ] | |
HD-Chapter | Unknown [ 10845 ] | |
HD-Node | Unknown [ 10852 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Resolution | Done [ 10000 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Summary | [fiware-stackoverflow] How to configure Cepheus CEP so it returns json to orion instead of xml? | FIWARE.Question.Tech.How to configure Cepheus CEP so it returns json to orion instead of xml?. |
HD-Enabler | Unknown [ 10910 ] | |
HD-Chapter | Unknown [ 10845 ] | |
HD-Node | Unknown [ 10852 ] |
Assignee | Backlog Manager [ backlogmanager ] |
HD-Enabler | Cepheus [ 10883 ] | |
HD-Chapter | IoT [ 10839 ] |
Fix Version/s | 2021 [ 12600 ] |
Transition | Time In Source Status | Execution Times | Last Executer | Last Execution Date | |||||
---|---|---|---|---|---|---|---|---|---|
|
9h | 1 | Backlog Manager | 14/May/16 12:07 AM | |||||
|
3h | 1 | Backlog Manager | 14/May/16 3:07 AM |
2016-05-13 15:05|CREATED monitor | # answers= 0, accepted answer= False