Multi-server executions using tomcat and spring

B

bigmurali

I have a tomcat web app running on many servers in a farm all
connected by a switch that routes incoming requests to the servers by
picking a server in a round-robin fashion.

I have a servlet/jsp in my web application to trigger an action (say
re-reading a disk file). This triggering obviously can happen in only
one of the tomcat servers in the farm that the switch happened to pick
when I invoke my servlet from a browser/HTTP client.

So the question is, how can I make this update happen simultaneously
in all the instances of my webapp that are running on each one of the
servers in the farm?

Can Spring JMX help accomplish this if I expose the Spring bean that
performs this action as an MBean? or is the question simply absurd?

I'd be happy to hear any other suggestions to make this happen.

thanks
 
A

Arne Vajhøj

I have a tomcat web app running on many servers in a farm all
connected by a switch that routes incoming requests to the servers by
picking a server in a round-robin fashion.

I have a servlet/jsp in my web application to trigger an action (say
re-reading a disk file). This triggering obviously can happen in only
one of the tomcat servers in the farm that the switch happened to pick
when I invoke my servlet from a browser/HTTP client.

So the question is, how can I make this update happen simultaneously
in all the instances of my webapp that are running on each one of the
servers in the farm?

Can Spring JMX help accomplish this if I expose the Spring bean that
performs this action as an MBean? or is the question simply absurd?

I'd be happy to hear any other suggestions to make this happen.

There must be many ways of achieving this.

I don't know Spring JMX, so I can not comment on that.

Two ways I can think of are:

1) store the loaded/reloaded data in a distributed cache
like JBoss Cache (there are other), then the update
will be propagated to all nodes

2) let the one node publish to a message queue that all nodes
has a subscriber to and let the message trigger whatever
needs to be done at all nodes

I am sure there are plenty of other solutions.

Arne
 
B

bigmurali

Actually I like your suggestion 1. I use Tomcat, not JBoss, since you
mentioned there are other distributed caches, please mention the ones
you know of. I will also Google for it, but the one I know already is
memcached.

thanks
- Murali.
 
A

Arne Vajhøj

Actually I like your suggestion 1. I use Tomcat, not JBoss, since you
mentioned there are other distributed caches, please mention the ones
you know of. I will also Google for it, but the one I know already is
memcached.

I belive JBoss Cache can be used in other app server than
JBoss App Server.

OSCache and EHCache are frequently used alternatives.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top