- Newest
- Most votes
- Most comments
Yes, this is how you could check if a tracker exists. Alternatively you could call another operation on the tracker and see if you got a ResourceNotFoundException.
However, I am curious about what you are trying to achieve, because your code sample, mentions location.updateTracker(); // update the tracker with vehicle position
. UpdateTracker is an API to update the properties of a given tracker like its description and not for updating device positions.
Can you explain a little bit more about what you are trying to do, I may be able to help... (for example, why are you creating a tracker per truck?)
Yes. You can track thousands of devices with a single tracker. BatchUpdateDevicePosition also allows you to associate 1-3 attributes with positions that you send to tracking service, and you will get them from EventBridge with the Enter/Exit events. (see PositionProperties)
In your case, you could have just one tracker and send truck specific information like the truck name with each position and use it in the lambda that will be your target for EventBridge.
Thanks,
Oren
Relevant content
- asked 2 years ago
- asked 2 years ago
- asked 10 months ago
- asked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 3 years ago
Perhaps updateTracker isn't the appropriate API call. I am only trying to update the position for a given truck (not the properties of a tracker).
What I am trying to accomplish is the following: -Track the position for all of the trucks in the fleet -Link a tracker to a Geofence collection, with a couple thousand geofences in that collection -When a given truck enters or exits a geofence, I am going to use EventBridge to target a lambda to store the data for that truck
The tracker will only live for a limited time when a truck is approaching a geofence, and then get destroyed. I want to get the specific truck information upon enter/exit a geofence in the collection. Seems to me that it would make sense to have a 1-to-1 mapping of tracker to truck.
Dumb question: can you track multiple vehicles with one tracker? I just looked at the API docs for "batchUpdateDevicePosition", and it looks like DeviceId is part of the parameters to Update. Would it make more sense to just have one tracker for our ~8,000 trucks?