简体   繁体   English

Orion context broker 和 Quantumleap 之间的订阅有效,但表未在 CrateDB 中创建

[英]Subscription between Orion context broker and Quantumleap works, but table is not created in CrateDB

Cheers!干杯!

I've been working for a couple of months with Fiware, using Quantumleap and CrateDB to store historical data (which will then be displayed in Grafana).我已经使用 Fiware 工作了几个月,使用 Quantumleap 和 CrateDB 来存储历史数据(然后将显示在 Grafana 中)。

I have created about 14 successful subscriptions through Postman for different sensors, but for the past couple of weeks I am struggling to create a new additional subscription.我已经通过 Postman 为不同的传感器创建了大约 14 个成功的订阅,但在过去的几周里,我一直在努力创建一个新的额外订阅。

Below I share the JSON that I am using to create this subscription (following the format that I have used in previous subscriptions):下面我分享了我用来创建此订阅的 JSON(遵循我在以前的订阅中使用的格式):

{
    "description": "Suscripcion a cambios de contexto CALCULATION",
    "subject": {
        "entities": [{
            "idPattern": ".*",
            "type": "CALCULATION"
        }],
        "condition": {
            "attrs": [
                "ActivePowerConsumedA1",
                "ActivePowerConsumedA2",
                "ActivePowerConsumedA3",
                "EnergyShareA1",
                "EnergyShareA2",
                "EnergyShareA3",
                "EquivalentTrees",
                "FR1_B11_20Efficiency",
                "FR1_B18_10Efficiency",
                "FR1_B18_12.5Efficiency",
                "FR2_B11_20Efficiency",
                "FR2_B18_10Efficiency",
                "FR2_B18_12.5Efficiency",
                "GeneratedEnergyDayA1",
                "GeneratedEnergyDayA2",
                "GeneratedEnergyDayA3",
                "GeneratedPowerA1",
                "GeneratedPowerA2",
                "GeneratedPowerA3",
                "MI_B10_5Efficiency",
                "PowerShareA1",
                "PowerShareA2",
                "PowerShareA3",
                "SL_B11_28Efficiency",
                "TotalActiveEnergyConsumedDay",
                "TotalActivePowerConsumed",
                "TotalEmissions",
                "TotalEnergyShare",
                "TotalGeneratedEnergy",
                "TotalGeneratedEnergyDay",
                "TotalGeneratedPower",
                "TotalPowerShare"
            ]
        }
    },
    "notification": {
        "attrs": [
            "id",
            "ActivePowerConsumedA1",
            "ActivePowerConsumedA2",
            "ActivePowerConsumedA3",
            "EnergyShareA1",
            "EnergyShareA2",
            "EnergyShareA3",
            "EquivalentTrees",
            "FR1_B11_20Efficiency",
            "FR1_B18_10Efficiency",
            "FR1_B18_12.5Efficiency",
            "FR2_B11_20Efficiency",
            "FR2_B18_10Efficiency",
            "FR2_B18_12.5Efficiency",
            "GeneratedEnergyDayA1",
            "GeneratedEnergyDayA2",
            "GeneratedEnergyDayA3",
            "GeneratedPowerA1",
            "GeneratedPowerA2",
            "GeneratedPowerA3",
            "MI_B10_5Efficiency",
            "PowerShareA1",
            "PowerShareA2",
            "PowerShareA3",
            "SL_B11_28Efficiency",
            "TotalActiveEnergyConsumedDay",
            "TotalActivePowerConsumed",
            "TotalEmissions",
            "TotalEnergyShare",
            "TotalGeneratedEnergy",
            "TotalGeneratedEnergyDay",
            "TotalGeneratedPower",
            "TotalPowerShare"
        ],
        "http": {
            "url": "http://quantumleap:8668/v2/notify"
        },
        "metadata": [
            "dateCreated",
            "dateModified"
        ]
    }
}

As expected, I get HTTP response code 201 Created正如预期的那样,我得到了 HTTP 响应代码201 Created

Additionally, when I query OCB for subscriptions, I get, among the existing subscriptions created, the one I just created:此外,当我向 OCB 查询订阅时,我在创建的现有订阅中得到了我刚刚创建的订阅:

{
    "id": "6388cc5324c929752900e240",
    "description": "Suscripcion a cambios de contexto CALCULATION",
    "status": "active",
    "subject": {
        "entities": [{
            "idPattern": ".*",
            "type": "CALCULATION"
        }],
        "condition": {
            "attrs": [
                "ActivePowerConsumedA1",
                "ActivePowerConsumedA2",
                "ActivePowerConsumedA3",
                "EnergyShareA1",
                "EnergyShareA2",
                "EnergyShareA3",
                "EquivalentTrees",
                "FR1_B11_20Efficiency",
                "FR1_B18_10Efficiency",
                "FR1_B18_12.5Efficiency",
                "FR2_B11_20Efficiency",
                "FR2_B18_10Efficiency",
                "FR2_B18_12.5Efficiency",
                "GeneratedEnergyDayA1",
                "GeneratedEnergyDayA2",
                "GeneratedEnergyDayA3",
                "GeneratedPowerA1",
                "GeneratedPowerA2",
                "GeneratedPowerA3",
                "MI_B10_5Efficiency",
                "PowerShareA1",
                "PowerShareA2",
                "PowerShareA3",
                "SL_B11_28Efficiency",
                "TotalActiveEnergyConsumedDay",
                "TotalActivePowerConsumed",
                "TotalEmissions",
                "TotalEnergyShare",
                "TotalGeneratedEnergy",
                "TotalGeneratedEnergyDay",
                "TotalGeneratedPower",
                "TotalPowerShare"
            ]
        }
    },
    "notification": {
        "timesSent": 3,
        "lastNotification": "2022-12-01T15:49:09.000Z",
        "attrs": [
            "id",
            "ActivePowerConsumedA1",
            "ActivePowerConsumedA2",
            "ActivePowerConsumedA3",
            "EnergyShareA1",
            "EnergyShareA2",
            "EnergyShareA3",
            "EquivalentTrees",
            "FR1_B11_20Efficiency",
            "FR1_B18_10Efficiency",
            "FR1_B18_12.5Efficiency",
            "FR2_B11_20Efficiency",
            "FR2_B18_10Efficiency",
            "FR2_B18_12.5Efficiency",
            "GeneratedEnergyDayA1",
            "GeneratedEnergyDayA2",
            "GeneratedEnergyDayA3",
            "GeneratedPowerA1",
            "GeneratedPowerA2",
            "GeneratedPowerA3",
            "MI_B10_5Efficiency",
            "PowerShareA1",
            "PowerShareA2",
            "PowerShareA3",
            "SL_B11_28Efficiency",
            "TotalActiveEnergyConsumedDay",
            "TotalActivePowerConsumed",
            "TotalEmissions",
            "TotalEnergyShare",
            "TotalGeneratedEnergy",
            "TotalGeneratedEnergyDay",
            "TotalGeneratedPower",
            "TotalPowerShare"
        ],
        "onlyChangedAttrs": false,
        "attrsFormat": "normalized",
        "http": {
            "url": "http://quantumleap:8668/v2/notify"
        },
        "metadata": [
            "dateCreated",
            "dateModified"
        ],
        "lastSuccess": "2022-12-01T15:49:09.000Z",
        "lastSuccessCode": 500,
        "covered": false
    }
}

When I go into CrateDB to verify the creation of the table, it simply does NOT show up.当我进入 CrateDB 验证表的创建时,它根本就没有显示出来。

Am I doing something wrong with this particular subscription?我对这个特定的订阅做错了吗?

What should I do to get this table to appear in CrateDB?我应该怎么做才能让这张表出现在 CrateDB 中? since I need it to continue advancing in a project因为我需要它来继续推进项目

I am attentive to the comments and I am very grateful for the collaboration.我很注意评论,非常感谢合作。

I tried deleting and recreating the subscription and even the entity, hoping that after doing so, the table would be created after creating the subscription again.我尝试删除并重新创建订阅甚至实体,希望在这样做之后,再次创建订阅后会创建表。

The table was never created.该表从未创建过。

I tried to download the CrateDB service, whose version used is 5.0.0 and, after uploading it again, waiting for the table to appear, it still did not appear.我尝试下载CrateDB服务,使用的版本是5.0.0,再次上传后,等待出现表,还是没有出现。

the solution i found was to modify the entity type, both in the context entities and in the subscription.我找到的解决方案是在上下文实体和订阅中修改实体类型。 For some reason, a table for entity type "CALCULATION" was not being created in crate出于某种原因,实体类型“CALCULATION”的表未在 crate 中创建

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM