Create an Application Server cluster, if one does not already exist.
For information on creating clusters, see To Create a Cluster.
Create an MQ broker cluster.
First, delete the default JMS host that refers to the broker started by the Domain Administration Server, and then create three external brokers (JMS hosts) that will be in the MQ broker cluster.
Create a JMS host with either the Admin Console or the asadmin command-line utility.
To use asadmin, the commands are for example:
asadmin delete-jms-host --target cluster1 default_JMS_host asadmin create-jms-host --target cluster1 --mqhost myhost1 --mqport 6769 --mquser admin --mqpassword admin broker1 asadmin create-jms-host --target cluster1 --mqhost myhost2 --mqport 6770 --mquser admin --mqpassword admin broker2 asadmin create-jms-host --target cluster1 --mqhost myhost3 --mqport 6771 --mquser admin --mqpassword admin broker3 |
To create the hosts with Admin Console:
Navigate to the JMS Hosts node (Configurations > config-name > Java Message Service > JMS Hosts)
Delete the default broker (default_JMS_host).
Select the checkbox next to it, and then click Delete.
Click New to create each JMS host and enter its property values.
Fill in the values for host name, DNS name or IP address, port number, administrative user name and password.
Start the master MQ broker and the other MQ brokers.
In addition to the three external brokers started on JMS host machines, start one master broker on any machine. This master broker need not be part of a broker cluster. For example:
/usr/bin/imqbrokerd -tty -name brokerm -port 6772 -cluster myhost1:6769,myhost2:6770,myhost2:6772,myhost3:6771 -D"imq.cluster.masterbroker=myhost2:6772" |
Start the Application Server instances in the cluster.
Create JMS resources on the cluster:
Create JMS physical destinations.
For example, using asadmin:
asadmin create-jmsdest --desttype queue --target cluster1 MyQueue asadmin create-jmsdest --desttype queue --target cluster1 MyQueue1 |
To use Admin Console:
Create JMS connection factories.
For example, using asadmin:
asadmin create-jms-resource --target cluster1 --restype javax.jms.QueueConnectionFactory jms/MyQcf asadmin create-jms-resource --target cluster1 --restype javax.jms.QueueConnectionFactory jms/MyQcf1 |
To use Admin Console:
Navigate to the JMS Connection Factories page (Resources > JMS Resources > Connection Factories).
To create each connection factory, click New.
The Create JMS Connection Factory page opens.
For each connection factory, enter JNDI Name (for example jms/MyQcf) and Type, javax.jms.QueueConnectionFactory
Select the cluster from the list of available targets at the bottom of the page and click Add.
Click OK to create the connection factory.
Create JMS destination resources.
For example, using asadmin:
asadmin create-jms-resource --target cluster1 --restype javax.jms.Queue --property imqDestinationName=MyQueue jms/MyQueue asadmin create-jms-resource --target cluster1 --restype javax.jms.Queue --property imqDestinationName=MyQueue1 jms/MyQueue1 |
To use Admin Console:
Navigate to the JMS Destination Resources page (Resources > JMS Resources > Connection Factories).
To create each destination resource, click New.
The Create JMS Destination Resource page opens.
For each destination resource, enter JNDI Name (for example jms/MyQueue) and Type javax.jms.Queue.
Select the cluster from the list of available targets at the bottom of the page and click Add.
Click OK to create the destination resource.
Deploy the applications with the – retrieve option for application clients. For example:
asadmin deploy --target cluster1 --retrieve /opt/work/MQapp/mdb-simple3.ear |
Access the application and test it to ensure it is behaving as expected.
If you want to return the Application Server to its default JMS configuration, delete the JMS hosts you created and recreate the default. For example:
asadmin delete-jms-host --target cluster1 broker1 asadmin delete-jms-host --target cluster1 broker2 asadmin delete-jms-host --target cluster1 broker3 asadmin create-jms-host --target cluster1 --mqhost myhost1 --mqport 7676 --mquser admin --mqpassword admin default_JMS_host |
You can also perform the equivalent operation with Admin Console.
If you encounter problems, consider the following:
View the Application Server log file. If you see in the log file that an MQ broker does not respond to a message, stop the broker and then restart it.
Always be sure to start MQ brokers first, then Application Server instances.
When all MQ brokers are down, it takes 30 minutes for Application Server to go down or up, with the default values in Java Message Service. Tune Java Message Service values to get acceptable values for this timeout. For example:
asadmin set --user admin --password administrator cluster1.jms-service.reconnect-interval-in-seconds=5