-
1. Re: Using JBossCache to implement a global working queue
manik Jan 20, 2006 9:09 AM (in response to freter)Simple rule of thumb - for sharing data across multiple nodes, use JBossCache. For broadcasting messages to servers, use JGroups. JGroups messages may be calls to remote methods, and may include data payloads. This is how JBossCache is implemented.
Sounds to me what you need is a JMS message queue though!! :) You can achieve similar functionality with JBossCache + transactions though. -
2. Re: Using JBossCache to implement a global working queue
freter Jan 20, 2006 9:38 AM (in response to freter)"manik.surtani@jboss.com" wrote:
Sounds to me what you need is a JMS message queue though!! :)
Not sure. Imagine the following case:
You have two connections. One of them goes from Hamburg to Verona, the oter one goes from Berlin to verona. The connections will be operated by three trains: T1 from Hamburg to Hannover, T2 from Berlin to Hannover, T3 from Hannover to Verona. In order to maximize the load factor, the optimization servers now have to answer requests like "can we accept 10 additional containers for the connection Hamburg to Verona?". Another request might be "can we accept another 5 containers from Berlin to Verona". These requests might arrive at the same time, but they cannot be processed in parallel, but must be serialized. You can only parallelize requests like "is there room for 5 containers from Hamburg to Hannover" and "is there room for 10 containers from Berlin to Hannover" - because they do not share a common leg.
If we only had one optimization server, this wouldn't be much of a problem. So, a work package may only be removed from the working queue after it has been sucessfully optimized. I am not sure if one can achieve this with JMS. -
3. Re: Using JBossCache to implement a global working queue
manik Jan 20, 2006 9:58 AM (in response to freter)Ok, fair enough - makes more sense now. Yeah, JBossCache is probably your answer, not JGroups.
-
4. Re: Using JBossCache to implement a global working queue
freter Jan 20, 2006 10:29 AM (in response to freter)"manik.surtani@jboss.com" wrote:
Ok, fair enough - makes more sense now. Yeah, JBossCache is probably your answer, not JGroups.
Thanks for your answer, Manik.
Something that struck me: is "Cache" the right term for what JBossCache does? It seems to me that it is more like a global transactional store for everything and nothing in particular... -
5. Re: Using JBossCache to implement a global working queue
manik Jan 20, 2006 11:18 AM (in response to freter)Yes, we do have that debate quite often! It did start as a pure cache, and kind of grew into a distributed, transactional object store. We're even going to be releasing a product that uses AOP to cluster objects and replicate transparent to user code. See
http://www.onjava.com/pub/a/onjava/2005/11/09/jboss-pojo-cache.html
Cheers,
Manik