Inconsistent behavior with HTTP Rest API
We have written a groovy script to determine availability of users (online/offline) and we are using HTTP Api to get the user(s) status. Sometimes (1/20) we get response different then expected, possibly response of a completely different request. Note that we have ~200 requests per second. So,
Is there some issue with our script?
Is there concurrency issue in using script?
Can there be some packet ordering problem?
Kindly provide some insight on how does the http server communicates with xmpp server to access users_session/session manager and how can we fix this problem.
P.S. We are using tigase 5.2.3 version
Added by Artur Hefczyc almost 4 years ago
It can be any of the issues you listed, we would have to investigate it closely to make sure.
However, I think your approach to the subject is very inefficient. HTTP calls are quite slow and inefficient "by design". HTTP was simply designed for a different purpose and does not work well for tasks like this. My suggestion is to use a different method to collect user's online status. The best option which comes to my mind is to configure presence packets forwarding to some selected JID, connect a bot on this JID and this way collect all user's presences in real time. This would be much faster and much less resource consuming.