'fiware-servicepath' header value does not match the number of notified context responses

无人久伴 提交于 2019-12-11 08:32:21

问题


Working on setting Cygnus as a sink to CKAN, and I get this error, what part of Cygnus setup is responsible for this( subscription, configuration ...)

cygnus_1  | time=2018-10-01T12:40:04.517Z | lvl=DEBUG | corr=1ea858dc-c577- 
11e8-b0fd-0242ac140003 | trans=5c553916-f5e6-4bbc-b98a-bcaba61a306c | 
srv=waste4think | subsrv=/room/test | comp=cygnus-ngsi | op=getEvents | 
msg=com.telefonica.iot.cygnus.handlers.NGSIRestHandler[320] : 
[NGSIRestHandler] Parsed NotifyContextRequest:{" 
subscriptionId":"5bb2153fd1bde90f8813b236","originator":"null","contextResponse    
s":[]}

I assume the error is connected to this contextResponses because it is empty, but I found no additional info what is causing this where I should look. And the error is not helping.

This is the more general question that issue since I cannot call this issue because I have no idea if it is me who is causing this or Cygnus to have indeed some problems.

Thanks.


回答1:


When setting up the subscription, Cygnus currently only accepts notifications in the older NGSI v1 format- the attrsFormat=legacy is therefore needed.

e.g.

curl -iX POST \
  'http://localhost:1026/v2/subscriptions' \
  -H 'Content-Type: application/json' \
  -H 'fiware-service: openiot' \
  -H 'fiware-servicepath: /' \
  -d '{
  "description": "Notify Cygnus of all context changes",
  "subject": {
    "entities": [
      {
        "idPattern": ".*"
      }
    ]
  },
  "notification": {
    "http": {
      "url": "http://cygnus:5050/notify"
    },
    "attrsFormat": "legacy"
  },
  "throttling": 5
}'

Further information about setting up subscriptions in Cygnus can be found in the Cygnus Tutorial



来源:https://stackoverflow.com/questions/52591735/fiware-servicepath-header-value-does-not-match-the-number-of-notified-context

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!