TC10.21: How to register automatically an uri callback on Orion Context Broker , subscription to broker

×

Warning message

You can't delete this newsletter because it has not been sent to all its subscribers.

For Context Broker of kind "internal" and protocol "ngsi" it's possible to define an uri callback that is called automatically wherever some new data are published to the Context Broker. The uri is called Url Orion Callback and is avaialable on the tab Subscription whenever a context broker is created/edite

 

The payload sent to orion context broker is:

 

curl -v <ip_orion_broker>:<port_orion_broker>/v2/subscriptions -s -S --header 'Content-Type: application/json'  -d @- <<EOF

{

"description": "<Name of the context broker>",       

"subject": {

"entities": [

{

"idPattern": ".*",

"typePattern": ".*"

}

],

"condition": {

"attrs": []

}

},

"notification": {

"http": {

"url": "<Url Orion Callback>"

}

},

"expires": "2030-01-01T00:00:00.00Z"

}

EOF

 

The subscription_id is later on saved and shown to the user.

 

HTTP/1.1 201 Created

Connection: Keep-Alive

Content-Length: 0

Location: /v2/subscriptions/<subscription_id>

Fiware-Correlator: 9ac7bbba-2268-11e6-aaf0-d48564c29d20

Date: Wed, 25 May 2016 11:05:35 GMT

 

whenever the subscription failed, a special value is insert "FAILED" --> The automatic subscription failed (anyway the context broker is registered even if the subscripion failed)

whenever the subscription is null, means the automatic subscription is not available --> The automatic subscription is disabled

whenever the user change the <Url Orion Callback> or the <ip_orion_broker> or the <port_orion_broker>, the old subscription is removed and a new one is submitted

whenever the user delete the context broker, the subscription is removed

 

DELETE /v2/subscriptions/<subscription_id>

 

TC10.21: How to register automatically an uri callback on Orion Context Broker , subscription to broker | Snap4City

Error

×

Error message

  • Notice: Trying to get property of non-object in user_is_logged_in() (line 1576 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_is_logged_in() (line 1576 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in og_field_access() (line 578 of /var/www/html/drupal/sites/default/modules/og/og.module).
  • Notice: Trying to get property of non-object in user_access() (line 806 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 818 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 819 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 825 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 828 of /var/www/html/drupal/modules/user/user.module).
  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/drupal/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/drupal/includes/bootstrap.inc).
  • Error: __clone method called on non-object in og_user_access_entity() (line 2249 of /var/www/html/drupal/sites/default/modules/og/og.module).
The website encountered an unexpected error. Please try again later.