Author |
Message
|
salmanrs |
Posted: Tue Jul 02, 2002 6:52 am Post subject: CurrentDepth() |
|
|
Newbie
Joined: 13 Jun 2002 Posts: 6 Location: Michigan
|
Hi All,
I am trying to get the number of msgs on the queue by using the method getCurrentDepth(). Inspite of the open option being MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE, I am getting an error code of 2068 which is MQRC_SELECTOR_NOT_FOR_TYPE. Could any one tell me what is wrong?.
Thanks in advance. |
|
Back to top |
|
 |
bduncan |
Posted: Tue Jul 02, 2002 7:04 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
What type of queue is this? Local, remote, clustered, etc?
The definition of the 2068 error (and the definition of the MQINQ command which is what getCurrentDepth() is actually doing) show that the command will fail for certain types of queues:
Quote: |
MQRC_SELECTOR_NOT_FOR_TYPE (2068, X'0814')
Explanation: On the MQINQ call, one or more selectors in the Selectors array is not applicable to the type of the queue whose attributes are being inquired.
This reason also occurs when the queue is a cluster queue that resolved to a remote instance of the queue. In this case only a subset of the attributes that are valid for local queues can be inquired. See the usage notes in Chapter 33, "MQINQ - Inquire about object attributes" for further details.
The call completes with MQCC_WARNING, with the attribute values for the inapplicable selectors set as follows:
For integer attributes, the corresponding elements of IntAttrs are set to MQIAV_NOT_APPLICABLE.
For character attributes, the appropriate parts of the CharAttrs string are set to a character string consisting entirely of asterisks (*).
Completion Code: MQCC_WARNING
Programmer Response: Verify that the selector specified is the one that was intended.
If the queue is a cluster queue, specifying one of the MQOO_BROWSE, MQOO_INPUT_*, or MQOO_SET options in addition to MQOO_INQUIRE forces the queue to resolve to the local instance of the queue. However, if there is no local instance of the queue the MQOPEN call fails.
|
_________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
salmanrs |
Posted: Tue Jul 02, 2002 11:30 am Post subject: |
|
|
Newbie
Joined: 13 Jun 2002 Posts: 6 Location: Michigan
|
The queue is a remote queue. The open option being MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE. What exactly are Selectors, how do I specify them. |
|
Back to top |
|
 |
mrlinux |
Posted: Tue Jul 02, 2002 11:48 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Q Remote Definitions dont have depth associated with them, so you cant get depth. _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
cvrachak |
Posted: Mon Nov 14, 2005 3:52 pm Post subject: How about for a cluster Queue, |
|
|
Novice
Joined: 06 Jul 2002 Posts: 17
|
I am having trouble getting the currentDepth of a Queue which is shared in a cluster. |
|
Back to top |
|
 |
bower5932 |
Posted: Mon Nov 14, 2005 4:54 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
The last append looks like a duplicate of your own append? |
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon Nov 14, 2005 7:59 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
You have to open it with the SET and INQUIRE options if it is a cluster queue if you want to get the depth. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
cvrachak |
Posted: Tue Nov 15, 2005 10:55 am Post subject: |
|
|
Novice
Joined: 06 Jul 2002 Posts: 17
|
unfortunately, it still gives an 2068 error. The moment I remove that share from Cluster, everything looks okay |
|
Back to top |
|
 |
wschutz |
Posted: Tue Nov 15, 2005 12:00 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Does it work if you specify both the ObjectName and ObjectQMgrName on the MQOPEN call for the mqinq when inquiring on a local clustered queue?
(this is the second time I'm recommending this ) _________________ -wayne |
|
Back to top |
|
 |
cvrachak |
Posted: Tue Nov 15, 2005 12:35 pm Post subject: |
|
|
Novice
Joined: 06 Jul 2002 Posts: 17
|
Hi Sorry forgot to respond back to your earlier post.
I am using C# api call which is AccessQueue(). It is available in amqdnet.dll delivered by IBM as part of MQ 5.3, so I am not specifically making any MQOPEN calls
Also the AccessQueue() call returns fine with a Queue Object, it is throwing 2068 only when I try to access CurrentDepth property on that object.
"CompCode: 1, Reason: 2068"
here is the call stack
at IBM.WMQ.MQBaseObject.throwNewMQException(Int32 compCode, Int32 reason)\r\n
at IBM.WMQ.MQManagedObject.Inquire(Int32[] selectors, Int32[] intAttrs, Byte[] charAttrs)\r\n
at IBM.WMQ.MQManagedObject.QueryAttribute(Int32 attributeType)\r\n
at IBM.WMQ.MQQueue.get_CurrentDepth()\r\n
at MyWinApp.Form1.test() in
c:\\users\\projects\\mysln\\mywinapp\\form1.cs:line 213
sorry If I missed anything which you are trying to say. |
|
Back to top |
|
 |
wschutz |
Posted: Tue Nov 15, 2005 12:46 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Yeah, the accessQueue methods allows you to set the ObjectQMgrName (its the third parameter: QueueManagerName$). Try it with the name of the qmgr you are connected to.....
 _________________ -wayne |
|
Back to top |
|
 |
cvrachak |
Posted: Tue Nov 15, 2005 1:12 pm Post subject: |
|
|
Novice
Joined: 06 Jul 2002 Posts: 17
|
below is the
public IBM.WMQ.MQQueue AccessQueue (
System.String queueName ,
System.Int32 openOptions ,
System.String queueManagerName ,
System.String dynamicQueueName ,
System.String alternateUserId )
if I give the third parameter, then I might have to give the 4 & 5th which I don't have
tried giving 4 & 5th params as blank with the 3rd param as QMgr Name, it still give 2068. |
|
Back to top |
|
 |
wschutz |
Posted: Tue Nov 15, 2005 4:26 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Can you paste your code here? _________________ -wayne |
|
Back to top |
|
 |
PeterPotkay |
Posted: Tue Nov 15, 2005 5:55 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
I've wrote bunches of little MQ monitoring apps in VB.NET, which uses amqmdnet.dll, and all you have to do is open the queue, without specifying a destination QM, and make sure you open it for INQUIRE AND SET. This eliminates the error when dealing with cluster queues.
Your not doing something silly like trying to get the depth of a Remote Queue Definition? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
wschutz |
Posted: Tue Nov 15, 2005 6:11 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Interesting Peter. It apeears either solution should do the job (ie MQOO_SET or specifying ObjectQMgrName) as I just tested both.
Of course, in a general sense, you might not authority for +SET.
I'd still like to see his code  _________________ -wayne |
|
Back to top |
|
 |
|