Multicast

You can add a multicast configuration in the Enterprise Manager (see Adding a Multicast Configuration), but you can also do this programmatically.

Creating the nMulticastConfiguration

To create an nMulticastConfiguration object, you must specify two parameters:

  • multicastAddress - Multicast IP address to use
  • adapter - Network adapter address of your multicast configuration
String multicastAddress = "227.0.0.98";
    String adapter = "10.150.12.1";
    nMulticastConfiguration mConf = new nMulticastConfiguration(multicastAddress, adapter);
    

Enabling multicast for cluster communication

Multicast support for cluster communication is deprecated.

In order to use multicast for intra-cluster communication you need to set a flag on the nMulticastConfiguration:

mConf.setUseForCluster(true);

Applying the multicast configuration

In order to register the new configuration on the server you will need to connect to a Universal Messaging Realm and establish an nRealmNode (see nRealmNode). You can then get a reference to the nMulticastManager:

nMulticastManager mMgr = realm.getMulticastManager();

You can now use the nMulticastManager to send the new configuration to the server:

mMgr.addMulticastConfiguration(mConf);