Sample code for setting up queue managers, queues, and channels

After you install either the (WMQ) server or both the WMQ server and client, you can set up the queue manager, queues, and channels.

You must only set up channels if you plan to use a WMQ client-based library. For information about channels, see your documentation.

The following example shows how to set up the queue manager, queues, and channels:

  1. Create queue manager lqm1, using-q to specify the default queue manager:
    crtmqm -q lqm1
  2. Start the queue manager:
    strmqm lqm1
  3. Start the publish/subscribe service:
    strmqbrk -m lqm1
  4. Stop the queue manager:
    endmqm -w lqm1
  5. Delete the queue manager:
    dltmqm lqm1
  6. Start the TCP listener on port 1414 for queue manager lqm1:
    runmqlsr -t tcp -m lqm1 -p 1414 &
  7. Run the following commands in runmqsc lqm1:
    DEFINE CHANNEL(QM1CH) CHLTYPE(SVRCONN) TRPTYPE(TCP) +
    DESCR('Server connection to WMQ client') REPLACE
    
    DEFINE CHANNEL(QM1CH) CHLTYPE(CLNTCONN) TRPTYPE(TCP) +
    CONNAME('hostname(1414)') +
    DESCR('WebSphere MQ client connection to server 1') +
    QMNAME('lqm1') REPLACE
  8. Create database server-related queues by running the following command:
    runmqsc lqm1 < $INFORMIXDIR/extend/mqblade.2.0/idsdefault.tst
  9. Copy AMQCLCHL.TAB to the WMQ default location.