问题
In Orion 1.4.0 I used the following JSON to subscribe for all entities:
{
"description": "Update average rating",
"subject": {
"entities": [
{
"idPattern": ".*",
"type": ""
}
],
"condition": {
"attrs": []
}
},
"notification": {
"http": {
"url": "http://URL:1026/v2"
}
},
"expires": "2020-01-01T00:00:00.00Z",
"throttling": 5
}
Today I tried this JSON with an Orion 1.7.0 and this doesn't work anymore. It returns the following error:
ERROR 400
{"error":"BadRequest","description":"entity type length: 0, min length supported: 1"}
I realized, that it's because of the "type": ""
. I changed it to "type": "*"
. The subscription works, now but I do not get any notifications. Probably the *
is not the correct pattern to subscripbe for all entities.
For the reference: https://github.com/telefonicaid/fiware-orion/issues/2876
回答1:
Try using "typePattern": ".*"
instead of "type": ""
.
来源:https://stackoverflow.com/questions/43230064/fiware-orion-subscribe-to-all-entities