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,
Hi Phar - many thanks for yor reply.
You said: ["The Veritas Cluster would also run an instance of NotificationBus "].
How would Veritas Cluster run the NotificationBus? Would we need to write an application agent?
Many thanks in advance,