Sample code for setting up queue managers, queues, and channels
After you install either the IBM® WebSphere® MQ (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 IBM WebSphere MQ documentation.
The following example shows how to set up the queue manager, queues, and channels:
- Create queue manager lqm1, using-q to
specify the default queue manager:
crtmqm -q lqm1
- Start the queue manager:
strmqm lqm1
- Start the publish/subscribe service:
strmqbrk -m lqm1
- Stop the queue manager:
endmqm -w lqm1
- Delete the queue manager:
dltmqm lqm1
- Start the TCP listener on port 1414 for queue manager lqm1:
runmqlsr -t tcp -m lqm1 -p 1414 &
- 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
- Create database server-related queues by running the following
command:
runmqsc lqm1 < $INFORMIXDIR/extend/mqblade.2.0/idsdefault.tst
- Copy AMQCLCHL.TAB to the WMQ default location.