orchestracities / ngsi-timeseries-api

QuantumLeap: a FIWARE Generic Enabler to support the usage of NGSIv2 (and NGSI-LD experimentally) data in time-series databases
https://quantumleap.rtfd.io/
MIT License
38 stars 49 forks source link

Establish compatibility with Orion-LD. #664

Closed DasNordlicht closed 1 year ago

DasNordlicht commented 2 years ago

NGSI-LD uses a new header NGSI-Teanant instead of Fiware-Service in the notifications. Is it possible to use this header to realize the division in TSDB schemas?

{ "host": "xxxxx", "user-agent": "orion/1.15.0-next libcurl/7.61.1", "ngsild-tenant": "captn", "fiware-servicepath": "/", "accept": "application/json", "content-length": "1051", "content-type": "application/json; charset=utf-8", "ngsiv2-attrsformat": "normalized", "link": "<https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.5.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" }

c0c0n3 commented 2 years ago

@DasNordlicht thank you so much for raising this. The latest NGSI-LD spec is actually quite clear about it---4.14, 6.3.14. We'll look into this, but for the time being, can you try using the old fiware-service header? That should work, provided context broker sends it on to quantum leap---which it should I think...

c0c0n3 commented 1 year ago

hi @DasNordlicht

NGSI-LD uses a new header NGSI-Teanant instead of Fiware-Service in the notifications.

As of #721, QuantumLeap supports the NGSI tenant header.

Is it possible to use this header to realize the division in TSDB schemas?

Yes, the NGSI tenant header works in QL just like the FIWARE service header. In particular, if you send data with, say, an HTTP header of ngsild-tenant: captn, then QL will create a schema named mtcaptn where it will store all the entities for tenant captn.

c0c0n3 commented 1 year ago

For the record, kudos to @rohit-vrrr who implemented the feature!