Subscription to CB working but not visible

后端 未结 1 719
再見小時候
再見小時候 2021-01-20 21:02

I have an entity represented on the Context Broker with severall attributes (such as temperature, humidity etc...). I have a MySql database that persists the values from tha

相关标签:
1条回答
  • 2021-01-20 21:35

    Note that you are running Orion in multiservice mode. Thus, entities/attributes/subscriptions are separated by tentant/services completely isolated in different databases at MongoDB layer. In particular, note that the subscribe context request is using Fiware-Service: fiwarefinal so the subscription is created in the "fiwarefinal" service (associated to the orion-fiwarefinal DB).

    Thus curl http://localhost:1026/v2/subscription will not show any subscription, as the subscrition query is resolved in the default tenant (associated to the orion database). The same for echo 'db.csubs.count()' | mongo orion --quiet. In order to get the subscription list (or count in DB) for the "fiwarefinal" service you should use:

    • curl --header 'Fiware-Service: fiwarefinal' http://localhost:1026/v2/subscription
    • echo 'db.csubs.count()' | mongo orion-fiwarefinal --quiet

    Note that you also need to use Fiware-Service: fiwarefinal in the unsubscribe context operation if you want to remove subscription in the "fiwarefinal" tenant/service.

    Please find, more information about multiservice mode and how it relates with DB level.

    0 讨论(0)
提交回复
热议问题