Red Hat Application Server: JOnAS User Guide | ||
---|---|---|
Prev | Chapter 33. JOnAS and JORAM: Distributed Message Beans | Next |
All these challenges can be addressed with the following set of configurations and supporting mechanisms.
Many variations are possible; we provide just the configuration that we have proved to work for us. It is possible to rearrange the configuration significantly (to have some queues hosted on some machines, and other queues on other machines; to use a distributed JNDI lookup rather than a centralized one; etc.), but we have not as yet done so.
Throughout we use our server1, server2, and server3 names as concrete examples of the configuration.
JORAM must be configured for distributed operation, roughly as described in section 3.2 of the JORAM administration guide (http://joram.objectweb.org/current/doc/joram3_7_ADMIN.pdf).
Each separate server machine must have its own instance of JORAM and its own instance of JOnAS.
Each JOnAS instance must be configured (via jonas.properties) to connect to its local JORAM.
The "server 0" JORAM instance must be launched first, followed by its associated JOnAS. This JOnAS instance, and this JOnAS instance only, is configured to create the queues and topics used in the system.
The second and third servers must then launch their JORAM and JOnAS (first JORAM, then JOnAS, then on to the next server) instances.
Each JOnAS server must implement a custom service (see http://jonas.objectweb.org/current/doc/Services.html) which, on startup, will perform the appropriate configuration for that specific server. We name this service the JoramDistributionService and provide source code for it below. This performs all the customized configuration described in the permission section above.
Since the configuration varies from server to server, the JoramDistributionService must read configuration information from a local configuration file. We place this file in the $JONAS_BASE/conf directory, from where it is loadable as a classloader resource. (This is a little-known JOnAS technique and it is not clear that it is guaranteed to work! If you know otherwise, please let me know: robj at nimblefish dot com.)
Summing up, the total configuration elements involved are:
$JONAS_BASE/conf/a3servers.xml -- the JORAM configuration file that specifies the distributed JORAM configuration. This file is identical on all participating servers.
$JONAS_ROOT/bin/<platform>/JmsServer -- the JORAM launch script that starts up JORAM. This varies on each server; the startup arguments (that is, "0 ./s0", "1 ./s1", etc.) initialize the local JORAM instance with knowledge of its role in the JORAM configuration.
$JONAS_BASE/conf/jonas.properties -- the JOnAS configuration file. On all servers, this is extended to include the initialization of the JoramDistributionService, which must happen after the initialization of the "jms" service, but before the initialization of all deployment services (since application deployment involves subscribing message beans to queues and topics, which must be bound before the deployment can succeed). On the server that is to host the application's topics and queues, the jonas.properties file also specifies those topics and queues; on all other servers, no topics or queues are created. Finally, the jms service is configured as non-collocated on all servers, though customized to use the local JORAM instance's URL.
$JONAS_BASE/conf/joramdist.properties -- the configuration file for the JoramDistributionService. This contains properties specifying the local JORAM's port number, which server is hosting the application's topics and queues, and which topics and queues should be bound locally.
Note that the JoramDistributionService must be built and installed in $JONAS_BASE before JOnAS itself can be launched!