|
From: <jas...@ma...> - 2004-10-18 10:24:00
|
I've hacked together a JMS provider of the remoting layer in Spring, which works like the HTTP, JAX-RPC & Caucho implementations but which uses JMS for the underlying networking code. By using JMS we can now load balance requests for a service across multiple service endpoints; so we can easily implement a cluster of servers complete with load balancing and auto fail-over. Currently this assumes a state-less service model. We may wish to implement something a little more clever for stateful services (and how to fail-over in a cluster of stateful services), but this is a first cut which should be quite useful for clusters of stateless services - we could layer on top some kind of stateful mechanism. Some JMS providers have features like 'exclusive queues' or 'message groups' which can be used to provide stateful-like routing of messages similar to those used in EJB containers for stateful session beans. The code is pretty straightforward; just 3 classes, so I took the cheeky approach of checking it straight into the main code branch rather than leaving it spend time in the sandbox first; we can easily move it into the sandbox if need be. Where possible the makes use of the existing JmsTemplate code. To simplify the implementation code I used the QueueRequestor, but we could tidy that up later and use explicit send() / receive() instead to be able to support configurable timeouts and timeToLive values on a remote request etc. Any feedback or thoughts are most welcome James ------- http://radio.weblogs.com/0112098/ |