Prepare: Verify that the WebSphere MQ host and the WebSphere Application Server host can ping each other through the host name.
The first step: Install and configure WebSphere MQ on top of the WebSphere MQ host, add an operating system user (such as Mquser), and put him in the group MQM.
Step Two: Create a queue manager, queue, channel using the following command
--create Q Manager
Crtmqm-q SPC
--websphere MQ Queue Manager has been created.
--Create or replace the default object for the SPC.
--Default object statistics: 31 created. 0 have been replaced. 0 has failed.
--The settings are being completed.
--Setup is complete.
--start the Q Mamanger
STRMQM SPC
--websphere MQ Queue Manager ' SPC ' has been started.
--run MQ command line
RUNMQSC SPC
--5724-B41 (C) Copyright IBM Corp. 1994, 2002. All rights RESERVED.
--Start the MQSC of the queue Manager SPC.
--define queue
def QL (' Spcq ')
The--amq8006:websphere MQ queue was created.
DEF CHL (' JAVA. CHANNEL ') Chltype (SVRCONN) trptype (TCP)
The--amq8014:websphere MQ channel was created.
--start MQ Listener for Q Manager, listening on TCP port 1414, ready for remote access
Runmqlsr-m spc-t tcp-p 1414
Step three: Install the WebSphere MQ Client on the WebSphere Application server host, WebSphere MQ Java support
Fourth step: Configure the WebSphere variables
Manage WebSphere variables in the left column of the WebSphere Admin console http://localhost:9090/admin/Environment
Confirm the value of the mq_install_root variable, such as C:/progra~1/ibm/websph~1
Confirm the value of the mqjms_lib_root variable, such as ${mq_install_root}/java/lib
Fifth step: Add an authentication alias to access the remote MQ
Select Security->jaas configuration->j2c Authentication data entry in the left column of the WebSphere Management console
Create a new J2C authentication data entry to enter the users in the MQM group in the WebSphere MQ host, such as the user created in the first step Mquser
Sixth step: Configure the WebSphere MQ Queue Connection Factory
Select the resource->websphere MQ JMS provider in the left column of the WebSphere management console
Select WebSphere MQ Queue Connection Factory, new, input parameters
Name: Qmanager
Jndi Name: JMS/SPCQCF
Component managed authentication alias: Yangj/mquser
Container-managed authentication alias: Yangj/mquser
Queue MANAGER:SPC
Host: SPCM10
Port: 1414
Transport Type: CLIENT
Channel: JAVA. CHANNEL
ccsid:1381
Seventh Step: Configure WebSphere MQ Queue destinations
Select the resource->websphere MQ queue destination in the left column of the WebSphere Admin console
Select WebSphere MQ queue destination, new, input parameter
Name: Queue
Jndi Name: JMS/SPCQ
Base queue name: SPCQ
Step Eighth: Restart was
to manually write a simple JMS test program on c:/websphere/appserver/installedapps/yangj/defaultapplication.ear/ Defaultwebapplication.war under the http://localhost:9080/JMSSenderInputPage.jsp to access it.