- "description": "Open two tabs on a browser. Go to the event monitor (`http://localhost:3000/app/monitor`) to see the payloads that are\nreceived when a subscription fires, and then go to store001\n(`http://localhost:3000/app/store/urn:ngsi-ld:Building:store001`) and buy beer until less than 10 items are in stock.\nThe low stock message should be displayed on screen.\n\n\n\n`low-stock-store001` is fired when the Products on the shelves within Store001 are getting low, the subscription payload\ncan be seen below:\n\n\n\nThe data within the payload consists of key-value pairs of the attributes which were specified in the request. This is\nbecause the subscription was created using the `format=keyValues` attribute. The `@context` is not present in the\npayload body since `endpoint.accept=application/json` was set. The effect is to return a `data` array in a very similar\nformat to the `v2/subscription/` payload. In addition to the `data` array, the `subscriptionId` is included in the\nresponse, along with a `notifiedAt` element which describes when the notification was fired.\n\nNow go to store002 (`http://localhost:3000/app/store/urn:ngsi-ld:Building:store002`) and buy beer until fewer than 10\nitems are in stock. The low stock message is once again displayed on screen, the payload can be seen within the event\nmonitor.\n\n\n\nThe second subscription has been set up to pass the full normalized NGSI-LD payload along with the `@context`. This has\nbeen achieved by using the using the `format=normalized` attribute within the subscription itself, as well as setting\n`endpoint.accept=application/ld+json`, so that the `@context` is also passed with each entity."
0 commit comments