We integrated a third-party telematics provider with ThingWorx 9.5 for real-time asset tracking. GPS location updates are delayed by 5-15 minutes, making our tracking dashboards unreliable. The telematics provider sends location data via REST API every 30 seconds, but ThingWorx displays stale locations.
We’re pulling data every minute using a scheduled service that calls the provider’s REST endpoint. The response includes timestamps, but we’re not sorting by them - just displaying the latest batch received.
GET /api/v1/vehicles/locations?batchSize=100
scheduler.interval=60000
data.maxAge=300000
Our fleet managers need accurate real-time locations for dispatch decisions. Should we switch from pull to push integration, or is there a better way to handle timestamp-based data sorting in ThingWorx?
Add a ‘lastLocationUpdate’ timestamp property to your asset Things. Before updating location, compare the incoming timestamp with lastLocationUpdate. Only update if incoming is newer. Also, batch processing might be inefficient - you’re processing 100 locations every minute even if only 10 vehicles moved. Consider switching to push with webhooks or at least reduce batch size and increase frequency.
For real-time tracking, push is definitely superior. We switched from pull to webhook-based push and our location lag dropped from 3-5 minutes to under 10 seconds. Setup a webhook endpoint in ThingWorx that the telematics provider calls whenever location changes. This eliminates polling overhead and gives true real-time updates.
Before switching to push, check if you’re properly handling the timestamp sorting. Even with pull integration, you shouldn’t see 15-minute delays. When you receive a batch of 100 locations, are you updating each asset’s location property based on the data timestamp or just processing them in the order received? The telematics provider might be sending historical data mixed with current data in each batch. Sort by timestamp descending and only apply updates if the new timestamp is newer than the current asset timestamp.
The lag is definitely from your pull-based approach. Pulling every 60 seconds means you’re always at least 1 minute behind. Push integration via webhooks would give you real-time updates as they happen. Most telematics providers support webhook callbacks.
You’re right - we’re not checking timestamps before updating. We just iterate through the batch and update properties. That could explain why we sometimes see older locations overwriting newer ones. How should we implement the timestamp comparison in ThingWorx services?