Chapter 4. JEUS MQ Clustering

Table of Contents

4.1. Overview
4.2. Clustering Type
4.2.1. Connection Factory Clustering
4.2.2. Destination Clustering
4.3. How to Use Clustering
4.3.1. Server Configuration
4.3.2. Clustering Settings
4.4. Example
4.4.1. Good JEUS MQ Clustering Practice Example
4.4.2. Bad JEUS MQ Clustering Practice Example

This chapter describes the clustering technology that groups multiple servers together to reduce JEUS MQ server loads and provide seamless services.

When using a single JEUS MQ server, too many stored messages or client connections on the server increases the network load or server memory usage.

This may cause some performance degradation or lead to server shutdowns. To handle such problems, additional JEUS MQ servers can be added and grouped to work together like a single server. This is called JEUS MQ clustering.

A client can access a clustered server in the same way it accesses a single server.

There are two types of clustering, Connection Factory Clustering and Destination Clustering.

This section describes the configurations required for JEUS MQ clustering.

This section describes the client settings required for JEUS MQ clustering. To enable JEUS MQ clustering, the first thing to configure is a connection factory.

There are two types of connection factory clustering in JEUS MQ based on how a connection factory is obtained.

  • Using JNDI Service

  • Using JEUS MQ API

Using JNDI Service

JNDI services can be used in the same way as described in "2.2.2. Connection Factories", regardless of whether the JEUS MQ server is clustered or not. A client can either look up a new connection factory using JNDI service each time, or create only the connection by reusing an already obtained connection factory.

The policy for selecting a JEUS MQ server differs depending on how the client obtains a connection factory.

  • When JNDI service is used by a client to obtain a new connection factory each time, the policy for selecting a server depends on the JNDI service. In this case, the JEUS node clustering must be configured.

    For more information about how to implement a client program that uses JNDI clustering, refer to JEUS Domain Guide. "Chapter 5. JEUS Clustering" and JEUS Server Guide. "4.5. JNDI Programming".

  • The policy for selecting a server can be configured if the client creates a connection by reusing an already obtained connection factory. Currently, JEUS only supports the round-robin method.

Using JEUS MQ API

If the JEUS MQ server is clustered when creating a connection factory using JEUS MQ API, there are some additional required tasks besides those described in "2.2.2. Connection Factories".

The information about all the servers participating in the cluster must be added using the JeusConnectionFactoryCreator.addBrokerAddress() method as in the following.

jeus.jms.client.util.JeusConnectionFactoryCreator connectionFactoryCreator =
new jeus.jms.client.util.JeusConnectionFactoryCreator();

connectionFactoryCreator.setFactoryName("ConnectionFactory");
connectionFactoryCreator.addBrokerAddress("192.168.1.2", 9741, <service-name>);
connectionFactoryCreator.addBrokerAddress("192.168.1.3", 9741, <service-name>);
connectionFactoryCreator.addBrokerAddress("192.168.1.4", 9741, <service-name>);

ConnectionFactory connectionFactory = connectionFactoryCreator.createConnectionFactory();

This section describes examples of good and bad JEUS MQ clustering practices.