Topic sensor network
From AMTech WikiDocs
When an observation type instance is posted to the endpoint /amtech/things/events:
- the observation gets validated versus the semantic of the '@type'
- #{placeholders} get enriched
- location and proximity enrichment happens
If an error occurs an observation type observationoutputmsg get send to the sensor network topic /sensor_network/observation_errors/[observationTypeName] in the following example is an observation type observationresourcecrud sent with a wrong topic value "message": "Failed registering topic for observation"
{
"topic": "/sensor_network/observation_errors/observationresourcecrud",
"_tenant": "m2mcreator",
"@type": "/amtech/linkeddata/types/composite/observation/observationoutputmsg",
"resource": "{\"topic\":\" /helloWorld/asynch\",\"_tenant\":\"m2mcreator\",
\"targetthings\":\"[]\",
\"@type\":\"/amtech/linkeddata/types/composite/observation/observationresourcecrud\",
\"propId\":\"hwgreetingLabel\",\"resourceuri\":\"/amtech/things/entities/HelloWorld/helloWorld\",
\"resourcetype\":\"/amtech/linkeddata/types/composite/entity/HelloWorld\",
\"newvalue\":\"heyWithError\",\"guesttenants\":[],
\"oldvalue\":\"hey\",\"crudoperation\":\"PUT\",
\"producer\":\"helloWorld\",\"detectiontime\":\"2016-04-22T18:33:11.481Z\",
\"@id\":\"/amtech/things/observations/helloWorld5226521372857087\",
\"occurrencetime\":\"2016-04-22T18:33:10.948Z\",\"_user\":\"m2mcreator@amtech.mx\"}",
"_name": "idbf740e7d83064ba492c9ca33d20617a0",
"resourcetype": "/amtech/linkeddata/types/composite/observation/observationresourcecrud",
"message": "Failed registering topic for observation",
"guesttenants": [],
"producer": "enrichment-topology",
"detectiontime": "Fri Apr 22 18:33:11 UTC 2016",
"@id": "/amtech/things/observations/6de7bf42-2ea6-4140-a8f4-a427bc119701",
"success": false,
"messagedetail":
"Error registering topic '/amtech/things/eventsources/ ': Resource /amtech/things/eventsources/ is not valid for its type definition. Property @idcannot contain blank spaces. ",
"_user": "m2mcreator@amtech.mx"
}