ClusterTopic provides reliable Publish/Subscribe message model
communication between the nodes in the Resin cluster.
Following example shows how to make two nodes in resin cluster
communicate between each other using cluster topic.
This example makes use of
Candi
Resin's dependency injection implementation.
1. ClusterTopic Configuration
<registry>
<resin xmlns="http://caucho.com/ns/resin"
xmlns:jms="urn:java:com.caucho.jms">
<cluster id="">
<server id="a" port="6700"/>
<server id="b" port="6701"/>
<host id="">
<web-app id="">
<jms:ClusterTopic>
<jms:name>server_topic</jms:name>
</jms:ClusterTopic>
</web-app>
</host>
</cluster>
</resin>
</registry>
Above configurations would make ClusterTopic to run on nodes 'a' and 'b'.
2. Executing following lines of code on node 'a', would make node 'a' as
the subscriber to the Topic: