WebSphere MQ Everyplace includes some tools that enable the administration
of WebSphere MQ Everyplace objects from the command line, using simple
scripts. The following tools are provided:
- QueueManagerUpdater
- Creates a device queue manager from an ini file, and sends an
administration message to update the characteristics of a queue
manager.
- IniFileCreator
- Creates an ini file with the necessary content for a client queue
manager.
- LocalQueueCreator
- Opens a client queue manager, adds a local queue definition to it, and
closes the queue manager.
- HomeServerCreator
- Open a server queue manager, adds a home-server queue, and closes the
queue manager.
- ConnectionCreator
- Allow a connection to be added to an WebSphere MQ Everyplace queue manager
without programming anything in Java.
- RemoteQueueCreator
- Opens a device queue manager for use, sends it an administration message
to cause a remote queue definition to be created, then closes the queue
manager.
- MQBridgeCreator
- Creates an WebSphere MQ bridge on an WebSphere MQ Everyplace queue
manager.
- MQQMgrProxyCreator
- Creates a WebSphere MQ queue manager proxy for a bridge.
- MQConnectionCreator
- Creates a connection definition for a WebSphere MQ system on a proxy
object.
- MQListenerCreator
- Creates a WebSphere MQ transmit queue listener to pull messages from
WebSphere MQ.
- MQBridgeQueueCreator
- Creates an WebSphere MQ Everyplace queue that can reference messages on a
WebSphere MQ queue.
- StoreAndForwardQueueCreator
- Creates a store-and-forward queue.
- StoreAndForwardQueueQMgrAdder
- Adds a queue manager name to the list of queue managers for which the
store-and-forward queue accepts messages.
The following files are also provided:
- Example script files
- Two example .bat files, and a runmqsc script to demonstrate setting
up a fictitious network configuration, involving a branch, a gateway, and a
WebSphere MQ system.
- Rolled-up Java example
- An example of how a batch file can be rolled-up into a Java file for
batch-language independence.
The command-line tools can be used to create an initial queue manager
configuration using a script, and without needing to know how to program in
the Java programming language.
The following example demonstrate how to use these tools to configure the
network topology shown in the following figure.
Figure 8. WebSphere MQ Everyplace administration scenario

In this scenario:
- The branch offices need to send sales information to the central site for
processing by applications on the WebSphere MQ server
- Each branch has a single machine with DNS names BRANCH000,
BRANCH001, and BRANCH002 respectively. These
machines all run WebSphere MQ Everyplace each having a single queue manager
names BRANCH000QM, BRANCH001QM, and
BRANCH002QM respectively.
- The central office machine GATEWAY00 runs a single gateway
queue manager GATEWAY00QM
- The central office machine CENTRAL00 runs WebSphere MQ with a
single queue manager CENTRAL00QM
- When a sale occurs, a message is sent to the WebSphere MQ queue manager
CENTRAL00QM, into a queue called
BRANCH.SALES.QUEUE.
- The messages are encoded in a byte array at the branch, and sent inside an
MQeMQMsgObject.
- The WebSphere MQ system must be able to send messages back to each branch
queue manager.
- The topology must also be able to cope with the addition of a Firewall
later between the branches and the gateway.
- The WebSphere MQ-bound queue traffic should use the 56-bit DES
cryptor.
The following scripts are needed to configure this network topology.
- Central.tst
- Used with the runmqsc script to create relevant objects on
CENTRAL00QM
- CentralQMDetails.bat
- Used to describe the CENTRAL00QM to other scripts
- GatewayQMDetails.bat
- Used to describe the GATEWAY00QM to other scripts
- CreateGatewayQM.bat
- Used to create the gateway queue manager
- CreateBranchQM.bat
- Used to create a branch queue manager
These .bat files can all be found in the installed product, in
MQe\Java\Demo\Windows.
- Note:
- Although the example scripts provided are in the Windows .bat file
format, they could be converted to work equally well in any scripting language
available on your system.
The following objects are created by the scripts, to provide the
branch-to-central routing:
Figure 9. Branch to central routing

The following objects are created by the scripts to provide the
central-to-branch routing:
Figure 10. Central to branch routing

