问题描述
正在将Cygnus设置为CKAN的接收器,但出现此错误,Cygnus设置的哪一部分负责此(订阅,配置...)
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":[]}
我认为该错误与该contextResponses有关,因为它为空,但是我没有发现任何其他信息导致此情况出现在我应该看的地方.而且错误没有帮助.
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.
谢谢.
推荐答案
设置订阅时,天鹅座当前仅接受旧版NGSI v1格式的通知-因此需要attrsFormat=legacy
.
When setting up the subscription, Cygnus currently only accepts notifications in the older NGSI v1 format- the attrsFormat=legacy
is therefore needed.
例如
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
}'
有关在Cygnus中设置订阅的其他信息,可以在天鹅座教程
Further information about setting up subscriptions in Cygnus can be found in the Cygnus Tutorial
这篇关于"fiware-servicepath"标头值与通知的上下文响应数不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!