-1

I have created Restful Web Services using Jersey over Java. My client is an iOS app which sends user data after every 1 minute. What would be the best way to detect that client has stopped sending the data due to either network lost or app killed by the user. I want to detect it on my API server.

Aakash Mangal
  • 125
  • 3
  • 12
  • How about having a timestamp for the last request received for all connected clients in a list and have a thread run through the list and identify those older than 2 minutes? – Ravindra HV May 17 '16 at 20:19
  • I am thinking on similar lines. Trying to use Redis to cache the keys with expire time,refreshing the keys on each call and creating a callback on expiry – Aakash Mangal May 17 '16 at 20:52
  • I am able to do it using Redis notification callback mechanism. For reference I used 1. http://basrikahveci.com/a-simple-jedis-publish-subscribe-example/ 2. http://stackoverflow.com/questions/26406303/redis-key-expire-notification-with-jedis – Aakash Mangal May 18 '16 at 18:10
  • Good to hear that. You could answer your own question and accept it. It could help someone else. – Ravindra HV May 18 '16 at 18:41

1 Answers1

0

I am able to do it using Redis event notification mechanism. For reference I used

Community
  • 1
  • 1
Aakash Mangal
  • 125
  • 3
  • 12