|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
how to use MQINQ in vb.net |
« View previous topic :: View next topic » |
Author |
Message
|
cliao |
Posted: Fri Sep 10, 2004 5:23 am Post subject: how to use MQINQ in vb.net |
|
|
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 |
|
 |
jefflowrey |
Posted: Fri Sep 10, 2004 6:52 am Post subject: |
|
|
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 |
|
 |
kevinf2349 |
Posted: Fri Sep 10, 2004 7:14 am Post subject: |
|
|
 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 |
|
 |
cliao |
Posted: Fri Sep 10, 2004 7:29 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
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
|
|
|
|