Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-9001

[fiware-stackoverflow] How to configure Cepheus CEP so it returns json to orion instead of xml?

    Details

      Description

      Created question in FIWARE Q/A platform on 13-05-2016 at 13:05
      Please, ANSWER this question AT https://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.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        2h 55m 1 Backlog Manager 22/May/17 6:08 PM
        In Progress In Progress Closed Closed
        3h 1 Backlog Manager 22/May/17 9:08 PM

          People

          • Assignee:
            backlogmanager Backlog Manager
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: