Search code examples
fiwarefiware-orioncrate

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).

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.

Below I share the JSON that I am using to create this subscription (following the format that I have used in previous subscriptions):

{
    "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

Additionally, when I query OCB for subscriptions, I get, among the existing subscriptions created, the one I just created:

{
    "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.

Am I doing something wrong with this particular subscription?

What should I do to get this table to appear in 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.


Solution

  • 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