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 » how to use MQINQ in vb.net

Post new topic  Reply to topic
 how to use MQINQ in vb.net « View previous topic :: View next topic » 
Author Message
cliao
PostPosted: Fri Sep 10, 2004 5:23 am    Post subject: how to use MQINQ in vb.net Reply with quote

Novice

Joined: 08 Sep 2004
Posts: 23

This is the code I have, the error message I got is wrong selector, but I am not sure what's wrong with it.

/**************************************************/
Dim mqQMgr As MQQueueManager '* MQQueueManager instance
Dim mqQueue As MQQueue '* MQQueue instance
Dim queueName As String '* Name of queue to use
Dim qMgrName As String '* Name of Q Mgr to use
Dim strInput As Array
Dim lSelector As Integer()
Dim cCharByte() As Byte

cCharByte = New Byte() {1}

lSelector = New Integer() {MQC.MQIA_CURRENT_Q_DEPTH}

System.Console.WriteLine("Sample VMQSGET start")
If (CmdArgs.Length = 0) Then
System.Console.WriteLine("Required parameter missing - queue name")
Return (99)
Else
strInput = Split(CmdArgs.GetValue(0), "/")
queueName = strInput(1)
qMgrName = strInput(0)
End If

'*
'* Try to create an MQQueueManager instance
'*
Try
mqQMgr = New MQQueueManager(qMgrName)
Catch mqe As IBM.WMQ.MQException
'* stop if failed
System.Console.WriteLine("create of MQQueueManager ended with {0}", mqe.Message)
Return (mqe.Reason)
End Try


'*
'* Try to open the queue
'*
Try
mqQueue = mqQMgr.AccessQueue(queueName, MQC.MQOO_INQUIRE + MQC.MQOO_BROWSE + MQC.MQOO_FAIL_IF_QUIESCING) '* open queue for input but not if MQM stopping
mqQMgr.Inquire(lSelector, lSelector, cCharByte)
System.Console.WriteLine(lSelector(0))
Catch mqe As IBM.WMQ.MQException
'* stop if failed
System.Console.WriteLine("MQQueueManager::AccessQueue ended with {0}", mqe.Message)
Return (mqe.Reason)
End Try
/*********************************************************/

Please help.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Sep 10, 2004 6:52 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I haven't done a lot with MQINQ.

Should you be calling Inquire on the Queue Manager, or the Queue?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kevinf2349
PostPosted: Fri Sep 10, 2004 7:14 am    Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

IIRC you have to issue a PCF command giving the qname, qtype and then the count of selectors and then the selectors themselves I think.

There is a pretty good manual called "Using .NET" that has some good examples in it (Manual # GC34-6328-02). Additionally there is a good redbook called "WebSphere MQ Solutions in a Microsoft .NET Environment" between these two I managed to get things clearer in my own mind.....and I was a .NET newbie so they must be good
Back to top
View user's profile Send private message
cliao
PostPosted: Fri Sep 10, 2004 7:29 am    Post subject: Reply with quote

Novice

Joined: 08 Sep 2004
Posts: 23

Thank you for your inputs. I got it to work now. you are right, I should have that on the Queue, not the queue manager.

Thanks for the help.

Lei
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » how to use MQINQ in vb.net
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.