ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » CurrentDepth()

Post new topic  Reply to topic Goto page 1, 2  Next
 CurrentDepth() « View previous topic :: View next topic » 
Author Message
salmanrs
PostPosted: Tue Jul 02, 2002 6:52 am    Post subject: CurrentDepth() Reply with quote

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
View user's profile Send private message
bduncan
PostPosted: Tue Jul 02, 2002 7:04 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
salmanrs
PostPosted: Tue Jul 02, 2002 11:30 am    Post subject: Reply with quote

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
View user's profile Send private message
mrlinux
PostPosted: Tue Jul 02, 2002 11:48 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
cvrachak
PostPosted: Mon Nov 14, 2005 3:52 pm    Post subject: How about for a cluster Queue, Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Mon Nov 14, 2005 4:54 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
PeterPotkay
PostPosted: Mon Nov 14, 2005 7:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
cvrachak
PostPosted: Tue Nov 15, 2005 10:55 am    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Tue Nov 15, 2005 12:00 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
cvrachak
PostPosted: Tue Nov 15, 2005 12:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Tue Nov 15, 2005 12:46 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
cvrachak
PostPosted: Tue Nov 15, 2005 1:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Tue Nov 15, 2005 4:26 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Can you paste your code here?
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
PeterPotkay
PostPosted: Tue Nov 15, 2005 5:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Tue Nov 15, 2005 6:11 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » CurrentDepth()
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.