Pramati Technologies Home

Configuring Message Server as a Standalone Node

The Standalone Message Server can be installed and configured separately from the J2EE Server using the Server Administration Service.

Configuring Standalone Message Server

This section describes the steps to create, modify and remove a Standalone Message Server using the Server Administration Service.

Creating Standalone Message Server

To create a Standalone Message Server on the Server Administration Service screen:

  1. Start the Server Administration Service.
  2. Click `Message Server' in the Explore panel. The `Add Standalone Message Server' page appears in the Display panel.
  3. Enter the following details:
    Table 16: Details needed for configuring a Standalone Message Server
    Fields
    Description
    Name
    Name for the new standalone message server, say, `Demo_MsgServer'.
    Host
    The Host machine name (IP) on which the standalone message Server is to be configured, say, `192.168.1.143'. This can be any machine in the LAN where the Server Administration service is running.
    Lookup Port
    The Lookup Port on the host machine on which the Server will start, say `9191'.
    Fields
    Description
    Name
    Name for the new standalone message server, say, `Demo_MsgServer'.
  4. Click `Save'.

A new server instance `Demo_MsgServer' running on the host 192.168.1.143 is added, with its naming service listening on Port 9191. This takes you back to the Server Administration Service Home page where the new server appears in the list of managed servers.

Configuring Standalone Message Server

To configure (verify or modify) the details for the Standalone Message Server, click the `Configure' button. This takes you to the `Home > Message Server' screen.

You can modify details for the Lookup Port (mandatory field), while the Host address is shown as a non-editable field. Save the modifications made. You can even start the specific Server from this page using the `Start' button.

Starting Standalone Message Server

To start the Server:

  1. On the Server Administration Service Home page, click `Start' against the required Standalone Message Server.
  2. The `Home > Message Server' page appears displaying the following fields to be specified to start the `Demo_MsgServer'.
  3. The fields Name, Host, and Lookup Port cannot be edited. These values are the same that were used while adding the server, and are displayed as default. You need to provide the following details:
    Table 17: Details needed for starting a Standalone Message Server
    Fields
    Description
    Realm
    Provide here the Realm name. By default, this appears as `system'.
    User Name
    Provide here the user name for the specified Realm. By default, this appears as root for the `system' Realm.
    Password
    Provide here the password for authenticating the user name. For the user name root, the default password is `pramati'.
    JVM options
    Provide here the JVM options, if you want to pass any Java options.

Viewing details of Standalone Message Server

To view the details for the new server, click its name that is provided as a link on the Server Administration Service page. This takes you to the `Home > Message Server' screen showing the details for the Host and Lookup Port.

Once the server has started, you can connect to it from this screen using the Connect button provided.

Connecting to Standalone Message Server

To connect to the Standalone Message Server:

  1. Once you have started the Standalone Message Server, click `Connect'. This takes you to the login screen for Console.
  2. Enter the user name as `root' and password as `pramati'. Click `Login'.
  3. On successful login, the Console Home page appears. You can see the configuration details of the connected server in the `Server Configuration' section.

Stopping Standalone Message Server

To stop a connected Standalone Message Server, click `Stop Server' on the Console. To exit from the Console, click `Logout'.

In the Server Administration Service Home page, the `Connect' option changes back to `Start'.

Note: You must refresh the main page to verify the status.

Removing Standalone Message Server

You can remove a Standalone Message Server only if it is not running. To remove a server:

  1. On the Server Administration Service Home page, select the server that is to be removed.
  2. Click `Delete'.

Using Loaded Send Queues

Loaded Send operation in Pramati Message is used in situations where there is a fast sender and a slow receiver. Normally, messages are kept in-memory. If the number of messages that are sent are increased, this may increase the memory usage infinitely. There are two ways to overcome this limitation:

Setting the max queue size to the maximum possible value based on the activity of the application however has its disadvantages. Here the client cannot send messages beyond the maximum size specified, in case messages cross the max limit.

To overcome this, the loaded send queues can be used. In the next section we will discuss how to configure the Message Server for loaded queues.

Configuring the Message Server for Loaded Queues

The following components are required to configure the Message Server for loaded queues.

The loaded send feature uses a property file (loadedsend.props) where the maximum and minimum number of messages that can be maintained are specified. This file can be placed anywhere. The server should be started with the following system property specifying the path to the properties file:

-Dcom.pramati.loadedsendprops = <path>/<to>/<the>/<loadedsend.props file>

Here is how the loadedsend.props property file looks:

queues=JMSQueue,SellQueue 
minruntimesize=100 
maxruntimesize=2000 

In the above:

Messages in the loaded send operations are stored in a temporary table. Below is the schema for the loaded send temporary table. A temporary table (temp_messages) should be created comprise of the following columns:

Note that this table must be created in the database to which the JMS server uses to store messages. Here are a few examples:

    CREATE TABLE temp_messages (	mid varchar(254) primary key, 	 
					message long bit varying,  
					destination varchar(60),  
					expirationtime numeric(32)); 
    CREATE TABLE temp_messages (	mid varchar(255) primary key,  
					message long raw,  
					destination varchar(60), 
					expirationtime number); 
    CREATE INDEX temp_messages1 ON temp_messages(destination) 

Starting Standalone Message Server using Command line

  1. Open a command window at <install_dir>/server/bin
  2. Execute: runserver -node <nodename>
  3. Specify the Message Server node name in <nodename> that you have created.
Note: For a Message Server node, ensure that JMSService is enabled in server-config.xml, located at [server_install]/server/nodes/<node_name>/config.

The command to start Standalone J2EE Server, a J2EE Server Cluster or Message Server node is same.

The command runserver -node <nodename> also helps in creation of a new node.

Understanding Message Server Configuration

All the above operations can be performed by changing the default configurations in the JMS configuration file jms-config.xml. This section provides an overview of how the configuration file can be modified for configuring a standalone Message Server.

Configuring Large Message Handling

A JMS message is termed as `large message' when the message exceeds the maximum size that the server can handle. This maximum size is configured on each destination separately. The maximum size of the message is specified through the following tag under each destination.