Follow these procedures to create the required objects and operate the
example scenario, using the supplied script files.
- Edit the JavaEnv.bat .
- Make sure you have edited the JavaEnv.bat file to set your required
working environment.
- Create a command-line session
- Create a command-line session, and invoke the JavaEnv.bat to make
the settings available in the current environment.
- Gather hardware required
- Locate all the hardware on which you will be installing the network
topology.
Gather the machine names of those machines available to you, and note them
down. If you have only one machine available, you can still use the
scripts to deploy the example network topology, as you can specify the same
hostname for each queue manager.
- Create a WebSphere MQ queue manager
- By default, the scripts assume this is called CENTRAL00QM
listening on port 1414 for client channel connections.
- Describe the WebSphere MQ queue manager
- Edit and review the CentralQMDetails.bat file to make sure that its
details match those of the WebSphere MQ queue manager you have just
created. All values, except the name of the machine on which the
WebSphere MQ queue manager sits, are defaulted in the script file.
- Describe the gateway queue manager
- Edit and review the GatewayQMDetails.bat file to make sure that
details of the gateway queue manager are decided on, and available for the
other .bat files to use.
The default name of the gateway queue manager created by the scripts is
GATEWAY00QM. You will need to set the machine name, and port
number it will listen on. This port must be available for use.
Tip: On Windows machines, use the command netstat
-a to get a list of ports currently in use.
- Review the central.tst file
- Read the central.tst file, make sure it won't create any
WebSphere MQ objects you are unhappy with on your WebSphere MQ queue
manager.
- Distribute all the scripts to all machines
- Copy all of the scripts to all of the machines on which you will be
running WebSphere MQ Everyplace queue managers.
This step spreads knowledge to all the machines in your network, of the
host names, port numbers, and queue manager names that you have decided to
use. If any of these files are changed, delete all WebSphere MQ
Everyplace queue managers and restart from this point in the
instructions.
- Run the central.tst script on your new WebSphere MQ queue manger
- The central.tst script is in a format used by the
runmqsc sample program supplied with WebSphere MQ.
Pipe the central.tst file into runmqsc to configure your
WebSphere MQ queue manger For example:
runmqsc CENTRAL00QM < Central.tst
Use the WebSphere MQ Explorer to view the resultant WebSphere MQ objects
that are created.
Milestone: You have now set up your WebSphere MQ
system.
- Run the CreateGatewayQM script
- The CreateGatewayQM script uses the details in the CentralQMDetails and
GatewayQMDetails scripts to create a gateway queue manager.
The script needs no parameters.
- Check for the test message
- The script that creates the queue manager sends a test message to the
WebSphere MQ system.
Use the WebSphere MQ Explorer tool to look at the target queue
(BRANCH.SALES.QUEUE by default) to make sure a test
message arrived. The body of the test message contains the string
ABCD
Milestone: You have now set up your WebSphere MQ
Everyplace gateway queue manager.
- Keep the gateway queue manager running
- During the running of the CreateGatewayQM script, an example server
program is invoked to start the gateway queue manager, and keep it
running. An AWT application runs, displaying a window on the
screen.Do not close this window.
All the time this window is active, the WebSphere MQ Everyplace gateway
queue manager it represents is also active. Closing the window closes
the WebSphere MQ Everyplace gateway queue manager and breaks the path from the
branch queue managers to the WebSphere MQ queue manager.
- Create a branch queue manager
- If your branch queue manager needs to run on a different machine, you may
need to edit the JavaEnv.bat file to set up your local
environment.
Create a command-line session, and call JavaEnv.bat as before to set
up your environment.
Use the CreateBranchQM script to create a branch queue manager. The
syntax of the command is :
CreateBranchQM.bat branchNumber portListeningOn
Where:
- branchNumber
- Is a 3-digit number, padded with leading zeros, indicating which branch
the queue manager is being created for. For example, 000, 001,
002...
- portListeningOn
- Is a port on which the device branch queue manager listens on for
administration requests. For example, 8082, 8083...
- Note:
- The port must not already be in use
Hint: On Windows machines, use the netstat -a
command to view the list of ports in use.
During the script, a test message is sent to your WebSphere MQ
system. Use the WebSphere MQ Explorer to make sure the test message
arrived successfully. The body of the test message contains the string
ABCD.
At the end of the script, an example program is used to start the WebSphere
MQ Everyplace queue manager. An AWT application runs, displaying a
window on the screen.As with the gateway queue manager, do not
close this window until you wish to close the queue manager.
- Explore the branch queue manager
- The branch queue manager is set up with a channel manager and listener, on
the port you specified when you created it, and the Primary Network connection
is HttpTcpipAdapter. As a result, you can use the MQe_Explorer to view
the queue managers. Refer to How to use the MQe_Explorer to view the configurations.
Milestone: You now have a branch queue manager set
up.
- Note:
- An WebSphere MQ Everyplace queue manager should be named uniquely.
Never create two queue managers with the same name.
-
- Start the MQe_Explorer.exe program. Stop one of the branch
queue managers, say BRANCH002QM Open the BRANCH002QM.ini file, and
navigate from there.
To use the MQe_Explorer to view your configuration:
- Start the MQe_Explorer.exe program.
- Stop one of the branch queue managers, say BRANCH002QM
- Open the BRANCH002QM.ini file, and navigate from there.
© IBM Corporation 2002. All Rights Reserved