I had to do something similar.

Using JGroups, we had each jboss server join the same peer group upon startup using an 
MBean. 

It was very easy.  We used an MBean to wrap the JGroups NotificationBus class and join 
the group upon MBean startup and leave the group upon MBean shutdown.

NotificationBus detects when a member explicitly joins the group, explicitly leaves 
the group, and when a member crashes.   How this happens is entirely customizable (UDP 
or TCP multicast or unicast, time until a crash is detected, retry attempts, etc, etc).

The Veritas Cluster would also run an instance of NotificationBus and join the group 
to detect when JBoss instances join, leave or crash and act accordingly.

It took me an hour or two to understand how to use JGroups because of their excellent 
tutorial - on jgroups.org - and another day and a half to implement the whole thing.  
Awesome stuff.

If you just want to play around with it, a JGroups 2.2 jar is already included in 
JBoss 3.2.x, located in $JBOSS_HOME/server/all/lib/jgroups.jar

To see how NotificationBus works you can run a neat demo from multiple console windows:

java -cp $JBOSS_HOME/server/all/lib/jgroups.jar org.jgroups.demos.NotificationBusDemo

In your case, each console window would simulate a different JBoss installation.  Type 
'exit' to explicity leave the group or you can just close the window to simulate a 
crash.

You can read the JGroups tutorial or browse through the NotificationBus and 
NotificationBusDemo source code on sourceforge to find out more options and how to use 
it explicitly.

NotificationBus also can send and receive messages to/from other members as well as 
share a distributed object cache.  We didn't need any of that and just wanted the 
notification functionality.  Pick what you need.

JGroups is a stable library, very easy to use, and has a great no-nonsense tutorial.  
In fact, JBoss uses it as the backbone for its JMS implementation as well as its 
clustering solution, so you can use it knowing it is capable enough to suit your needs.

Hope that helps,

Phar

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3838694#3838694

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3838694


-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to