Author |
Message
|
paustin_ours |
Posted: Fri May 17, 2013 6:42 am Post subject: identifying flow that is reading from queue |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
i can tell which EG process is having a MQ queue open using the display qstatus. How can i tell which flow has the queue open?
can think of a way to tell this. Please let me know. |
|
Back to top |
|
 |
zpat |
Posted: Fri May 17, 2013 7:04 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
You can usually tell by looking at the flow properties in MBX and seeing which queues each flow is using in their MQ nodes. |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 17, 2013 7:04 am Post subject: Re: identifying flow that is reading from queue |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
paustin_ours wrote: |
i can tell which EG process is having a MQ queue open using the display qstatus. How can i tell which flow has the queue open? |
By using the deploy document you generate as part of your change control process.
Seriously. You should have a document describing what resources a flow uses because it's really hard to reverse engineer it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
paustin_ours |
Posted: Fri May 17, 2013 7:36 am Post subject: |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
Who has time to read documents when you are in a 2 a.m support call
reverse engineering sounds like a better option though it is harder |
|
Back to top |
|
 |
dogorsy |
Posted: Fri May 17, 2013 7:49 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
you know what execution group, so if you also know what bar files were deployed to that EG, then you can you the mqsireadbar command, that will list the attributes for each flow, search for the queue name |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 17, 2013 7:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
paustin_ours wrote: |
Who has time to read documents when you are in a 2 a.m support call  |
The support guy called out of bed?
paustin_ours wrote: |
reverse engineering sounds like a better option though it is harder |
IMHO at 2am you want easy and straightforward. That's why we use documents here in a central library. Also by "documents" I don't mean a 5 volume set bound in leather. We have a 2 page cheet sheet for each application that describes this, and interestingly the stage gate test the document has to pass through is described as "sufficient for a support person with no previous experience of the application to triage any issue if called at 3am". _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
new2z |
Posted: Fri May 17, 2013 12:29 pm Post subject: |
|
|
Novice
Joined: 16 May 2013 Posts: 15
|
I can think of a menial and risky way of doing it
Precondition
-----
1. You should have messages in your queue
2. You should be able to stop all the flows in your EG
Once all flows are stopped, you can start the message flows one after another at a specified interval. Till the time your messages don't clear, those are not the flow you are looking for.
If you have just started a flow, and messages start clearing in the queue, then it is the one
If you do not have a manual/document to figure which queue is for which flow, then this is one effective way. But risky because you are stopping a flow. You might want to test this in your QA or Stage environment. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri May 17, 2013 2:51 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
I don't disagree that documentation can be very helpful.
But just because a doc says Message Flow ABC_123 is the one that has uses Queue_XYZ, it doesn't necessarily prove what flow actually has the queue open.
Trust that documentation, but verify independently. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
paustin_ours |
Posted: Fri May 17, 2013 7:04 pm Post subject: |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
Hoping to get some ideas related to finding the thread details under the EG process and somehow associate the queue to that thread. Along those lines.
Is this possible? Should i maybe ask a UNIX admin for some help? |
|
Back to top |
|
 |
mapa |
Posted: Sun May 19, 2013 10:16 am Post subject: |
|
|
 Master
Joined: 09 Aug 2001 Posts: 257 Location: Malmö, Sweden
|
The proper way to do it is to keep an ID in the artifacts that can easily search for in lightweight documentation, like a wiki. More or less as already suggested.
Still, being a bit bored I did a quick and ugly Groovy hack that finds the flow(s) containing the queue you search for in that EG using mqsireportproperties...
Code: |
C:\var>groovy findQ.groovy
usage: findQ
-b,--broker <arg> Broker name
-e,--eg <arg> ExecutionGroup name
-q,--queue <arg> Queue name
C:\var>groovy findQ.groovy -b MB8BROKER -e default -q TEST.IN
Messageflows containing queue TEST.IN: label='SimpleTestFlow'
|
Code: |
def cli = new CliBuilder()
cli.with {
usage: 'findQ'
q longOpt:'queue', 'Queue name', args:1
b longOpt:'broker', 'Broker name',args:1
e longOpt:'eg', 'ExecutionGroup name',args:1
}
def opt = cli.parse(args)
if( args.length == 0) {
cli.usage()
return
}
def EG= opt.e ?: 'default'
def BROKER = opt.b ?: 'MB8BROKER'
def Q = opt.q ?: 'TEST.IN'
String result = "mqsireportproperties ${BROKER} -e ${EG} -o AllMessageFlows -r".execute().in.text
def res = result =~ /MessageFlow|label='.*'|queueName='${Q}'/
MessageFlowMatch flowMatch
def skipNextLabel
def matchingFlows = []
res.each { it ->
if (it == 'MessageFlow') {
flowMatch = new MessageFlowMatch()
skipNextLabel = false
matchingFlows.add(flowMatch)
}
else if (it.startsWith('label')) {
if (! skipNextLabel) {
flowMatch.label = it
skipNextLabel = true
}
}
else {
flowMatch.queueName = it
}
}
matchingFlows.findAll { it.queueName =~ /${Q}/ }.each { println "Messageflows containing queue ${Q}: ${it.label}" }
class MessageFlowMatch {
String label
String queueName
}
|
|
|
Back to top |
|
 |
paustin_ours |
Posted: Sun May 19, 2013 10:20 pm Post subject: |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
Thanks mapa. I beleive thats the best solution yet in finding the information programatically. |
|
Back to top |
|
 |
|