Vous êtes sur la page 1sur 6

Quicker Beginnings Lab #1b (Windows MQClient to

MQServer)
verified: Windows-ME (MQ client) to Windows-2000 (MQ server)

Basic Connectivity...

1. click here (2003): http://www.ibm.com/software/ts/mqseries/downloads/


click here (2006): http://www.ibm.com/software/integration/wmq/support/ then click
"Trials and betas" button
then download a 60 day evaluation copy of "MQSeries for Windows-NT and
Windows-2000" (a.k.a. Windows-NT5)
2. Install it on a PC running Windows-NT or Windows-2000 (a.k.a. Windows-NT5)
3. Perform a "Default Configuration"
1. always make this machine the first computer in the local repository
4. Click here (2003): http://www.ibm.com/software/ts/mqseries/txppacs/txpm1.html#clients
to view client paks
5. Click here (2003): MACJ to download "MQSeries Client for Windows 95, 98 and Me -
V5.2"
6. Install the client software on a second PC running any flavor of Windows-95/98/ME (I
used Windows-ME).
Note: If you intend to develop C/C++ code to interface with MQ, do yourself a favor and
perform a CUSTOM install of the MQ client software then set the destination directory to
folder C:\MQclient\
7. If you logged into your client machine...
 
1. then add the same user name to "Control Panel\Users and Passwords" on your
server machine (server and client passwords do not need to match which seems
kind of weird to me)

If you didn't log into your client machine...


...then bring up an "MS-DOS Prompt"

2. type: SET MQ_USER_ID = "Administrator" (quotes are required to preserve


case)
Note: this parameter is not supported on client machines you are forced to log on
to: OpenVMS, UNIX, Windows-NT, etc.
3. type: SET MQ_PASSWORD ="what_ever_it_is" (quotes are required to preserve
case; Windows passwords are case sensitive)
Note: this parameter is not supported on client machines you are forced to log on
to: OpenVMS, UNIX, Windows-NT, etc.
4. type: SET (to view your environment variables)
 
8. Bring up an MS-DOS prompt then locate the test executables...
9. legend:
10. <sr> system response
<ur> user response

<sr> C:\>
<ur> CD C:\MQClient\Bin
<sr> C:\mqclient\BIN>
<ur> dir *.exe

11. Program "amqscnxc.exe" is used to test general "client -> server" connectivity (and also
demos the use of the new MQCONNX call). View this program's command line
arguments like so...
12. <sr> C:\mqclient\BIN>
13. <ur> amqscnxc -?
<sr> amqscnxc [-x ConnName [-c SvrconnChannelName]] [QMgrName]

1. the "-x" switch specifies the I/P address of the other machine. Port 1414 is used
by default
2. Sample Note: source code file "amqscnxc.c" is found with "MQSeries for
Windows-NT and Windows-2000" but not "MQSeries Client for Windows 95, 98
and Me - V5.2". You may want to peek at this file to learn how MQCONNX
allows the client to connect without the use of environment variable MQSERVER
or channel definition file "AMQCLCHL.TAB"
 
14. This is an example of a good session...
15.
16. <sr> C:\mqclient\BIN>
17. <ur> amqscnxc -x 192.168.1.220
18. <sr> Connecting to the default queue manager
19. using the server connection channel SYSTEM.DEF.SVRCONN
20. on connection name 192.168.1.220.
21. Connection established to queue manager QM_rieck2
Sample AMQSCNXC end

22. This is example #1 of a bad session:


23. <sr> C:\mqclient\BIN>
24. <ur> amqscnxc
25. <sr> Connecting to the default queue manager
26. with no client information specified
27. MQCONNX ended with reason code 2058
28.
29. Since no connection information was specified on the command line, you
must use a TAB file.
See the bottom of error log file "C:\mqclient\ERRORS\AMQERR01.LOG" for
more details.

30. This is example #2 of a bad session:


31. <sr> C:\mqclient\BIN>
32. <ur> amqscnxc -x 192.168.1.220 yada
33. <sr> Connecting to the queue manager yada
34. using the server connection channel SYSTEM.DEF.SVRCONN
35. on connection name 192.168.1.220.
MQCONNX ended with reason code 2058
MQSeries
MQSeries
Reason
Reason Text
Codes
2035 You are not an authorized user on the other (server) machine.
Check "Control Panel\Administrative Tools\Event Viewer\Application Log"
for hints.
Does your user have MQM group access on the server machine?
2058 Queue manager name not valid or not known.
2059 Queue manager not available for connection.
2085 Unknown object name
other API (2003)
reason http://www.ibm.com/software/ts/mqseries/library/manuals/csqfao/CSQFAO
codes 1P.HTM
(2006) http://www.ibm.com/software/integration/wmq/library/index.html
         then click: "Application Programming Reference"
other help check file "C:\mqclient\ERRORS\AMQERR01.LOG"

Beyond Basic Connectivity...

Program Names

Most executable MQSeries demo programs follow this naming convention:

1. amqsputb.exe (Application MQ String PUT from a BASIC source)


2. amqsputc.exe (Application MQ String PUT from a C source)
3. imqsputc.exe (Image MQ String PUT from a C++ source)

Setting up Windows environment variable: MQSERVER

1. on the server machine, execute "c:\program files\mqseries\bin\runmqsc.exe" to access the


MQSeries Command Interface
2. now view all the currently defined channels by typing:

DISPLAY CHANNEL(*)

notice that one of them is SYSTEM.DEF.SVRCONN which we'll assume is the default
server connection
 
3. on the client machine, from an "MS-DOS" prompt, define an environmental variable
using one of the channels just acquired like so:

SET MQSERVER=SYSTEM.DEF.SVRCONN/TCP/192.168.1.220
 
4. type: SET (to view your environment variables)
 
5. This is an example of a good session:
6. <sr> C:\mqclient\BIN>
7. <ur> amqsgetc default
8. <sr> Sample AMQSGET0 start
9. no more messages
Sample AMQSGET0 end

10. reason code 2059 means that you made a typo in the CHANNEL (first third) of the
MQSERVER variable.
11. reason code 2085 means that you made a typo in the queue name

Storing messages with demo program 'AMQSPUTC'

1. on the server machine, execute "c:\program files\mqseries\bin\runmqsc.exe" to access the


MQSeries Command Interface
2. now view all the currently defined channels by typing:
DISPLAY QMGR
look for a parameter titled QMNAME (mine is 'QM_rieck2')
3. This is an example of a good session:
4. <sr> C:\mqclient\BIN>
5. <ur> amqsputc default QM_rieck2
6. <sr> Sample AMQSPUT0 start
7. target queue is default
8. <ur> this is data line 1 <enter>
9. <ur> this is data line 2 <enter>
10. <ur> this is data line 3 <enter>
11. <ur> <--- now just hit <enter> one more time to signal that we're
finished
<sr> Sample AMQSPUT0 end

12. Use the GUI on the NT server machine to...


 
1. non-destructively read the messages like so:
2. <ur> Start>Programs>IBM MQSeries>MQSeries Explorer
3. <ur> Open Queue Manager: QM_rieck2 (or whatever your queue
manager is named)
4. <ur> Open Folder: Queues
<ur> Open Queue: default

5. destructively read the messages like so:


6. <ur> Start>Programs>IBM MQSeries>MQSeries First Steps
7. <ur> Select Item: API Exerciser
8. <ur> Connect to the desired queue manager using MQCONN or
MQCONNX
9. <ur> Open the desired queue using MQOPEN
10. <ur> Now click MQGET until you run out of messages
11. <ur> Now click MQCLOSE
<ur> Now click MQDISC
Retrieving a message with demo program 'AMQSGETC'

1. This is an example of a good session:


2. <sr> C:\mqclient\BIN>
3. <ur> amqsgetc default
4. <sr> Sample AMQSGET0 start
5. message <this is data line 1>
6. message <this is data line 2>
7. message <this is data line 3>
8. no more messages
Sample AMQSGET0 end

9. Now run the program again and you should get this:
10. <sr> C:\mqclient\BIN>
11. <ur> amqsgetc default<sr> Sample AMQSGET0 start
12. no more messages
Sample AMQSGET0 end

Example Program Summary

need environment
variable
or channel definition
command function
file
"AMQCLCHL.TAB
"?
tests basic connectivity using
>amqscnxc -x 192.168.1.200 n
MQCONNX
>amqsputc default string message put y
>amqsgbrc default message browse y
>amqsgets default string message get y
>amqsprmc -q default -i yada.txt -t
reference message (file) put y
FLATFILE

Quicker Beginnings Lab #1c (Windows MQClient to


MQServer)
verified: Windows-2000 (MQ client) to Windows-2000 (MQ server)

1. Click here (2003): http://www.ibm.com/software/ts/mqseries/downloads/


then download a 60 day evaluation copy of MQSeries for Windows-NT and Windows-
2000 (a.k.a. Windows-NT5)
2. Install it on a PC running Windows-NT or Windows-2000 (a.k.a. Windows-NT5)
3. Perform a "Default Configuration"
1. always make this machine the first computer in the local repository
4. Click here (2003): http://www.ibm.com/software/ts/mqseries/txppacs/txpm1.html#clients
to view client paks
5. Click here (2003): MACP to download "MQSeries Client for Windows NT and Windows
2000 - V5.2.1"
1. or click here: MACV to download WebSphere MQ Client for Windows - V5.3
6. Install the client software on a second PC running any flavor of Windows-NT or
Windows-2000 (a.k.a. Windows-NT5)
7. the rest is similar to Quicker Quick Beginnings 1b except for two things...
 
1. Under certain circumstances, user ID's on a Windows-NT client can be truncated
to a length of 12 characters when sent through the MQSeries authorization
process. If you're logged on to the Windows-NT MQ client machine as
"Administrator" (which has a length of 13 characters ), then you'll need to create
an account on the Windows-NT MQ server machine with a user ID of
"Administrato" (which is 12 characters in length). Make sure this account has
"MQM" privs, "Administrator" privs, or both.
Note: this does not happen when using the Windows-95 MQ client on a
Windows-2000 machine (which is probably not a good idea anyway)
 
2. Make sure you execute programs from the correct directory because it is possible,
although not desirable, to have several MQ client packages present on the same
machine at the same time (I've seen this happen after Windows-ME was upgraded
to Windows-2000, and also when the older Win-95 client is installed on a
Windows-2000 machine after the Win-NT client was already present; Newer
client installers always look for older software so this doesn't happen all the time).

Programmers may wish to use a shorter path (for source headers, linker objects,
etc.) so during an install or upgrade, it is probably a good idea to install the MQ
client software in folder "C:\MQClient" rather than the default location. Note that
the installation folder directory can always be changed when the installation mode
is "Custom" rather than "Typical".

Default Installation Desirable Destination


MQSeries Client
Directory Directory
Package
(after a new install) for use by programmers
V 5.2 for Windows- "C:\MQClient" "C:\MQClient"
95/98/ME  
V 5.2 for Windows- "C:\program files\mqclient "C:\MQClient"
NT/2000 software\"
V 5.3 for Windows- "C:\program "C:\MQClient"
NT/2000 files\ibm\WebSphere MQ\"

Vous aimerez peut-être aussi