Every MQ infrastructure team member has been asked the question, and most developers who have worked with MQ have asked it: "Where is my message?". In this session we look into the tools that MQ provides to find your messages. We demonstrate how to analyze the MQ recovery log on distributed platforms to find out what happened to your persistent messages, with the assistance of a new tool. We also look at how to trace the route messages take through your MQ infrastructure, and how to generate and analyze activity reports showing the behavior of MQ applications.
2. Please Note
IBM’s statements regarding its plans, directions, and intent are subject to change
or withdrawal without notice at IBM’s sole discretion.
Information regarding potential future products is intended to outline our general
product direction and it should not be relied on in making a purchasing decision.
The information mentioned regarding potential future products is not a
commitment, promise, or legal obligation to deliver any material, code or
functionality. Information about potential future products may not be incorporated
into any contract. The development, release, and timing of any future features or
functionality described for our products remains at our sole discretion.
Performance is based on measurements and projections using standard IBM
benchmarks in a controlled environment. The actual throughput or performance
that any user will experience will vary depending upon many factors, including
considerations such as the amount of multiprogramming in the user’s job stream,
the I/O configuration, the storage configuration, and the workload processed.
Therefore, no assurance can be given that an individual user will achieve results
similar to those stated here.
3. Symptoms include:
Timeouts for request/response messaging
Inconsistent data between front-end and back-end systems
Customer complaints about ‘missing’ transactions
Developer frustration when testing an app / MQ environment
4. Agenda – the MQ Toolbox
Who’s connected?
Are messages flowing?
Where are messages going?
What are the apps doing?
How can I look back in time?
$ echo 'Presentation contains UNIX/cygwin shell examples & MQSC output'
$ echo 'Your own admin tools will vary by task, situation and preference'
$ echo 'Tasks can be performed in PowerShell, MQ Explorer etc. as desired'
6. DISPLAY CONN
$ echo $'DIS CONN(*) TYPE(HANDLE) ALLnDIS CONN(*) ALL' | runmqsc > o.txt
AMQ8276: Display Connection details.
CONN(577C425321295301)
EXTCONN(414D5143474154455741593120202020)
TYPE(HANDLE)
OBJNAME(WLMMDB.REQUEST) OBJTYPE(QUEUE)
ASTATE(NONE) HSTATE(INACTIVE)
OPENOPTS(MQOO_OUTPUT,MQOO_FAIL_IF_QUIESCING)
READA(NO)
OBJNAME(SENDINGAPP.REPLY) OBJTYPE(QUEUE)
ASTATE(ACTIVE) HSTATE(ACTIVE)
OPENOPTS(MQOO_INPUT_SHARED,MQOO_INQUIRE,MQOO_SAVE_ALL_CONTEXT,MQOO_FAIL_IF_QUIESCING)
READA(NO)
AMQ8276: Display Connection details.
CONN(577C425321295301)
EXTCONN(414D5143474154455741593120202020)
TYPE(CONN)
PID(9740) TID(185)
APPLDESC(WebSphere MQ Channel) APPLTAG(jms/GATEWAY1_CF)
APPLTYPE(SYSTEM) ASTATE(NONE)
CHANNEL(WAS.CLIENTS) CONNAME(127.0.0.1)
CONNOPTS(MQCNO_SHARED_BINDING) USERID(pbroad)
UOWLOG( ) UOWSTDA(2014-04-08)
UOWSTTI(13.24.00) UOWLOGDA( )
UOWLOGTI( ) URTYPE(XA)
EXTURID(XA_FORMATID[DSAW]
XA_GTRID[00000145414B8AB40000000104DF48FC0001020304050607080900010203040506070809]
XA_BQUAL[00000145414B8AB40000000104DF48FC0001020304050607080900010203040506070809000000010000000000000000
000000000001])
QMURID(0.7940075) UOWSTATE(ACTIVE)
Use CONN to match TYPE(CONN) and
TYPE(HANDLE) records
Use CONN to match TYPE(CONN) and
TYPE(HANDLE) records
TYPE(HANDLE) records let you find
applications by the objects they access.
See all open handles for an app in one place,
unlike DIS QSTATUS records
TYPE(HANDLE) records let you find
applications by the objects they access.
See all open handles for an app in one place,
unlike DIS QSTATUS records
Long running UOW information.
XID can be tied up with app server txn timeout
Long running UOW information.
XID can be tied up with app server txn timeout
Channel name + IP help identify client apps.
MQ V7.5 and later JMS clients can supply
an application name in the CF
Channel name + IP help identify client apps.
MQ V7.5 and later JMS clients can supply
an application name in the CF
7. DISPLAY CHSTATUS
$ echo 'DIS CHSTATUS(*)' | runmqsc > o.txt
AMQ8417: Display Channel Status details.
CHANNEL(WAS.CLIENTS) CHLTYPE(SVRCONN)
BUFSRCVD(17) BUFSSENT(13)
BYTSRCVD(2296) BYTSSENT(2456)
CHSTADA(2014-04-08) CHSTATI(15.26.59)
COMPHDR(NONE,NONE) COMPMSG(NONE,NONE)
COMPRATE(0,0) COMPTIME(0,0)
CONNAME(127.0.0.1) CURRENT
EXITTIME(0,0) HBINT(5)
JOBNAME(0000260C000000B9) LOCLADDR( )
LSTMSGDA(2014-04-08) LSTMSGTI(15.26.59)
MCASTAT(RUNNING) MCAUSER(pbroad)
MONCHL(OFF) MSGS(6)
RAPPLTAG(jar) SSLCERTI(CN=ExampleCA,O=Example)
SSLKEYDA( ) SSLKEYTI( )
SSLPEER(SERIALNUMBER=53:43:FD:D6,CN=ExampleApp1,O=Example)
SSLRKEYS(0) STATUS(RUNNING)
STOPREQ(NO) SUBSTATE(RECEIVE)
CURSHCNV(1) MAXSHCNV(1)
RVERSION(00000000) RPRODUCT(MQJM)
See SSLPEER information not in DIS CONNSee SSLPEER information not in DIS CONN
JOBNAME contains PID (except z/OS): 0x260C = PID(9740)
On Linux/UNIX (not Win) TID matches CONN: 0xB9 = TID(185)
JOBNAME contains PID (except z/OS): 0x260C = PID(9740)
On Linux/UNIX (not Win) TID matches CONN: 0xB9 = TID(185)
Note that multiple CONN might share one SVRCONN channel instanceNote that multiple CONN might share one SVRCONN channel instance
Check suitable heartbeats are negotiatedCheck suitable heartbeats are negotiated
9. AMQSCLM
1) Normal operation
Driver
qmgr 1
Driver
qmgr 2
Driver
qmgr N
. . .
Target
qmgr 1
Target
qmgr 2
Target
qmgr N
. . .
Sending appsSending appsSending apps
Cluster
WLM
Cluster
WLM
Round-robin message distribution
App
server 1
App
server 2
App
server N
. . .
IPPROCS(>=1) IPPROCS(>=1) IPPROCS(>=1)
AMQSCLM AMQSCLM AMQSCLM
10. AMQSCLM
2) Application failure
Driver
qmgr 1
Driver
qmgr 2
Driver
qmgr N
. . .
Target
qmgr 1
Target
qmgr 2
Target
qmgr N
. . .
Sending appsSending appsSending apps
Cluster
WLM
Cluster
WLM
Round-robin message distribution
App
server 1
App
server 2
App
server N
. . .
IPPROCS(0) IPPROCS(>=1) IPPROCS(>=1)
Messages
start
building up
AMQSCLM AMQSCLM AMQSCLM
11. AMQSCLM
3) Failure Detection
Driver
qmgr 1
Driver
qmgr 2
Driver
qmgr N
. . .
Target
qmgr 1
Target
qmgr 2
Target
qmgr N
. . .
Sending appsSending appsSending apps
Cluster
WLM
Cluster
WLM
Round-robin message distribution
App
server 1
App
server 2
App
server N
. . .
IPPROCS(0) IPPROCS(>=1) IPPROCS(>=1)
AMQSCLM
regularly
checks the
queue and
detects
IPPROCS(0)
AMQSCLM AMQSCLM AMQSCLM
12. AMQSCLM
4) Redirect Messages
Driver
qmgr 1
Driver
qmgr 2
Driver
qmgr N
. . .
Target
qmgr 1
Target
qmgr 2
Target
qmgr N
. . .
Sending appsSending appsSending apps
Cluster
WLM
Cluster
WLM
Round-robin message distribution
App
server 1
App
server 2
App
server N
. . .
IPPROCS(0) IPPROCS(>=1) IPPROCS(>=1)
AMQSCLM
reduces
queue
priority in
cluster, to
stop new
messages
arriving
AMQSCLM AMQSCLM AMQSCLM
13. AMQSCLM
5) Un-maroon Msgs
Driver
qmgr 1
Driver
qmgr 2
Driver
qmgr N
. . .
Target
qmgr 1
Target
qmgr 2
Target
qmgr N
. . .
Sending appsSending appsSending apps
Cluster
WLM
Cluster
WLM
Round-robin message distribution
App
server 1
App
server 2
App
server N
. . .
IPPROCS(0) IPPROCS(>=1) IPPROCS(>=1)
AMQSCLM
tells qmgr to
redistribute
‘stuck’
messages via
the cluster
AMQSCLM AMQSCLM AMQSCLM
14. AMQSCLM summary
The Cluster Queue Monitoring sample program (AMQSCLM)
Shipped with the product as a sample
• Precompiled
• Source code
• Platforms except on z/OS
More information here:
http://ow.ly/vzZoV
16. Real-time/online Monitoring – Queues
Set detail level for QMGR. Override for individual Queues
Gives live view of application responsiveness
$ echo 'ALTER QMGR MONQ(MEDIUM)' | runmqsc
$ echo 'ALTER QL(QUEUE1) MONQ(HIGH)'
$ echo 'ALTER QL(QUEUE2) MONQ(OFF)'
AMQ8450: Display queue status details.
QUEUE(WLMMDB.REQUEST) TYPE(QUEUE)
CURDEPTH(16) IPPROCS(3)
LGETDATE(2014-04-08) LGETTIME(17.05.59)
LPUTDATE(2014-04-08) LPUTTIME(17.12.16)
MEDIALOG( ) MONQ(HIGH)
MSGAGE(112) OPPROCS(5)
QTIME(10101414, 10101414) UNCOM(NO)
$ echo 'DIS QS(MQHUB.GATEWAY1) ALL' | runmqsc
Age in Seconds of the oldest
message on the queue
Age in Seconds of the oldest
message on the queue
Estimations of the time in Microseconds that messages are waiting on the queue for processing.
First value: Calculated from recent activity
Second value: Calculated from longer term activity
Estimations of the time in Microseconds that messages are waiting on the queue for processing.
First value: Calculated from recent activity
Second value: Calculated from longer term activity
Timestamps of last PUT/GET
to check for recent activity
Timestamps of last PUT/GET
to check for recent activity
Without MONQ you only get the depth and
how many handles are open
Without MONQ you only get the depth and
how many handles are open
17. Real-time/online Monitoring – Channels
Gives live view of channel throughput
$ echo 'ALTER QMGR MONCHL(MEDIUM)' | runmqsc
$ echo 'ALTER CHL(CLUSTER1.QM1) CHLTYPE(CLUSRCVR) MONCHL(HIGH)'
AMQ8417: Display Channel Status details.
CHANNEL(MQHUB.GATEWAY2) CHLTYPE(CLUSSDR)
BATCHES(52) BATCHSZ(50)
BUFSRCVD(55) BUFSSENT(1616)
BYTSRCVD(1748) BYTSSENT(1192330)
CHSTADA(2014-04-08) CHSTATI(17.49.03)
COMPHDR(NONE,NONE) COMPMSG(NONE,NONE)
COMPRATE(0,0) COMPTIME(0,0)
CONNAME(127.0.0.1(1422)) CURLUWID(0107445310001B34)
CURMSGS(50) CURRENT
CURSEQNO(11823) EXITTIME(0,0)
HBINT(5) INDOUBT(YES)
JOBNAME(00002DA4000047D0) LOCLADDR(127.0.0.1(53557))
LONGRTS(999999999) LSTLUWID(0107445310001B33)
LSTMSGDA(2014-04-08) LSTMSGTI(17.49.51)
LSTSEQNO(11773) MCASTAT(RUNNING)
MONCHL(MEDIUM) MSGS(1580)
NETTIME(137538,29555) NPMSPEED(FAST)
RQMNAME(GATEWAY2) SHORTRTS(180)
SSLCERTI( ) SSLKEYDA( )
SSLKEYTI( ) SSLPEER( )
SSLRKEYS(0) STATUS(RUNNING)
STOPREQ(NO) SUBSTATE(RECEIVE)
XBATCHSZ(20,17) XMITQ(SYSTEM.CLUSTER.TRANSMIT.QUEUE)
XQMSGSA(112) XQTIME(545784,3929968)
RVERSION(07050002) RPRODUCT(MQMM)
$ echo 'DIS CHS(MQHUB.GATEWAY2) ALL' | runmqsc
Short/long term calculations of how
full your batches are getting, to help
you tune BATCHSZ/BATCHINT
Short/long term calculations of how
full your batches are getting, to help
you tune BATCHSZ/BATCHINT
Last time a message was sent over
the channel
Last time a message was sent over
the channel
Depth of messages on XMITQ
for this channel (capped at 999)
Depth of messages on XMITQ
for this channel (capped at 999)
Short/long term calculations of how
long messages are waiting on the
XMITQ for transmission
Short/long term calculations of how
long messages are waiting on the
XMITQ for transmission
18. Accounting and Statistics Overview
Monitoring data send as a PCF message at a configured interval
• Statistics – scoped to a Queue / Channel / QMGR
• Accounting – scoped to an individual CONN and Queue / QMGR
Applications must consume the messages
• Enterprise monitoring – Tivoli ITCAM / Tivoli OMEGAMON XE for Messaging
• Sample applications and SupportPacs
• Custom applications – com.ibm.mq.headers Java package
PCF accounting
collection app
PCF accounting
collection app
QueuesQueues ChannelsChannels
CONNsCONNs
PCF statistics
collection app
PCF statistics
collection app
Statistics
Messages
Accounting
Messages
QMGRQMGR
SYSTEM.ADMIN.STATISTICS.QUEUE SYSTEM.ADMIN.ACCOUNTING.QUEUE
19. Taking a look with SupportPac MS0P
Time period
MQ Statistics at QMGR level
Detailed queue statistics
22. ClusterCluster
MQ networks can be complex
At each of the dots stuck / mis-sent messages are possible
• MQOPENs of the wrong Queue / Queue Manager by apps
• Full queues
• Stopped channels
• Stopped apps
• Incorrectly configured QREMOTE/QALIAS routing objects
• Cluster membership problems
The standard problem diagnosis approach
• Methodically checking channels/queues/DLQs at each point
Is there anything to speed up this process?
App1App1
App2AApp2A
App2BApp2B
Requests Replies
Replies
SDR/RCVRSDR/RCVR
SDR/RCVRSDR/RCVR
23. ClusterCluster
Trace Route
MQ has the ability to inject tracer messages
• Hidden from applications
• Generate activity reports as they pass through
Tools are available to trace routes using these reports
• dspmqrte – command line tool supplied with the product
• MS0P – Cat 2 SupportPac extension to MQ Explorer
• Report messages need to get back to your ReplyQ of your tool
Lets you see the path messages could have taken
• Test connectivity through the MQ network
• Test cluster workload balancing
Can quickly jump you close to the problem
• The point your tracer message veers off in the wrong direction
• The point the trail goes cold
dspmqrtedspmqrte SDR/RCVRSDR/RCVR
SDR/RCVRSDR/RCVR
dspmqrtedspmqrte
dspmqrtedspmqrte
26. Application Activity Tracing
Similar infrastructure to Accounting & Statistics
• PCF messages on SYSTEM.ADMIN.TRACE.ACTIVITY.QUEUE
• Configurable via ini file
– Can be changed without QMGR restart
– Configurable detail level can include partial/full message payload
– Frequency options for tuning
• Can be enabled on a per-application basis
– Via MQCONNX flags
– Via application name
– MQ V7.5 JMS clients can supply an application name in the CF
Enables scenarios such as
• Application audit trail
• Message duplication
• Resource usage
– Which queues or topics are actually being used
• Problem Determination
Which Queue / Queue Manager is the application actually opening
• Application Coding Standards
– Does everyone use the MQI in the recommended way
• And more …
Health warning: Performance impact
http://ow.ly/vA8wB
Health warning: Performance impact
http://ow.ly/vA8wB
27. Looking at the data with the amqsact sample
$ echo "ALTER QMGR ACTVTRC(ON)" | runmqsc # should be tuned via mqat.ini
$ amqsact -m GATEWAY1 -v > out.txt
MQI Operation: 6
Operation Id: MQXF_PUT
ApplicationTid: 12451
OperationDate: '2014-04-09'
OperationTime: '01:39:48'
High Res Time: 1397003988665548
Completion Code: MQCC_OK
Reason Code: 0
Hobj: 18225032
Put Options: 139330
Msg length: 460
Recs_present: 0
Known_dest_count: 1
Unknown_dest_count: 0
Invalid_dest_count: 0
Object_type: MQOT_Q
Object_name: 'SENDINGAPP.REPLY'
Object_Q_mgr_name: 'GATEWAY1'
Resolved_Q_Name: 'SENDINGAPP.REPLY'
Resolved_Q_mgr: 'GATEWAY1'
Resolved_local_Q_name: 'SENDINGAPP.REPLY'
Resolved_local_Q_mgr: 'GATEWAY1'
Resolved_type: MQOT_Q
Report Options: 0
Msg_type: MQMT_DATAGRAM
Expiry: -1
Format_name: 'MQHRF2'
Priority: 4
Persistence: 0
Msg_id:
00000000: 414D 5120 4741 5445 5741 5931 2020 2020 'AMQ GATEWAY1 '
00000010: 0207 4453 2007 2603 '..DS .&. '
Correl_id:
00000000: 414D 5120 4741 5445 5741 5931 2020 2020 'AMQ GATEWAY1 '
00000010: 0207 4453 2007 2203 '..DS .". '
Reply_to_Q : ' ^D'
Reply_to_Q_Mgr: ' ^C'
Coded_char_set_id: 1208
Encoding: 273
Put_date: '20140409'
Put_time: '00394866'
Check the options used for coding standardsCheck the options used for coding standards
Check queue name resolution, to find out
why messages are going to the wrong place
Check queue name resolution, to find out
why messages are going to the wrong place
Track individual messages and request/reply
scenarios with Msg_id and Correl_id
Track individual messages and request/reply
scenarios with Msg_id and Correl_id
29. What happened to my messages at 2am this morning?
1. Enterprise monitoring solution
DLQ alerts, queue depth alerts, channel status alerts
Unresolved running units of work
Historical MQ monitoring, accounting and stats data
2. App logs from the time of the problem
Exceptions, MQ error codes, timeouts
1. MQ logs for all qmgrs that could have been involved
Channel errors
Authentication issues
1. ??? – what else is there
30. What about the MQ Recovery Log?
For persistent messages inside transactions
• MQ logs each operation performed
Why can't we use this to
• Look back in time to 2am and see what happened
• Recovery the original payload if the app lost the message
• See what happened inside long-running units of work
• Provide a list of operations within the failed business transaction
MQ documents how you can… if
• You use the text formatting tool provided with MQ (dmpmqlog)
• The logging is linear so the historical data is available in the tool
• You follow the right steps to extract data from running qmgrs
• You do the work to follow through the logs
34. We Value Your Feedback
Don’t forget to submit your Impact session and speaker
feedback! Your feedback is very important to us – we use it to
continually improve the conference.
Use the Conference Mobile App or the online Agenda Builder to
quickly submit your survey
• Navigate to “Surveys” to see a view of surveys for sessions
you’ve attended
34