I am using kafka to forward positions.
From Kafka topic i get this data:
{
"position": {
"id": 0,
"attributes": {
"batteryLevel": 55,
"steps": 0,
"distance": 0.0,
"totalDistance": 5.50504519E7,
"motion": false
},
"deviceId": 2,
"protocol": "watch",
"serverTime": "2023-08-13T19:48:19.792+00:00",
"deviceTime": "2023-08-13T19:48:19.792+00:00",
"fixTime": "2023-08-13T19:47:00.000+00:00",
"outdated": true,
"valid": true,
"latitude": 36.8135368,
"longitude": 10.1710941,
"altitude": 0.0,
"speed": 0.0,
"course": 0.0,
"address": null,
"accuracy": 3243.0,
"network": null,
"geofenceIds": null
},
"device": {
"id": 2,
"attributes": {
},
"groupId": 0,
"calendarId": 0,
"name": "watch",
"uniqueId": "9705141740",
"status": "online",
"lastUpdate": "2023-08-13T19:48:19.792+00:00",
"positionId": 1678,
"phone": null,
"model": null,
"contact": null,
"category": null,
"disabled": false,
"expirationTime": null
}
}
position.id : 0
device.positionId : 1678
But when i fetch device from Api I get this:
{
"id": 2,
"attributes": {},
"groupId": 0,
"calendarId": 0,
"name": "watch",
"uniqueId": "9705141740",
"status": "online",
"lastUpdate": "2023-08-13T19:48:19.792+00:00",
"positionId": 1682,
"phone": null,
"model": null,
"contact": null,
"category": null,
"disabled": false,
"expirationTime": null
}
device.positionId : 1682
So, device.positionId it's not updated in kafka data. and there is no position.id
And I need to save the last position id of the device in my server. How can i achieve that ?
Thank you.
I am using kafka to forward positions.
From Kafka topic i get this data:
position.id : 0
device.positionId : 1678
But when i fetch device from Api I get this:
device.positionId : 1682
So, device.positionId it's not updated in kafka data. and there is no position.id
And I need to save the last position id of the device in my server. How can i achieve that ?
Thank you.