This is archived documentation for an older version of Nirvana (v2.0). Please refer to documentation for the latest version if required.

How to create a channel join programatically?

Joining a channel to another allows you to set up content routing such that events on the source channel will be passed on to the destination channel also. Joins also support the use of filters thus enabling dynamic content routing.

Channels can be joined using the Nirvana Realm Manager GUI or progrmatically.

In joining two Nirvana channels there are three compulsory options and two optional ones. The compulsory options are the name of the source channel, the Realm name hosting the destination channel and the destination channel name. The optional parameters are the maximum join hops and a JMS message selector to be applied to the join.

Channel joins can be created using the nmakechanjoin join script which is provided in the bin directory of the Nirvana installation. For further information on using this script please see the Nirvana programming guide.

Nirvana joins are created as follows:

//Obtain a reference to the source channel
nChannel mySrcChannel = mySession.findChannel( nca );

//Obtain a reference to the destination channel
nChannel myDstChannel = mySession.findChannel( dest );

//Obtain a reference to the destination channel's realm
nRealm realm = myDstChannel.getChannelAttributes().getRealm();

//create the join
mySrcChannel.joinChannel( myDstChannel, true, jhc, SELECTOR );

 

For further example code demonstrating channel joins please see the Nirvana joins example.