Nirvana Java - Channel Joins

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

Please note that while channels can be joined to both channels and queues, queues cannot be used as the source of a join.

Channels can be joined using the Nirvana Enterprise Manager GUI or programmatically.

In joining two Nirvana channels there is one compulsory option and two optional ones. The compulsory option is the destination channel. The optional parameters are the maximum join hops and a JMS message selector to be applied to the join.

Multiple Path Delivery

Nirvana users can define multiple paths over different network protocols between the same places in Nirvana. Nirvana guarantees that the data always gets delivered once and once only.

Creating Channel Joins

Channel joins can be created using the nmakechanjoin join sample application which is provided in the bin directory of the Nirvana installation. For further information on using this example please see the nmakechanjoin example page.

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 );

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

Channel joins can also be deleted. Please see the delete channel join example for more information.

Archive Joins

It is possible to archive messages from a given channel by using an archive join. To perform an archive join, the destination must be a queue in which the archived messages will be stored. An example of this can be seen below:

Since this is an archive join, all events matching the optional selector parameter(all events if no selector is specified) will be put into the archive queue, by design this includes all duplicate events published to the source.

nChannelAttributes archiveAtr = new nChannelAttributes();
archiveAtr.setName(rchanName);
nQueue archiveQueue = mySession.findQueue(archiveAtr);
mySrcChannel.joinChannelToArchive(archiveQueue);