sth-comet's github repoのマスターブランチ(現在はプレリリース版2.0.0-next
)を使用しており、インストールして実行できます。この問題は、コンテキストブローカー(v1.4.0)でサブスクリプションを作成するときに表示されます。両方のサービスは同じFIWARE Labマシンにインストールされており、パブリックIPアドレスを使用してリモートからアクセスします。STHコンテキストブローカサブスクリプションを作成できません
私はあなたのdocumentationで提供されるテンプレートを使用してサブスクリプションを作成しようとしてきたが、STHは常にFIWARE-Service
不満とFIWARE-ServicePath
ヘッダれる(コンテキストブローカは通知に沿ってそれらを送信していないようです)。これは、サブスクリプションを作成するためのコマンドです:
curl http://$(server):1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -H 'FIWARE-Service: default' -H 'FIWARE-ServicePath: /' -d @- <<EOF
{
"entities": [
{
"type": "weather.station",
"isPattern": "true",
"id": ".*"
}
],
"attributes": [
"temperature",
"humidity"
],
"reference": "http://$(server):8666/notify",
"duration": "P1M",
"notifyConditions": [
{
"type": "ONCHANGE",
"condValues": [
"temperature",
"humidity"
]
}
],
"throttling": "PT5S"
}
EOF
これが報告されたエラーです:
time=2016-10-06T15:56:30.124Z | lvl=WARN | corr=7220efae-8bdd-11e6-96a8-fa163ea89c59 | trans=11ef935c-f749-46b7-bcd4-942ffddedd27 | op=OPER_STH_POST | srv=default | subsrv=n/a | msg=POST /notify, event={"request":"1475769390111:robots:23181:ityixskh:10000","timestamp":1475769390123,"tags":["validation","error","headers"],"data":{"data":{"data":null,"isBoom":true,"isServer":false,"output":{"statusCode":400,"payload":{"statusCode":400,"error":"Bad Request","message":"child \"fiware-servicepath\" fails because [fiware-servicepath is required]"},"headers":{}}},"isBoom":true,"isServer":false,"output":{"statusCode":400,"payload":{"statusCode":400,"error":"Bad Request","message":"child \"fiware-servicepath\" fails because [fiware-servicepath is required]","validation":{"source":"headers","keys":[]}},"headers":{}}},"internal":true}
私はコンテキストブローカーAPIのV2を使用している場合は、私はFIWARE-Service
を送信するためにそれを強制することができますよそしてFIWARE-ServicePath
ヘッダ:それは他のエラーを発生させますが、
curl http://$(server):1026/v2/subscriptions -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -H 'FIWARE-Service: default' -H 'FIWARE-ServicePath: /' -d @- <<EOF
{
"description": "STH subscription",
"subject": {
"entities": [
{
"type": "weather.station",
"idPattern": ".*"
}
],
"condition": {
"attrs":[
"temperature",
"humidity"
]
}
},
"notification": {
"httpCustom": {
"url": "http://$(server):8666/notify",
"headers": {
"FIWARE-Service": "default",
"FIWARE-ServicePath": "/"
}
},
"attrs": [
"temperature",
"humidity"
]
},
"expires": "2018-04-05T14:00:00.00Z",
"throttling": 5
}
EOF
この方法では、STHサーバは、ヘッダーについて対応していません。
time=2016-10-06T15:46:57.564Z | lvl=ERROR | corr=19e59f02-8bdc-11e6-8534-fa163ea89c59 | trans=1b7fc29a-7f5c-449d-9238-d2e644154b05 | op=OPER_STH_POST | srv=default | subsrv=/ | msg=POST /notify, event={"request":"1475768812582:robots:8985:itycaq0o:10003","timestamp":1475768817564,"tags":["request","closed","error"],"internal":true}
time=2016-10-06T15:47:02.592Z | lvl=ERROR | corr=19e59f02-8bdc-11e6-8534-fa163ea89c59 | trans=7e5bf417-0b1d-4b53-b47b-838cead91b94 | op=OPER_STH_POST | srv=default | subsrv=/ | msg=POST /notify, event={"request":"1475768817606:robots:8985:itycaq0o:10004","timestamp":1475768822592,"tags":["request","closed","error"],"internal":true}