|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Inquire Listener Status and Channel Status |
« View previous topic :: View next topic » |
Author |
Message
|
mqtablet |
Posted: Sun Apr 08, 2012 11:52 am Post subject: Inquire Listener Status and Channel Status |
|
|
Acolyte
Joined: 09 Jun 2009 Posts: 71
|
Hi All,
One more question on inquiring using PCFs. I'm using the below code to inquire the status attributes of all listeners in a queue manager.
Code: |
int[] pcfAttrs = new int[] {MQConstants.MQIACF_ALL};
pcfRequest = new PCFMessage(MQConstants.MQCMD_INQUIRE_LISTENER_STATUS);
pcfRequest.addParameter(MQConstants.MQCACH_LISTENER_NAME, "*");
pcfRequest.addParameter(MQConstants.MQIACF_LISTENER_STATUS_ATTRS, pcfAttrs);
pcfResponse = pcfAgent.send(pcfRequest);
|
I get the responses for all the listeners that are running, however the issue I'm facing is, when I stop a listener I wont get the responses for it. Also, when all the listeners in the queue manager are stopped, the command server returns a 2085 (MQRC_UNKNOWN_OBJECT_NAME), even if I specify an existing listener name instead of the "*" in the listener name filter parameter while sending the request.
Any inputs how can I get the status of listeners which are in stopped state or any other state than 'running'? I know it is possible to get it because even MQ explorer uses PCFs and it displays the statuses even if the listeners are stopped. Not sure where I'm missing. Same is the case with Channels.
This is on java / MQ 7.0.1.5
Any thoughts / comments?
Thanks |
|
Back to top |
|
 |
mvic |
Posted: Sun Apr 08, 2012 12:06 pm Post subject: Re: Inquire Listener Status and Channel Status |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
mqtablet wrote: |
Any inputs how can I get the status of listeners which are in stopped state or any other state than 'running'? |
The manual http://publib.boulder.ibm.com/infocenter/wmqv7/v7r1/topic/com.ibm.mq.doc/pc12350_.htm says that there are 3 possible values for Status:
MQSVC_STATUS_STARTING
MQSVC_STATUS_RUNNING
MQSVC_STATUS_STOPPING
There is no "stopped" status.
If you want a list of listeners that have no current status, I guess you need to get a list of all listeners, and then a list of status. Any in the first list that do not appear in the second list are probably the ones you are interested in? |
|
Back to top |
|
 |
bruce2359 |
Posted: Sun Apr 08, 2012 4:13 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
I did a bit of testing. I'm going to make a guess here... someone should be along shortly to add to this.
I suspect that the WMQ Explorer does the equivalent of DISPLAY LISTENER(*); and discovers from this the names of known listeners.
It then does a DISPLAY LSSTATUS(*) or LSSTATUS(listenername) to next discover those that are one of the following possible status:
MQSVC_STATUS_STARTING
MQSVC_STATUS_RUNNING
MQSVC_STATUS_STOPPING
It then presumes STOPPED status for a known listener that is not one of the above status.
The WMQ Explorer appears to do similar behavior (or behaviour) for channels. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
mqtablet |
Posted: Sun Apr 08, 2012 10:28 pm Post subject: Re: Inquire Listener Status and Channel Status |
|
|
Acolyte
Joined: 09 Jun 2009 Posts: 71
|
mvic wrote: |
If you want a list of listeners that have no current status, I guess you need to get a list of all listeners, and then a list of status. |
Even the above does not work, as I said earlier, when I inquire providing an existing listener name also, it returns MQRC 2085. Below are the statuses when the listener is running and stopped.
Code: |
DIS LSSTATUS(*) ALL
3 : DIS LSSTATUS(*) ALL
AMQ8631: Display listener status details.
LISTENER(LISTENER.TCP) STATUS(RUNNING)
PID(3996) STARTDA(2012-04-09)
STARTTI(11.33.34) DESCR( )
TRPTYPE(TCP) CONTROL(QMGR)
IPADDR(*) PORT(1414)
BACKLOG(100)
:
STOP LISTENER(LISTENER.TCP)
4 : STOP LISTENER(LISTENER.TCP)
AMQ8706: Request to stop WebSphere MQ Listener accepted.
:
DIS LSSTATUS(*) ALL
5 : DIS LSSTATUS(*) ALL
AMQ8147: WebSphere MQ object * not found.
:
DIS LSSTATUS(LISTENER.TCP) ALL
6 : DIS LSSTATUS(LISTENER.TCP) ALL
AMQ8147: WebSphere MQ object LISTENER.TCP not found.
|
I'm not sure why it returns MQRC_UNKNOWN_OBJECT_NAME, even if the listener with the given name exists and when it is just in 'STOPPED' state.
bruce2359 wrote: |
MQSVC_STATUS_STARTING
MQSVC_STATUS_RUNNING
MQSVC_STATUS_STOPPING
It then presumes STOPPED status for a known listener that is not one of the above status.
|
May be. Also it may be the case with channels as well. If a channel is not at any of the statuses defined in here, it presumes to be 'INACTIVE'.  |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Apr 09, 2012 12:50 am Post subject: Re: Inquire Listener Status and Channel Status |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
mqtablet wrote: |
I'm not sure why it returns MQRC_UNKNOWN_OBJECT_NAME, even if the listener with the given name exists and when it is just in 'STOPPED' state. |
Because the *status* of the object doesn't exist, even though the object itself does exist.
mqtablet wrote: |
May be. Also it may be the case with channels as well. If a channel is not at any of the statuses defined in here, it presumes to be 'INACTIVE'.  |
YES, EXACTLY.
If the listener status doesn't exist, it presumes to be stopped. |
|
Back to top |
|
 |
