Universal Messaging 10.3 | Administration Guide | Universal Messaging Administration API | Realm Server Management | Clustering
 
Clustering
Universal Messaging provides the ability to group Realm servers together to form a cluster. A cluster is a logical group of realm servers that share common resources. The resources and any operations performed on then are replicated across all cluster members. Clients connecting to 'Realm A' in cluster 1, are able to access the same logical objects as clients connecting to Realms B or C in cluster1.
The state of these objects is fully replicated by each realm in the cluster. For example, if you create a queue (queue1) within cluster 1, it is physically created in realms A, B and C. If there are 3 consumers on queue1, say one on each of realms A, B and C respectively, each realm in the cluster will be aware as each message is consumed and removed from the different physical queue1 objects in the 3 realms.
If one of the realms within cluster1 stops, due to a hardware or network problems, then clients can automatically reconnect to any of the other realms and start from the same point in time on any of the other realms in the cluster.
This ensures a number of things:
*Transparency - Any client can connect to any Universal Messaging realm server within a cluster and see the same cluster objects with the same state. Clients disconnected from one realm will automatically be reconnected to another cluster realm.
*24 x 7 Availability - If one server stops, the other realms within the cluster will take over the work, providing an always on service
nClusterNode
Using the nAdmin API, if you wish to create a cluster that contains 3 realms, and you know the RNAME values for all 3, then the following call will create the cluster.
Java, C#, C++:

String[] RNAME= {"nsp://127.0.0.1:9000", "nsp://127.0.0.1:10000","nsp://127.0.0.1:11000"};
nRealmNode realms[] = new nRealmNode[RNAME.length];
nClusterMemberConfiguration[] config = new nClusterMemberConfiguration[RNAME.length];
for (int x = 0; x < RNAME.length; x++) {
// you don't have to create the realm nodes
// here, since the member configuration will create
// them for you from the RNAME values
realms[x] = new nRealmNode(new nSessionAttributes(RNAME[x]));
config[x]=new nClusterMemberConfiguration(realms[x], true);
}
nClusterNode cluster = nClusterNode.create("cluster1", config);
Once the cluster node is created, each realm node within the cluster will know of the other realms within the cluster, and be aware of the cluster they are part of. For example, calling the following method:
Java, C#, C++:
nClusterNode cluster = realms[0].getCluster();
will return the cluster node just created with the realm with nsp://127.0.0.1:9000 for an RNAME.
Cluster nodes contain information about the member realms (nRealmNode objects) as well as the current state of the cluster members. This information can be found by calling the getClusterConnectionStatus() method on the cluster node, which returns a vector of nClusterStatus objects, each of which corresponds to a realm.
nRealmlNode
Once a realm becomes part of a cluster, channels and queues can be created that are part of the cluster, as well as standard local resources within the realms. For example, if you were to us the following calls:
Java, C#, C++:
nChannelAttributes cattrib = new nChannelAttributes();
cattrib.setMaxEvents(0);
cattrib.setTTL(0);
cattrib.setType(nChannelAttributes.PERSISTENT_TYPE);
cattrib.setClusterWide(true);
cattrib.setName(“clusterchannel”);
nLeafNode=.createChannel(cattrib);
realms[0].createChannel(cattrib);
This would create a channel that is visible to all realms within a cluster. Any administrative changes made to this channel such as ACL modifications will also be propagated to all cluster members in order for the channel to be kept in sync across all realms.
Inter-Cluster Connections
Inter-cluster connections can be created programmatically through the Administration API. To do this, connect to a realmNode in each cluster and then do the following:
Java, C#, C++:

cluster1realm1.getCluster().registerRemoteCluster(cluster2realms1.getCluster());
Similarly, the inter-cluster connection can be removed programmatically:
Java, C#, C++:

cluster1realm1.getCluster().deregisterRemoteCluster(cluster2realm1.getCluster());
For more information on Universal Messaging Administration, please see the API documentation, and the Enterprise Manager Guide.