Samples for IBM MQ for IBM i

Table 1 shows the techniques demonstrated by the IBM® MQ for IBM i sample programs. Some techniques occur in more than one sample program, but only one program is listed in the table.

Table 1. IBM MQ for IBM i sample programs demonstrating use of the MQI (C and COBOL)
Technique C (source) ( 1 ) COBOL (source) ( 2 ) RPG (source) ( 3 ) Client (C executable)(4)
Putting messages using the MQPUT call AMQSPUT0 AMQ0PUT4 AMQ3PUT4 AMQSPUTC
Putting messages from a data file using the MQPUT call AMQSPUT4 no sample no sample no sample
Putting a single message using the MQPUT1 call AMQSINQ4, AMQSECH4 AMQ0INQ4, AMQ0ECH4 AMQ3INQ4, AMQ3ECH4 AMQSINQC, AMQSECHC
Putting messages to a distribution list AMQSPTL4 no sample no sample AMQSPTLC
Replying to a request message AMQSINQ4 AMQ0INQ4 AMQ3INQ4 AMQSINQC
Getting messages (no wait) AMQSGBR4 AMQ0GBR4 AMQ3GBR4 AMQSGBRC
Getting messages (wait with a time limit) AMQSGET4 AMQ0GET4 AMQ3GET4 AMQSGETC
Getting messages (unlimited wait) AMQSTRG4 no sample AMQ3TRG4 AMQSTRGC
Getting messages (with data conversion) AMQSECH4 AMQ0ECH4 AMQ3ECH4 AMQSECHC
Putting Reference Messages to a queue AMQSPRM4 no sample no sample AMQSPRMC
Getting Reference Messages from a queue AMQSGRM4 no sample no sample AMQSGRMC
Reference Message channel exit AMQSQRM4, AMQSXRM4 no sample no sample no Sample
Message exit AMQSCMX4 no sample no sample no Sample
Browsing first 49 characters of a message AMQSGBR4 AMQ0GBR4 AMQ3GBR4 AMQSGBRC
Browsing complete messages AMQSBCG4 no sample no sample AMQSBCGC
Using a shared input queue AMQSINQ4 AMQ0INQ4 AMQ3INQ4 AMQSINQC
Using an exclusive input queue AMQSREQ4 AMQ0REQ4 AMQ3REQ4 AMQSREQC
Using the MQINQ call AMQSINQ4 AMQ0INQ4 AMQ3INQ4 AMQSINQC
Using the MQSET call AMQSSET4 AMQ0SET4 AMQ3SET4 AMQSSETC
Using a reply-to queue AMQSREQ4 AMQ0REQ4 AMQ3REQ4 AMQSREQC
Requesting message exceptions AMQSREQ4 AMQ0REQ4 AMQ3REQ4 AMQSREQC
Accepting a truncated message AMQSGBR4 AMQ0GBR4 AMQ3GBR4 AMQSGBRC
Using a resolved queue name AMQSGBR4 AMQ0GBR4 AMQ3GBR4 AMQSGBRC
Triggering a process AMQSTRG4 no sample AMQ3TRG4 AMQSTRGC
Trigger server AMQSERV4 no sample AMQ3SRV4 no sample
Using a trigger server (including CICS® transactions) AMQSERV4 no sample AMQ3SRV4 no sample
Using data conversion AMQSVFC4 no sample no sample no sample
Using API exits AMQSAXE0 no sample no sample no sample
Cluster workload balancing AMQSWLM0 no sample no sample no sample
Putting messages asynchronously and getting status using the MQSTAT call AMQSAPT0 no sample no sample AMQSAPTC
Using the publish/subscribe interface AMQSPUBA, AMQSSUBA, AMQSSBXA no sample no sample AMQSPUBC, AMQSSUBC, AMQSSBXC
Reconnectable clients (5) AMQSPHAC, AMQSGHAC, AMQSMHAC no sample no sample no sample
Using message consumers to asynchronously consume messages from multiple queues (5) AMQSCBFO no sample no sample no sample
Specifying SSL/TLS connection information on MQCONNX AMQSSSLC no sample no sample AMQSSSLC
Connecting to the queue manager using MQCONNX AMQSCNXC no sample no sample AMQSCNXC
Notes:
  1. Source for the C samples is in the file QMQMSAMP/QCSRC. Include files exist as members in the file QMQM/H.
  2. Source for the COBOL samples are in the files QMQMSAMP/QCBLLESRC. The members are named AMQ0 xxx 4, where xxx indicates the sample function.
  3. Source for the RPG samples is in QMQMSAMP/QRPGLESRC. Members are named AMQ3 xxx 4, where xxx indicates the sample function. Copy members exist in QMQM/QRPGLESRC. Each member name has the suffix G.
  4. The executable version of the IBM MQ MQI client samples share the same source as the samples that run in a server environment. Source for the samples in the client environment is same as the server. IBM MQ MQI client samples are linked with client library LIBMQIC and IBM MQ server samples are linked with server library LIBMQM.
  5. If client executable for sample application of Reconnectable client and asynchronously consumer application has to be run, it has to be compiled and linked with threaded library LIBMQIC_R. Hence, it has to be run in threaded environment. Set the environment variable QIBM_MULTI_THREADED to 'Y' and run the application from qsh.

    See Setting up IBM MQ with Java and JMS for more information.

In addition to these, the IBM MQ for IBM i sample option includes a sample data file, which you use as input to the sample programs, AMQSDATA and sample CL programs that demonstrate administration tasks. The CL samples are described in the Administering IBM i . You could use the sample CL program amqsamp4 to create queues to use with the sample programs described in this topic.