Connect to the machine running WebSphere MQ Server. From a command prompt on this machine, navigate to the bin directory of the WebSphere MQ installation (normally C:\Program Files\IBM\Websphere MQ\bin).
From this directory, enter the following two commands. (Change the location of the scripts accordingly if you didn't copy to the C:\TEMP directory.)
runmqsc < c:\temp\STQM.txt runmqsc < c:\temp\ClientDf.txt
After each of the scripts has completed, check the output displayed onscreen for any errors. A successful script will terminate with the following output:
No commands have a syntax error. All valid MQSC commands were processed.
Once the import has completed, open the WebSphere MQ Explorer. Notice that additional objects have been created in the Queues folder under the default queue manager, STQM, as shown in Figure 10.19.
By default, the script creates five objects. (Note that the actual names will vary depending on the name of the bridge server machine.) MQBRIDGE1 .XMITQ and MQBRIDGE1 .XMITQ.HIGH are the transmission queues used to hold messages that will be picked up by the MSMQ-MQSeries bridge and forwarded to the appropriate MSMQ queue. ( MQBRIDGE1 .XMITQ.HIGH is the nontransactional transmission queue.) The next two objects, MQBRIDGE1 and MQBRIDGE1% , are two remote definition managers to these transmission queues. ( MQBRIDGE1% is the nontransaction remote definition.) And finally, Q2Q_SYNC_Q is a model used for keeping all the channels in synchronization.
Create a new local queue named LOCAL.STOCKPURCHASES . To create a new queue, right-click the Queues folder and select New/Local Queue. This queue is local to the WebSphere MQ server and will be populated by incoming messages from the MSMQ-MQSeries bridge.
If a local queue is already defined for LOCAL.STOCKSALES, delete it. (We did use such a local queue in the samples in Chapter 9, so you might have to delete that local queue now.)
Right-click the Queues folder again and select New/Remote Queue Definition. As the menu option implies, this queue is a remote definition, which is a WebSphere MQ representation of the MSMQ queue. For the queue, enter the information shown in the following list, as shown in Figure 10.20:
Queue name: LOCAL.STOCKSALES
Remote queue name: LOCAL.STOCKSALES
Remote queue manager name: BRIDGE_NAME %
Transmission queue name: BRIDGE_NAME .XMITQ.HIGH
Figure 10.20: Creating the local stock sales remote definition on the WebSphere MQ server.
In the remote queue manager name and transmission queue name, replace BRIDGE_NAME with the host name of your bridge. In our sample, these will become MQBRIDGE1% and MQBRIDGE1 .XMITQ.HIGH, respectively. You can also select the transmission queue name by selecting this option from the drop-down list.
Note that we're using the nontransactional channels for both the remote queue manager names and transmission queue names. Click OK to define the queue.
The final configuration step for the WebSphere MQ server is to export a channel table file from the WebSphere MQ server to the MSMQ-MQSeries bridge. This step is required because it allows the MSMQ-MQSeries bridge to interrogate the channels and queues that have been defined. If at any point in the future the WebSphere MQ configuration changes, it's a good idea to reexport this file.
To export this file, navigate to the C:\Program Files\IBM\WebsphereMQ\Qmgrs\STQM\@ipcc directory on the WebSphere MQ server. This directory should contain a file named AMQCLCHL.TAB. This file needs to be copied to the MSMQ-MQSeries bridge.
Copy this file to a directory that's easily accessible on the MSMQ-MQSeries bridge. For this sample, I've copied the file to the C:\TEMP directory on the bridge machine.
The WebSphere MQ portion of the setup is now completed.
The final configuration step is to set up two environment variables that are used to locate the TAB file that was copied from the WebSphere MQ machine. On the bridge, if your file was copied to the C:\TEMP directory, I recommend copying it to the installation of the WebSphere MQ client on this machine (C:\Program Files\IBM\Websphere MQ). Next, right-click My Computer, select Properties, select the Advanced tab, and click the Environment Variables button. In the System Variables section, create two new variables , as shown in Table 10.2.
C:\Program Files\IBM\Websphere MQ
Click OK to save the new variables and then click OK on the remaining dialog boxes. Close all command prompt windows that are open. (This ensures that all the environment variables are reset.)
Open a new command prompt window and type the following command, exactly as shown:
The result of this should be the TAB file, located in the correct directory. If you receive a File Not Found error, recheck the location of the file and those environment variables. These two environment variables are crucial for the bridge to work.