Hi Rajith, All, I did some changes to the clustering code. Please send your comments ...
1. Changed signatures of the addContext, removeContext, updateState methods to take an AbstractContext. This makes the methods more general. IDs can be always obtained by going through the passed contexts correctly. 2. Added a flush() method to the AbstractContexst which calls the clusterManager.updateState() method when clustering is enabled. This allows Service authors to write their code in a transparent manner. I.e. if they hv done their state changes with flush() calls they will not have to do any changes to make their services clusterable. 3. Moved the replication point of the execution chain into a Handler. There is no need to hard code this into the AxisEngine or MessageReceiver. By placing the ReplicationHandler anywhere in the handler chain we can change the replication point as needed. Most probably this will be placed at the end of the flows. (please see the clustering/conf/axis2.xml). 4. Added a isContextClusterable (AbstractContext) method to the CM. ClusterManagers can say what contexts they are interested in clustering, this will be useful to the Service authors. 5. Moved the addContext() method calls out of the constructors of the Context classes. It seems like it's better to have these outside. When we are in the constructor we do not have a fully initiated context object. For e.g. the serviceGroupContextId does not get setted at the time the SGC get created. Currently, this made me call clusterManager methods from several places of the core. But I was talking to Deepal about introducing some factories to create Context classes, which will make things much cleaner. 6. Removed the NullClusterManager - as we discussed in the mailing list. I also got your sample working with these changes. Will try to do some additions to it. Chamikara On 2/5/07, Rajith Attapattu <[EMAIL PROTECTED]> wrote:
Hi folks, I have a working prototype for clustering based on the ClusterManager (we discussed this in a thread before) and Apache Tribes. I have created a branch for this (based on rev 503540 in trunk), so that interested parties can experiment with it. https://svn.apache.org/repos/asf/webservices/axis2/branches/java/clustering/ before compiling the code please install http://people.apache.org/~rajith /axis2-clustering/apache-tribes-0.9.5.2.jar<http://people.apache.org/%7Erajith/axis2-clustering/apache-tribes-0.9.5.2.jar>in your local maven repo under tribes. I have tested this with 6 nodes. The basic functionality is to replicate the service group context and the service context including the property bags. I still need to work on garbage collecting the ctx's when they are removed from the primary node. I have a Sample Account Service which I used to test the implementation at the follwing link. (both source and .aar file) http://people.apache.org/~rajith/axis2-clustering/<http://people.apache.org/%7Erajith/axis2-clustering/> To test, just proxy all operation via TCPMon, which will allow you to point at different nodes w/o restarting the clinet. Once you do the login operation in one node, feel free to run the other operations against different nodes via the TCPMon. Before running the example please, please copy http://people.apache.org/~ rajith/axis2-clustering/apache-tribes-0.9.5.2.jar<http://people.apache.org/%7Erajith/axis2-clustering/apache-tribes-0.9.5.2.jar>into your classpath as I haven't changed the scripts to copy this into the axis2 distributions. Please try it out and provide feedback, better yet if you can contribute to improve it. Regards, Rajith Attapattu Red Hat.