mqtablet |
Posted: Mon Apr 09, 2012 1:12 am Post subject: Re: Inquire Listener Status and Channel Status |
|
|
Acolyte
Joined: 09 Jun 2009 Posts: 71
|
mqjeff wrote: |
mqtablet wrote: |
I'm not sure why it returns MQRC_UNKNOWN_OBJECT_NAME, even if the listener with the given name exists and when it is just in 'STOPPED' state. |
Because the *status* of the object doesn't exist, even though the object itself does exist. |
If the *status* of a listener doesn't exist (since it is stopped), its not good to report as the object itself doesn't exist (doesn't make sense).
If you see the channel status, and if the channel is *INACTIVE*, it reports as channel status not found, rather than reporting that the channel itself does not exist (which makes sense).
Code: |
DIS CHS(SYSTEM.DEF.SVRCONN) ALL
7 : DIS CHS(SYSTEM.DEF.SVRCONN) ALL
AMQ8420: Channel Status not found.
|
Not sure why the statuses of MQ objects are not reported consistently.. May be for some other reason, which I dont know..  |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Apr 09, 2012 4:38 am Post subject: Re: Inquire Listener Status and Channel Status |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
mqtablet wrote: |
mqjeff wrote: |
mqtablet wrote: |
I'm not sure why it returns MQRC_UNKNOWN_OBJECT_NAME, even if the listener with the given name exists and when it is just in 'STOPPED' state. |
Because the *status* of the object doesn't exist, even though the object itself does exist. |
If the *status* of a listener doesn't exist (since it is stopped), its not good to report as the object itself doesn't exist (doesn't make sense). |
It's not. You're not asking for the listener, you are asking for the status of the listener. The listener exists, but it's status doesn't.
It's not telling you that the listener doesn't exist with MQRC_UNKNOWN_OBJECT_NAME. It's telling you that the LSSTATUS doesn't exist for an object of that name.
I agree, that MQSC and PCF in general need to have a consistent behavior across all commands and object types, and that it does not current exhibit this. For example, you can't ALTER a CHLAUTH, you can only SET it. This is inconsistent.
mqtablet wrote: |
If you see the channel status, and if the channel is *INACTIVE*, it reports as channel status not found, rather than reporting that the channel itself does not exist (which makes sense).
Code: |
DIS CHS(SYSTEM.DEF.SVRCONN) ALL
7 : DIS CHS(SYSTEM.DEF.SVRCONN) ALL
AMQ8420: Channel Status not found.
|
Not sure why the statuses of MQ objects are not reported consistently.. May be for some other reason, which I dont know..  |
I'm sure I don't know either. |
|
Back to top |
|
 |
mqtablet |
Posted: Mon Apr 09, 2012 5:05 am Post subject: |
|
|
Acolyte
Joined: 09 Jun 2009 Posts: 71
|
mqjeff wrote: |
It's not. You're not asking for the listener, you are asking for the status of the listener. The listener exists, but it's status doesn't.
|
Same sentence - I'm not asking for the channel, I'm asking for the status of the channel. The Channel exists, but it's status doesn't.
How come it says the Channel Status not found and not WebSphere MQ Object CHANNEL_NAME not found.
When I check the status of listeners using LSSTATUS command (and if the listener is stopped), it prints the below message
Code: |
AMQ8147: WebSphere MQ object LISTENER.TCP not found. |
I'm expecting something like the below when I say DISPLAY LSSTATUS(LISTENER_NAME) on a listener which is not running.
Code: |
DIS LSSTATUS(LISTENER.TCP) ALL
4 : DIS LSSTATUS(LISTENER.TCP) ALL
AMQXXXX: Listener Status not found.
|
rather than
Code: |
DIS LSSTATUS(LISTENER.TCP) ALL
4 : DIS LSSTATUS(LISTENER.TCP) ALL
AMQ8147: WebSphere MQ object LISTENER.TCP not found
|
Why should it say WebSphere MQ Object not found? It should say Listener Status not found (similar to that of channel, and this is what I expect when I check the status of Listener which is stopped too).
This is not comparing PCF and MQSC.
This is comparing Channel Status output given by MQSC and Listener Status output given by MQSC.
I give up.  |
|
Back to top |
|
 |
Vitor |
Posted: Mon Apr 09, 2012 5:10 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqtablet wrote: |
Why should it say WebSphere MQ Object not found? |
Because the status is an object separate to the channel / listener that it's the status of.
mqtablet wrote: |
This is comparing Channel Status output given by MQSC and Listener Status output given by MQSC.
I give up.  |
I'd raise a PMR & report you're getting inconsistent behaviour first. Worst case you'll get "functioning as designed", better case you'll get "functioning as designed but you can get the effect you're looking for if you .....", best case you'll get an APAR to correct the inconsistent behaviour.
Everything to gain, nothing to lose. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqtablet |
Posted: Mon Apr 09, 2012 5:18 am Post subject: |
|
|
Acolyte
Joined: 09 Jun 2009 Posts: 71
|
Vitor wrote: |
I'd raise a PMR |
I will do this.
Vitor wrote: |
Worst case you'll get "functioning as designed", better case you'll get "functioning as designed but you can get the effect you're looking for if you .....", best case you'll get an APAR to correct the inconsistent behaviour. |
I like this...
Hope we should have 'Like' button similar to Facebook in this forum too..
We could like a lot of comments.. ha ha.. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|