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

FIWARE.Question.Tech.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 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.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        9h 1 Backlog Manager 14/May/16 12:07 AM
        In Progress In Progress Closed Closed
        3h 1 Backlog Manager 14/May/16 3:07 AM
        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        fla Fernando Lopez made changes -
        HD-Enabler Cepheus [ 10883 ]
        HD-Chapter IoT [ 10839 ]
        fla Fernando Lopez made changes -
        Assignee Backlog Manager [ backlogmanager ]
        backlogmanager Backlog Manager made changes -
        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 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2016-05-14 03:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2016-05-14 03:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True
        backlogmanager Backlog Manager made changes -
        Resolution Done [ 10000 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2016-05-14 00:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2016-05-14 00:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        HD-Enabler Unknown [ 10910 ]
        HD-Chapter Unknown [ 10845 ]
        HD-Node Unknown [ 10852 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2016-05-13 15:05|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2016-05-13 15:05|CREATED monitor | # answers= 0, accepted answer= False
        backlogmanager Backlog Manager created issue -

          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: