Running the Request sample programs
Running the amqsreq0.c, amqsreq, and amqsreqc samples
The C version of the program takes three parameters:- The name of the target server queue (necessary)
- The name of the queue manager (optional)
- The reply queue (optional)
For example, enter one of the following:
- amqsreq myqueue qmanagername replyqueue
- amqsreqc myqueue qmanagername
- amq0req0 myqueue
where myqueue is the name of the target server queue, qmanagername is the name of the queue manager that owns myqueue, and replyqueue is the name of the reply queue.
If we omit the name of the queue manager, it is assumed that the default queue manager owns the queue. If we omit the name of the reply queue, the default reply queue is provided.
Running the amq0req0.cbl sample
The COBOL version does not have any parameters. It connects to the default queue manager and when you run it we are prompted:Please enter the name of the target server queue
The program takes its input from StdIn and adds each line to the target server queue, taking each line of text as the content of a request message. The program ends when a null line is read.
Running the AMQSREQ4 sample
The C program creates messages by taking data from stdin (the keyboard) with a blank time terminating input. The program takes up to three parameters: the name of the target queue (required), the queue manager name (optional), and the reply-to queue name (optional). If no queue manager name is specified, the default queue manager is used. If no reply-to queue is specified, the SYSTEM.SAMPLE.REPLY queue is used.
Here is an example of how to call the C sample program, specifying the reply-to queue, but letting the queue manager default:CALL PGM(QMQM/AMQSREQ4) PARM('SYSTEM.SAMPLE.LOCAL' '' 'SYSTEM.SAMPLE.REPLY')Note: Remember that queue names are case sensitive. All the queues created by the sample file create program AMQSAMP4 have names created in uppercase characters.
Running the AMQ0REQ4 sample
The COBOL program creates messages by accepting data from the keyboard. To start the program, call the program and specify the name of our target queue as a parameter. The program accepts input from the keyboard into a buffer and creates a request message for each line of text. The program stops when you enter a blank line at the keyboard.
Parent topic: The Request sample programs