orchestracities/ngsi-timeseries-api

Data not properly logged when fiware-service header is not present (CrateDB)

solucca opened this issue · 1 comments

When using Orion-LD (NSGI-LD) to set up a subscription to an entity, quantum leaps does not recognise the right service name and logs the data in the "doc" database instead of creating one corresponding to the fiware-service

To Reproduce
Steps to reproduce the behavior:
Set up subscription:

curl --location --request POST 'http://orion:1026/ngsi-ld/v1/subscriptions/' \
--header 'NGSILD-Tenant: openiot' \
--header 'Content-Type: application/json' \
--header 'Link: <http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
--data-raw '{
  "description": "Notify me of all weight changes",
  "type": "Subscription",
  "throttling": 10,
  "entities": [ {
    "type": "Device",
    "id": "urn:ngsi-ld:Device:weight001"
    }
    ],
  "watchedAttributes": ["weight"],
  "notification": {
    "attributes": ["weight", "weightClass", "price"],
    "format": "normalized",
    "endpoint": {
      "uri": "http://quantumleap:8668/v2/notify",
      "accept": "application/json"
    }
  }
}'

After the weight attribute is changed this is the result in CrateDB:
image

We can hotfix this problem by adding a new attribute to "endpoint":

"endpoint": {
      "uri": "http://quantumleap:8668/v2/notify",
      "accept": "application/json",
      "receiverInfo" : [
        { 
          "key":"fiware-service",
          "value":"openiot"
        }
       ]
    }

Expected behavior
Quantum leap was supposed to create a new database for the corresponding fiware-service:
image

Environment :

  • OS: Mac OS m1
  • Running on Docker containers
  • Quantum Leap Version: 0.8.3
  • CrateDB version: 4.8.1
  • OrionLD version: 1.1.0
c0c0n3 commented

hi @solucca :-)

Quantum Leap 0.8.3 doesn't support the NGSILD-Tenant header, it only supports the v2 fiware-service header, which explains the behaviour you reported. But @rohit-vrrr contributed this feature (#721), we merged into the mainline but haven't cut a release for it yet. If this is blocking you, I suggest you pull the master or edge image from DockerHub until we release 0.9.0 which will support the NGSILD-Tenant header.