Create queue manager DEMO( mqver, dspmq, crtmqm, strmqm, endmqm,
dltmqm)
Crtmqm demo
Dspmqver – Version details of MQ
Dspmq – displays all status of QMgr
Dspmq -m demo –
displays only status of demo QMgr
Strmqm – starts qmgr demo
Endmqm – ending the qmgr demo
Dltmqm – deletes the qmgr of demo
Runmqsc demo – opens to writ script
Create local queue SAMPLE (define, display, delete)
Define qlocal(sample)
Display qlocal(sample)
Delete qlocal(sample)
Change the priority to 4 and
place messages.
Define qlocal(sample) replace defprty(4) OR
alter qlocal(sample) defprty(4)
Amqsputc sample demo
Check the number of messages in the queue
Display qlocal(sample) curdepth
Try to clear the messages when
the queue is open .Explain about the input and output handles (IPPROCS,
OPPROCS)
Clear qlocal(sample)
We can’t clear the queue if the application is connected to
the queue. (Error object is open)
IPPROCS (Open input count) – This is the number of
applications that are currently connected to the queue to get messages from the
queue.
OPPROCS (Open output count) – This is the number of
applications that are currently connected to the queue to put messages on the
queue.
Put the messages in the queue and
find out the order of delivery (FIFO/PRIORITY).Try changing the order of
delivery and predict the flow
Display qlocal(sample) msgdlvsq – default is priority
Define qlocal(sample) replace defprty(4)
Define qlocal(sample) replace msgdlvsq(FIFO) Or Alter
qlocal(sample) msgdlvsq(FIFO)
The application will fetch the messages based
on the property set in queue. It can be either first in first out or based on
the priority in which case we set the priority number in queue’s msgdlvsq property.
Alter the queue not to allow put / get
Alter qlocal(sample) put(disabled)
Alter qlocal(sample) put(enable) get(disabled)
Create and alias queue ‘MYALIAS’ and make
the target as SAMPLE
Define qalias(myalias) target(sample)
Alter the alias to priority 8 and
place messages from this and observe the result
Alter qalias(myalias) target(sample) defprty(8)
The application will fetch the
messages based on the property set in queue. Based on the priority in which
case we set the priority number in defprty property.
Amqapi
Create model queue ‘TEMP.MODEL’. Perform the
following tasks
Define qmodel(temp.model)
·
Observe dynamic queues
getting created
Created qmodel. Then create the
dynamic queues using Websphere MQ API exerciser.
1.
In Queue manager tab,
Select the queue manager demo
2.
Click MQCONN
3.
In Queues tab, select
Model Queue name temp.model
4.
Click MQOPEN
5.
Enter DynamicQName as
MYMODEL.*, In Options check the MQOO_OUTPUT
6.
Click OK
7.
Queue created
(MYMODEL. Some number will create).
8.
Click MQPUT and type
the message.
9.
Click MQCLOSE
10. Click MQDISC
11. If the Model queue is Permanent the queue and the message
will be there once disconnect it also.
·
Provide a different
names for the dynamic queues
DynamicQName - MyModel.*
·
Make the dynamic queue
as permanent
alter qmodel(temp.model) deftype(permdyn)
·
Find out the place where
permanent/temporary dynamic queues are used
Permanent queues are maintained across queue manager
restarts
If we need to use information after the application closes
there we can make the queue as permanent dynamic queues
Alter the queue to become a persistent
queue. Place messages and restart the queue managers. Do the messages survive
queue manager restart? How? If you
answer is log. Show the path where it is located and also try displaying the
contents of log.
Alter the queue to become a
persistent queue
alter qlocal(sample) defpsist(yes)
amqsput sample demo
Persistent msg
Do the messages survive queue
manager restart? How?
Yes. Because the persistent messages will be stored in log
file.
Once restart the queue manager if the message property is
set as persistent then messages will be there. But if we placed the messages
before set the message property as persistent, messages will not be available.
If you answer is log. Show the
path where it is located and also try displaying the contents of log
C:\Program Files\IBM\WebSphere MQ\log\ - windows
/var/mqm/
log/
- unix
C:\IBM\WebSphere MQ\Qmgrs\\errors
Execute the command to display
the location of queue file. What exactly is this file?
C:\IBM\WebSphere
MQ\Qmgrs\Sample1\queues
C:\IBM\WebSphere MQ\Qmgrs\Sample1\queues\@MANGLED
– if the queue name is lower case
Eg. If we create the queue name in
small case it will automatically created the @mingled directory and there it
will create the queue details.
If the queue name is in upper case it will directly
create the queue name and it will IBM\WebSphere MQ\Qmgrs\Sample1\queues.
Delete the queue file which you
displayed previously. How do your recover from media recovery
Using Linear log we can recover the queue file but we have
to mention the log type is linear when we create the Queue manager itself.
Default log type is circular
How do you figure out
- What log
is used the queue manager.
amqmdain reg
-c display -s Log -v *
Default log type is Circular Log
Can find from qm.ini queue manager’s configuration
file for Unix
- How many
primary and secondary file are allocated
The minimum number of primary log files is 2 and the maximum is
254 on Windows, or 510 on UNIX systems. The default is 3.
The minimum number of secondary log files is 1 and the maximum
is 253 on Windows, or 509 on UNIX systems. The default number is 2.
- What is
the size of the log
The size of each
primary and secondary log files in units of 4K pages. (Multiple of 4KB log file
page size)
- How do
you place the log files in a separate file system
/var/mqm
and /var/mqm/log directories must be on a local file system.
C:\Program Files\IBM\WebSphere MQ\log
/var/mqm/errors
directory can be NFS mounted. However, if you choose to NFS-mount
/var/mqm/errors, the error logs might be lost if the network fails.
Create queue managers with different primary
and secondary file whose size is 10 mb each
crtmqm -lp 10 -ls 10
Alter the queue so that it cannot
be shared between applications
Alter qlocal(sample) share(Not Shareable)
Alter the queue as shared and make
applications to use the combination of locks available for use.
Alter qlocal(sample) share(Shareable)
What does the default open option
for a queue signify?
Distribute Queuing
Create queue managers ‘BRANCH’
&& ‘MANAGER’ and create local queues (PL.REPLY--branch) and
(PL.REQUEST—manager). Connect to branch and place messages in manager and get
COA, COD report from manager
Create queue managers ‘BRANCH’
&& ‘MANAGER’ and create local queues (PL.REPLY--branch) and
(PL.REQUEST—manager).
COA and COD are usually used by a sending application to get
a report on whether the sent message has arrived.
Message Descriptor (MQMD header) contains Report attribute
called COA and COD.
Confirmation of arrival (COA) - MQC.MQFB_COA
COA are those acknowledgement messages which are sent back
as soon the message is received by the MQ in the remote system.
Confirmation of delivery (COD) - MQC.MQFB_COD
COD are those acknowledgement messages which are send back
only after the message is picked up from the remote MQ by the destination
application
This type
of report is generated by the queue manager that owns the destination queue,
when the message is placed on the destination queue. Message data from the
original message is not included with the report message.
Assign a Dead letter queue in MANAGER,
BRANCH. Try all possible combinations of putting a message in the dead letter
queue (try all reasons)
- Destination queue is not
available
- Destination queue is full
- Message is too large
- Destination queue does not
have write permission (put is inhibited)
- The sender is not
authorized to use (put) message to destination queue
- The message contains a
duplicate message sequence number
Run the dead letter queue handler
and assign the rules. Ensure that the message in dead letter queue goes back to
destination if the rule satisfies the condition.
Runmqdlq ……end the handler with a enter and
then press (ctrl-z –enter –ctrl-z –enter).
runmqdlq DLQ < rules.tb
Rules table
INPUTQ (' ') INPUTQM (' ')
REASON (MQRC_Q_FULL) ACTION (RETRY) RETRY (10)
INPUTQ (' ') INPUTQM (' ')
REASON (MQRC_Q_FULL) ACTION (RETRY) RETRY (10)
REASON (MQRC_UNKNOWN_OBJECT_NAME) ACTION (FWD) FWDQ
(WRONG.DEST) - Qname
INPUTQ(DLQ) INPUTQM(BRANCH)
REASON(2087) ACTION(FWD) FWDQ(PL.REQUEST) FWDQM(MANAGER)
REASON(MQRC_Q_FULL) ACTION(RETRY) RETRY(5)
REASON(MQRC_PUT_INHIBITED) ACTION(RETRY) RETRY(5)
Channel
Demonstrate the Usage of MQSERVER,
MQCHLLIB, MQCHLTAB
Client server environment, we
will have client in one system and server in another.
To connect both the client and
server systems we have to set the following path,
In client side set
C:\SET
MQSERVER = channelname/trptyename/ip(port)
Frequently we
have to change the path for different qmgr, so to resolve this we can create
Client Channel Table (CLC). We have to create the table in server side
Table should
contain below things
Qmgr name
Conname – ip(port)
Protocol – trptype name
Channel Name – Server
connection’s Channel Name
Table will be present in the
following path,
C:\IBM\WebSphere
MQ\Qmgrs\\@ipcc\AMQCLCHL.TAB
The entries which is created in
the server will be present in the following path,
C:\IBM\WebSphere MQ\Qmgrs\<
qmgr name >\clntconn\table entries
To transfer the file from the
server to client, place it in
C:\IBM\TABLES\ AMQCLCHL.TAB
Set the path and table name in
environment variables
C:\SET AMQCHLTAB =
AMQCLCHL.TAB (MQ Channel Table)
C:\SET AMQCHLLIB =
C:\IBM\TABLES\ (MQ Channel Library)
Queue Manager Clusters
- Practice the cluster admin
commands
DISPLAY
QCLUSTER
Display
qcluster(*) – It will display all the queues in cluster under the Qmgr.
DISPLAY
CLUSQMGR
Display
clusqmgr(A)- It will display all the properties of A
DIS CLUSQMGR(A) QMTYPE – It displays CLUSQMGR
,
CLUSTER
,
CHANNEL
,
QMTYPE
CLUSQMGR(A)
CLUSTER(AB)
CHANNEL(TO.B)
QMTYPE(NORMAL)
SUSPEND
Runmqsc B
Suspend qmgr cluster(AB)
Display
clusqmgr(A) Suspend – It will display Suspend(YES)
RESUME
Runmqsc B
Resume qmgr
cluster(AB)
REFRESH
Refresh
cluster(AB)
RESET
Alter
channel(TO.B) CHLTYPE(CLUSRCVR) CLUSTER(' ')
Stop channel
(TO.B)
Delete channel
(TO.B)
- Remove a
queue from a cluster
Runmqsc C
Alter qlocal(MYQ) cluster(‘’)
- Remove a
queue manager from cluster
Runmqsc A
Alter
qmgr repos(' ')
- Add a
queue manager D to the cluster connecting to full repository A
DEFINE CHANNEL (TO.A) CHLTYPE (CLUSSDR) TRPTYPE (TCP) CONNAME ('localhost(7001)') CLUSTER (AB)
DEFINE CHANNEL (TO.D) CHLTYPE (CLUSRCVR) TRPTYPE (TCP) CONNAME ('localhost(7003)') CLUSTER (AB)
DEFINE LISTENER (LST.D) TRPTYPE (TCP) PORT (7003)
START LISTENER (LST.D)
- Shift
the full repository B to D
Runmqsc B
Alter
qmgr repos (' ')
Runmqsc D
Alter
qmgr repos ('BD')
- Demonstrate
the work load balancing in the cluster
- Design
an overlapping clusters (probly 3 ) and
a)
pass messages between them
b)
make the workload balance between them
a)Queue
manager outside cluster to queue manager inside cluster
Can place messages both the sides
b)
Perform the vice versa