xmlBlaster/demo/javaclients/cluster/README

Please read the cluster requirement

  http://www.xmlblaster.org/xmlBlaster/doc/requirements/cluster.html

first.

NOTE 1: You need to start all examples in the current directory
   xmlBlaster/demo/javaclients/cluster
   to assure the xmlBlasterPlugins.xml and *.properties files are found.

NOTE 2: You can switch on specific logging to get a better idea what
   happens, typically this is a good choice:
   -call[core] true -call[cluster] true -trace[cluster] true -trace[client] true -call[client] true

NOTE 3: The demo below has following setup.
   'avalon' is a slave to 'heron' for 'RUGBY_NEWS' messages.
   The publisher publishes to the slave and the subscriber
   subscribes from the master.


2. Start avalon (the xmlBlaster slave node):
============================================

   cd xmlBlaster/demo/javaclients/cluster

 Edit avalon.properties and change the IP variable
 to your host (the host where golan runs later).
  
   java org.xmlBlaster.Main -propertyFile avalon.properties -call[core] true

 'avalon.mycomp.com' listens now on bootstrapPort 7601.
 We have switched on logging of method calls in the 'core'
 to see when messages arrive.


3. Start a client connecting to avalon:
=======================================

   java javaclients.cluster.PublishToSlave -bootstrapPort 7601

  or

   java javaclients.cluster.PublishToSlave -bootstrapPort 7601 -numPublish 20 -interactivePublish true -session.name pubisher/2

 This publisher connects to the slave 'avalon'.
 The bootstrapPort 7601 is the same as specified for avalon in avalon.properties.
 We publish up to 20 messages, each must be sent by hitting
 enter on your console.
 We login with the name 'publisher' with the well known public
 session ID '2' which allows us to poll for the server 'avalon'
 if it is not yet running on our startup.


4. Start heron (the master):
============================

   java org.xmlBlaster.Main -propertyFile heron.properties -call[core] true

 Heron should be contacted by avalon and receive the
 tailed back message sent by PublishToSlave


5. Add a subscriber:
====================

   java javaclients.HelloWorldSubscribe -bootstrapPort 7600 -oid PublishToSlave.RUGBY_NEWS -session.name subscriber/1

   This subscriber connects to 'heron' (port 7600) which is the master of
   'PublishToSlave.RUGBY_NEWS' messages.
   We use the login name 'subscriber' and force the
   public session id '1' to be able to reconnect to the same
   session on failure.


NOTE: You can now play with this setup, for example
kill a cluster node, publish a message and restart the cluster
node to verify that no messages are lost.


Example configuration:
========================================
# Replace this with your IP:
IP=192.168.1.2

cluster.node[heron.mycomp.com]=\
   <clusternode id='heron.mycomp.com'>\
      <info>\
         <address type='SOCKET'>${IP}:7600</address>\
      </info>\
      <master type='DomainToMaster'>\
         <![CDATA[<key domain='RUGBY_NEWS'/>]]>\
      </master>\
   </clusternode>
      
cluster.node.info[avalon.mycomp.com]=\
   <clusternode id='avalon.mycomp.com'>\
      <info>\
         <address type='SOCKET'>${IP}:7601</address>\
      </info>\
   </clusternode>
cluster.node.master[avalon.mycomp.com]=\
   <clusternode id='avalon.mycomp.com'>\
      <master type='DomainToMaster'>\
         <![CDATA[<key domain='STOCK_EXCHANGE'/>]]>\
      </master>\
   </clusternode>

cluster.node.info[golan.mycomp.com]=\
   <clusternode id='golan.mycomp.com'>\
      <info>\
         <address type='SOCKET'>${IP}:7602</address>\
      </info>\
   </clusternode>
cluster.node.master[golan.mycomp.com]=\
   <clusternode id='golan.mycomp.com'>\
      <master type='DomainToMaster'>\
         <![CDATA[]]>\
      </master>\
   </clusternode>


