为什么0.8.0之后的Orion-ld不支持在quantumleap日志中形成服务/子服务?

问题描述 投票:0回答:1

0.8.0 之后的任何版本的 orion-ld 都不支持在QuantumLeap日志中形成服务/子服务,因此在 crate-db 中不形成带有“mt”前缀的表模式。但表是用“et”前缀形成的,后跟包含QuantumLeap持久数据的实体类型。

下面是我的QuantumLeap订阅示例

{
  "description": "Notify me of animal locations",
  "type": "Subscription",
  "entities": [{"type": "Device"}],
  "watchedAttributes": ["location", "status", "heartRate"],
  "notification": {
    "attributes": ["location", "status", "heartRate"],
    "format": "normalized",
    "endpoint": {
      "uri": "http://quantumleap:8668/v2/notify",
      "accept": "application/json",
    }
  },
   "throttling": 10,
   "@context": "http://context:3000/data-models/ngsi-context.jsonld"
} 

如何解决这个问题? 我正在关注本教程text

fiware fiware-orion cratedb
1个回答
0
投票

这很可能是 QuantumLeap 中的一个错误。 Orion-LD (NGSI-LD) 是一个奇怪的野兽,因为它是 Orion classic (NGSI-v2) 的一个分支,我猜对于通知,它仍然默认转发

fiware-service
fiware-service-path
标头,直到 0.8 .0

根据 1.7.1 ETSI 规范,5.2.15 Endpoint 包含一个名为 notifierInfo 的数组,可用于发送任意标头 - 如果您将其设置为包含

fiware-service
键值对,则 QuantumLeap 将为租户创建一个 mt 元素。

QuantumLeap should

NGSILD-Tenant
视为
fiware-service

的别名

类似这样的:

curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/subscriptions/' \
-H 'Content-Type: application/ld+json' \
-H 'NGSILD-Tenant: openiot' \
--data-raw '{
  "description": "Notify me using the openiot fiware-service",
  "type": "Subscription",
  "entities": [{"type": "FillingLevelSensor"}],
  "watchedAttributes": ["filling"],
  "notification": {
    "attributes": ["filling", "location"],
    "format": "normalized",
    "endpoint": {
      "uri": "http://quantumleap:8668/v2/notify",
      "accept": "application/json",
      "notifierInfo": [
        {
          "key": fiware-service",
          "value": "openiot"
        }
      ]
    }
  },
   "@context": "http://context/ngsi-context.jsonld"
}'
© www.soinside.com 2019 - 2024. All rights reserved.