Author |
Message
|
gaojingyu |
Posted: Thu Jul 16, 2009 12:00 am Post subject: How to inquire the OSS PIDs of the QUEUE consumers on HP? |
|
|
Novice
Joined: 04 Jan 2009 Posts: 11
|
We have a requirement to inquire the OSS PIDs of the QUEUE consumers on HP nonstop platform using C language.
Take it for example
in MQSC, the dis qstatus result as below:
dis qstatus('mq_monitor_test.q') type(handle) pid input output
1 : dis qstatus('mq_monitor_test.q') type(handle) pid input output
AMQ8450: Display queue status details.
QUEUE(mq_monitor_test.q) PID(1,1072 OSS(449315793))
INPUT(SHARED) OUTPUT(NO)
Then How to get the OSS pid (449315793) in my program?
Thanks |
|
Back to top |
|
 |
Mr Butcher |
Posted: Thu Jul 16, 2009 1:31 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
either run that mqsc stuff as script with file output and read the output file in your program, or issue the display command as pcf command from your program directly to mqseries and read the output from the queue.
i recommend to use the second option.
check the mq manuals for pcf commands. i assume there are also samples around. also search here. _________________ Regards, Butcher |
|
Back to top |
|
 |
gaojingyu |
Posted: Thu Jul 16, 2009 2:30 am Post subject: |
|
|
Novice
Joined: 04 Jan 2009 Posts: 11
|
Mr Butcher wrote: |
either run that mqsc stuff as script with file output and read the output file in your program, or issue the display command as pcf command from your program directly to mqseries and read the output from the queue.
i recommend to use the second option.
check the mq manuals for pcf commands. i assume there are also samples around. also search here. |
Currently, I already use the PCF, and add the inquiry MQIACF_PROCESS_ID in the admin bag. But unfortunately, the reply pid is not the OSS pid |
|
Back to top |
|
 |
Mr Butcher |
Posted: Thu Jul 16, 2009 2:42 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
maybe MQIACF_THREAD_ID is what you are looking for ? _________________ Regards, Butcher |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jul 16, 2009 8:12 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
PCF and MQSC should give identical data in return.
So if you are issuing the proper INQUIRE QSTATUS command message, the PID value in the response message should hold the same data as is returned by DISPLAY QSTATUS in the PID field. |
|
Back to top |
|
 |
gaojingyu |
Posted: Thu Jul 16, 2009 5:16 pm Post subject: |
|
|
Novice
Joined: 04 Jan 2009 Posts: 11
|
Mr Butcher wrote: |
maybe MQIACF_THREAD_ID is what you are looking for ? |
MQIACF_THREAD_ID is the thread identifier of the application that has opened the specified queue. whether or no I have tested it, it cann't work well too. |
|
Back to top |
|
 |
gaojingyu |
Posted: Thu Jul 16, 2009 5:20 pm Post subject: |
|
|
Novice
Joined: 04 Jan 2009 Posts: 11
|
mqjeff wrote: |
PCF and MQSC should give identical data in return.
So if you are issuing the proper INQUIRE QSTATUS command message, the PID value in the response message should hold the same data as is returned by DISPLAY QSTATUS in the PID field. |
on Solaris and Linux, as you saild, the PID value in the response message hold the same data as is returned by DISPLAY QSTATUS in the PID field.
But on HP, the PID value in the response message hold the different data (66608) as is returned by DISPLAY QSTATUS in the PID field (1,1072 OSS(449315793)).
I found the rule between the first part of DISPLAY QSTATUS PID (1,1072) and the value my program listd (66608), is 1 * 65536 + 1072 = 66608. But I always don't know how to inquire the OSS pid, any suggestion? |
|
Back to top |
|
 |
|