Create MQ Queue Manager ,Local Queue and Test

In this we will see how to create Queue Manager (QMGR) ,Local Queue and test put , get operation using mq sample programs .

  • A queue manager is a system program that provides queuing services to applications.
  • It provides an application programming interface (MQI) so that programs can put messages on, and get messages from, queues.
  • It is the first WebSphere MQ object to be created after installation.
    It will control all the other MQ objects (queues, process, listeners, channels etc) with in it.
  • A program/application must have a connection to a queue manager before it can use the services of that queue manager.
  • Typically, it’s suggested to create only one queue manager per machine, but one can create others depending on the resources available on the system.
  • Each queue manager has a name that should be unique within a network of queue managers exchanging messages with each other.

1.Create QMGR with the name IBMMQ.QM1. Run below command on the terminal

crtmqm IBMMQ.QM1

2.Display the QMGR status .Run below command .

dspmq

3.Start QMGR .Run below command.

strmqm IBMMQ.QM1

4.Verify the QMGR status with dspmq then Connect to QMGR to define MQ objects. We will create Local Queue here .

runmqsc IBMMQ.QM1
define QLOCAL(TESTQ)

END and Enter to come out of runmqsc terminal

5.Use MQ sample program’s amqsput and amqsget from /opt/mqm/samp/bin to put and get message from the Local queue .

/opt/mqm/samp/bin/amqsput TESTQ IBMMQ.QM1
/opt/mqm/samp/bin/amqsget TESTQ IBMMQ.QM1

6.Verify the MQ QMGR data location and log location .

QMGR Data Path
/opt/mqm/qmgrs/IBMMQ.QM1/
QMGR Log Path
/opt/mqm/qmgrs/IBMMQ.QM1/errors/
[mqm@ip-172-31-14-154 ~]$ cd /var/mqm/qmgrs/
[mqm@ip-172-31-14-154 qmgrs]$ ls -rlt
total 4
drwxrwsr-x.  2 mqm mqm    6 Dec 29 15:56  @SYSTEM
drwxrwsr-x. 25 mqm mqm 4096 Dec 30 01:02 'IBMMQ!QM1'
[mqm@ip-172-31-14-154 qmgrs]$ cd IBMMQ\!QM1/
[mqm@ip-172-31-14-154 IBMMQ!QM1]$ ls -lrt
total 32
drwxrws---. 2 mqm mqm    6 Dec 30 01:01 ssl
drwxrwsr-x. 2 mqm mqm    6 Dec 30 01:01 plugcomp
drwxrwsr-x. 2 mqm mqm    6 Dec 30 01:01 userdata
drwxrws---. 2 mqm mqm    6 Dec 30 01:01 scratch
drwxrws---. 3 mqm mqm   19 Dec 30 01:01 @qmpersist
drwxrws---. 3 mqm mqm   19 Dec 30 01:01 @qmgr
drwxrwsr-x. 3 mqm mqm   19 Dec 30 01:01 @app
-rw-rw----. 1 mqm mqm 1552 Dec 30 01:01 qm.ini
-rw-rw----. 1 mqm mqm  732 Dec 30 01:01 mqat.ini
drwxrws---. 2 mqm mqm   40 Dec 30 01:01 qmanager
drwxrws---. 2 mqm mqm   36 Dec 30 01:01 procdef
drwxrws---. 2 mqm mqm   33 Dec 30 01:01 clntconn
drwxrwsr-x. 3 mqm mqm   59 Dec 30 01:01 @ipcc
drwxrws---. 2 mqm mqm   41 Dec 30 01:01 listener
drwxrws---. 2 mqm mqm  114 Dec 30 01:01 namelist
drwxrws---. 2 mqm mqm   47 Dec 30 01:01 comminfo
drwxrws---. 2 mqm mqm  159 Dec 30 01:01 authinfo
drwxrws---. 2 mqm mqm   63 Dec 30 01:01 services
drwxrws---. 2 mqm mqm  268 Dec 30 01:01 channel
drwxrws---. 2 mqm mqm  193 Dec 30 01:01 topic
drwxrws---. 2 mqm mqm   25 Dec 30 01:02 autocfg
-rw-rw-r--. 1 mqm mqm   83 Dec 30 01:02 master
-rw-rw-r--. 1 mqm mqm   83 Dec 30 01:02 active
-rw-rw----. 1 mqm mqm   56 Dec 30 01:02 amqalchk.fil
-rw-rw----. 1 mqm mqm   18 Dec 30 01:02 blockaddr.ini
-rw-rw-r--. 1 mqm mqm  766 Dec 30 01:02 qmstatus.ini
-rw-rw-r--. 1 mqm mqm    0 Dec 30 01:02 amqp.stdout
-rw-rw-r--. 1 mqm mqm    0 Dec 30 01:02 amqp.stderr
drwxrws---. 2 mqm mqm   18 Dec 30 01:02 startprm
drwxrws---. 2 mqm mqm   84 Dec 30 01:02 errors
drwxrwx---. 2 mqm mqm  167 Dec 30 01:02 amqp
drwxrws---. 2 mqm mqm 4096 Dec 30 01:04 queues
[mqm@ip-172-31-14-154 IBMMQ!QM1]$ cd errors/
[mqm@ip-172-31-14-154 errors]$ ls -lrt
total 52
-rw-rw----. 1 mqm mqm     0 Dec 30 01:01 AMQERR03.LOG
-rw-rw----. 1 mqm mqm     0 Dec 30 01:01 AMQERR02.LOG
-rw-rw----. 1 mqm mqm 48237 Dec 30 01:02 AMQERR01.LOG
-rw-rw----. 1 mqm mqm   733 Dec 30 01:02 amqp_0.log
[mqm@ip-172-31-14-154 errors]$ pwd
/var/mqm/qmgrs/IBMMQ!QM1/errors
[mqm@ip-172-31-14-154 errors]$ 

We need to verify AMQERR01.LOG to check any error related to QMGR .

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *