tile38
tile38 copied to clipboard
Multiple Collection Key in SetHooks
I am setting up the hooks like this
execute_command('SETHOOK', tile,url,'INTERSECTS','fleet,fleet:1,fleet:2','FENCE','DETECT','enter,exit','COMMANDS','set', 'OBJECT',line)
Idea is to do set object feet, set object fleet1 and set object fleet2 from various application to tile38 . Will the above SETHOOK method with multiple collections i,e fleet,fleet1,fleet2 right way to collect enter,exit from respective Set objects ?
is this the right way ? because after making this change when i m doing set object fleet POINT . no hooks are getting fired ...
and if i just do fleet only then hook for fleet is getting fired
execute_command('SETHOOK', tile,url,'INTERSECTS','fleet','FENCE','DETECT','enter,exit','COMMANDS','set', 'OBJECT',line)
There can only be one collection per hook. But there can multiple hooks pointing to the same url.
Well in that case if there are 50K geofences, and you are creating 50k hooks per collection. Is it fine just to handle different collection on same geofences we have to create another 50K hooks ?
Well i have kept the same hooks and same collection name. But what I am doing it like for same id i am distinguishing like '981231234321431' and 'old:981231234321431' .
One issue I came across, just wanted to know the confirmation, i am calling this in my GO code.
cmdToSendToTile :=redis.NewStringCmd("set", "fleet", iD,"field", "eventTime", time,"field", "s", speed,"point", laT, loN)
But there are few cases I found when s field was not recvd after geofence enter exit
e.g
**"{"command":"set","group":"5ce7a9474696604902b9ec30","detect":"enter","hook":"geoId_1902#452","key":"fleet","time":"2019-05-24T08:20:23.392852625Z","iD":"old:351","object":{"type":"Point","coordinates":[73.862951,18.811504]},"fields":{"eventTime":1556073780,"s":16}}"
{"command":"set","group":"5ce7a9474696604902b9ec2e","detect":"enter","hook":"geoId_26666#2","key":"fleet","time":"2019-05-24T08:20:23.362958478Z","iD":"old:351","object":{"type":"Point","coordinates":[73.865716,18.804929]},"fields":{"eventTime":1556064090}}**
Fields with the value of zero are not included in the json payloads.