7.17.1 System starting procedure

To start a system using Cosminexus JMS Provider, use the following procedure. Note that steps 1 and 2 are in a random order.

Note
Before you start the CJMSP resource adapter, make sure you start CJMSP Broker. The CJMSP resource adapter cannot be started before starting CJMSP Broker. Also, if you stop the J2EE server when the CJMSP resource adapter is running, stop CJMSP Broker, and then restart the J2EE server, the CJMSP resource adapter fails to restart.
  1. Start each execution environment process of the J2EE applications containing the J2EE server.
    You can batch start a system set up with Smart Composer. For details, see 4.1.1 System starting procedure in the uCosminexus Application Server Management Portal User Guide.
    Note
    At this point, the CJMSP resource adapter and the J2EE application are not running.
  2. Start CJMSP Broker.
    The following is an example of execution for starting CJMSP Broker 'MyBroker':
    Example of execution
    In Windows
    Cosminexus-installation-directory\CC\cjmsp\bin\cjmsbroker -name MyBroker
    In UNIX
    /opt/Cosminexus/CC/cjmsp/bin/cjmsbroker -name MyBroker
    Note that when you start CJMSP Broker, as and when required, change the Java heap size used by CJMSP Broker #.
  3. Start the CJMSP resource adapter.
    The following is an example of execution using the server management commands. In this example, the J2EE server name is 'cmx_MyWebSystem_unit1_J2EE_01', and the CJMSP resource adapter name is 'Cosminexus_JMS_Provider_RA'.
    Example of execution
    In Windows
    Cosminexus-installation-directory\CC\admin\bin\cjstartrar "cmx_MyWebSystem_unit1_J2EE_01" -resname "Cosminexus_JMS_Provider_RA"
    In UNIX
    /opt/Cosminexus/CC/admin/bin/cjstartrar "cmx_MyWebSystem_unit1_J2EE_01" -resname "Cosminexus_JMS_Provider_RA"
  4. Start the J2EE application that sends and receives the messages.
    The following is an example of execution using the server management commands. Note that in this example, the J2EE server name is 'cmx_MyWebSystem_unit1_J2EE_01', and the J2EE application name is 'JMSSampleApp'.
    Example of execution
    In Windows
    Cosminexus-installation-directory\CC\admin\bin\cjstartapp "cmx_MyWebSystem_unit1_J2EE_01" -name "JMSSampleApp"
    In UNIX
    /opt/Cosminexus/CC/admin/bin/cjstartapp "cmx_MyWebSystem_unit1_J2EE_01" -name "JMSSampleApp"
# Concept of the Java heap size used by CJMSP Broker
By default, CJMSP Broker uses 192 MB of the Java heap. This value is too small to handle a large amount of messages, so increase the value as and when required.
If the memory size of the Java heap to be used is too small, the connections with the J2EE application need to be closed in order to allocate free memory, and the amount of processable messages decreases.
However, if you increase the maximum Java heap size that can be used with CJMSP Broker excessively, the physical memory of the system is affected and causes OutOfMemoryError in the system. If OutOfMemoryError occurs, apart from lowering the system performance, errors occur in CJMSP Broker in unexpected situations and affect the execution of other applications and services.
Considering all this, specify an appropriate value according to the executed environment.
You can specify the Java heap size to be used by CJMSP Broker in the -vmargs option of the cjmsbroker command when you start CJMSP Broker.
The following is an example of execution:
Example of execution

cjmsbroker -vmargs "-Xms256m -Xmx1024m"

In this example, CJMSP Broker uses 256 MB memory when starting, and the settings are specified to use maximum 1 GB of Java heap.