0
votes

I'm having a hard time to understand how context providers work in the Orion Context Broker. I followed the examples in the step by step guide written by Json Fox. However, I still do not exactly get what happens in the background and how the context broker exactly creates the POST from the registration. Here is what I am trying to do:

I do have a WeatherStation that provides sensor data for a neighborhood.

{
  "id": "urn:ngsi-ld:WeatherStation:001",
  "type": "Device:WeatherStation",
  "temperature": {
    "type": "Number",
    "value": 20.5,
    "metadata": {}
  },
  "windspeed": {
    "type": "Number",
    "value": 60.0,
    "metadata": {}
  }
}

Now I like the WeatherStation to be a context provider for all buildings.

{
  "id": "urn:ngsi-ld:building:001",
  "type": "Building"
}

Here is the registration that I try to use.

{
  "id": null,
  "description": "Random Weather Conditions",
  "provider": {
    "http": {
      "url": "http://localhost:1026/v2"
    },
    "supportedForwardingMode": "all"
  },
  "dataProvided": {
    "entities": [
      {
        "id": "urn:ngsi-ld:building:001",
        "idPattern": null,
        "type": "Building",
        "typePattern": null
      }
    ],
    "attrs": [
      "temperature",
      "windspeed"
    ],
    "expression": null
  },
  "status": "active",
  "expires": null,
  "forwardingInformation": null
}

The context broker accepts both entities and the registration without any error.

Since I have a multi-tenant setup I use one fiware_service for the complete neighborhood but every building would later have a seperate fiware_servicepath. Hence, the weatherstation has a different servicepath than the building. Although I also tried to put them both in the same path.

I also tried to vary the url of the registration but with no success.

  1. Is this scenario actually possible with the current implementation? It would be very useful
  2. Is there any example for this including also the headers?

I know that I could simply use reference but that would put more work on the user.

Thanks for any help on this.

You use the id of one single building in your registration ... Don't you want to serve all buildings? Remove the id and just keep the type: Building. And, what exactly goes wrong? Please make sure the registration and the entities are in the same tenant (same fiware-service) - kzangeli