J
J
javist2015-10-08 12:12:15
Java
javist, 2015-10-08 12:12:15

What to use to flush cache in Java webapp applications?

Good afternoon.
We have a web application distributed over several data centers (moreover, data centers in different countries). Each web application server has Tomcat installed and its own cache (based on the usual HashMap - don't ask why, it was just necessary).
This cache needs to be reset when a new event arrives from users and it needs to be reset on all servers. Now the reset is implemented through Java RMI, but for some reason it works very poorly, namely, requests through RMI do not always arrive at the server, so it often happens that the cache is simply not reset. I don't understand why, but I think that RMI does not work well between remote servers (in different countries) (but only works well over a local network).
What can you offer instead of RMI? Maybe just an http request through a normal servlet?
Thank you for attention.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
moryakov, 2015-10-09
@javist

If you can open a service port - write a command to the socket and reset it.

N
nagibator8000, 2015-10-08
@nagibator8000

replace self-written cache with hazelcast, ehcache, infinispan etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question