<max-message-size-kb>50</max-message-size-kb> 

Also, you can specify the action for the Server, when the message exceeds the maximum size. by configuring the <message-size-overflow-policy> value as follows:

<message-size-overflow-policy> 
	handle-with-persistence 
</message-size-overflow-policy> 

The value can be either be `handle-with-persistence' or `throw-exception'.

If the policy is `handle-with-persistence', when the sender sends a large non-persistent message, then the server will override its delivery mode from persistent to non-persistent and continue sending the message to the receiver. If the policy is `throw -exception', then when the sender sends large message,

The default max-message-size-kb is 50 kb. The default value for the over flow policy is `handle-with-persistence'. The maximum size of each message that will be kept in memory can be configured using the max-message-size-kb property:

<max-message-size-kb>50</max-message-size-kb> 

All the above mentioned default values can be changed in <default-destination-properties> of <admin-params>.

If you don not specify the max-message-size-kb at destination, then the destination will take the value that is specified at default-destination-properties. For temporary destinations you cannot configure separately. It will take the value which is specified in the default-destination-properties.

Configuring JMS Persistence Framework

JMS Message server requires a local store for storing its persistent messages. The messages can be persisted in two ways:

  1. Database.
  2. File System.

The Server provides a way of configuring this persistence type by exposing certain properties in the jms-config.xml file. If your system does not involve handling any persistent message, you don't need to configure any value.

With the following tags, we can configure persistence in JMS Server. The tag is part of the <admin-params> of the jms-config.xml:

<persistent-store> 
	<persistence-enabled>true</persistence-enabled> 
	<!-- persistence-disabled-policy: throw-exception,  
	override-message- 		delivery-mode(default) --> 
	 
	<persistence-disabled-policy> 
		override-message-delivery- mode 
	</persistence-disabled-policy> 
 
	<!-- persistence-type: file-store(default), db-store --> 
 
	<persistence-type> 
		db-store 
	</persistence-type> 
 
	<file-store> 
		<!-- messages-dir is the absolute path or 
		relative with prefix $NODES_DIR/ or use prefix $INSTALL_DIR/  
		to make the store relative to install dir 
		--> 
		<messages-dir>$NODES_DIR/jmsmessages</messages-dir> 
		<max-file-size-mb>10</max-file-size-mb> 
		<purge-interval-sec>600</purge-interval-sec> 
	</file-store> 
	<db-store> 
		<data-source-name>jmsdb</data-source-name> 
		<jms-table-name-prefix>pmt_</jms-table-name-prefix> 
	</db-store> 
</persistent-store> 

If you do not want to persist messages, then you can explicitly disable the persistence by specifying the <persistence-enabled>false</persistence-enabled>. If this flag is set then the message server does not check for any other configuration for the persistence. Whenever you set this flag as false, you also specify the <persistence-disabled-policy>, which denotes what to do if the persistence is disabled and the user is sending persistent messages. The persistence disabled policy should be either `override-message-delivery-mode' or `throw exception'. If the persistence-disabled-policy is `override-message-delivery-mode', then if the server receives any persistent messages, then it overrides the delivery mode from persistent to non-persistent. If the policy is `throw exception', then for each persistent message that it receives, it will throw the exception indicating that the persistent messages are not allowed when persistence is disabled.

You can specify the persistence store type by using the tag <persistence-type>, which accepts either file-store or db-store.

Configuration for file-store:

<file-store> 
	<messages-dir>$NODES_DIR/jmsmessages</messages-dir> 
	<max-file-size-mb>10</max-file-size-mb> 
	<purge-interval-sec>600</purge-interval-sec> 
</file-store> 

You have to specify in which directory you want to store the messages. This can be specified in multiple ways. You can either specify the absolute path of the directory, or you can specify $NODES_DIR/, which stores the messages under server's nodes directory with the child directory called messages or you can also specify it as $INSTALL_DIR/ which stores the messages under installation directory with the child directory called messages.

The file, stores the actual message objects. You can configure the max-data-files size in kilo bytes. So, if the first data file reaches to the configured max size, then it creates a new file and stores the data in it. The messages in the file store are actually not removed from the file and should be deleted as when required. There is a background thread which removes the messages as marked for deletion. So, this thread will wake up at configured interval which you specified through <purge-interval-sec>.

Configuration for DB store:

<db-store> 
	<data-source-name>jmsdb</data-source-name> 
	<jms-table-name-prefix>pmt_</jms-table-name-prefix> 
</db-store> 

Database configuration requires a datasource name, which is bound as a resource in naming service. For further details about how to configure the data source in resource-config.xml, check out the Installation Guide.

You can specify the <jms-table-name-prefix> for the tables that the server is going to create in the specified database. When the server starts up it automatically creates the required tables with the given prefix. The default values are:

Table 18: Persistence Framework Default Values
Property
Default Value
Persistence
Enabled
Persistence Type
File Store
Message Dir.
$NODES_DIR/messages
Maximum File Size
10KB
Purge Interval
600 sec


Pramati Technologies  © Copyright

 Home