|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Simple VB API call to tell if a queue has messages on it? |
« View previous topic :: View next topic » |
Author |
Message
|
cavalcade |
Posted: Wed Nov 08, 2006 1:14 am Post subject: Simple VB API call to tell if a queue has messages on it? |
|
|
Newbie
Joined: 08 Nov 2006 Posts: 6
|
Hi,
My first post
I'm an MQ n00b... A bit of background, I have installed MQ 5.3 on 8 servers (4 pairs - Live, Test 1, Test 2 and DR) supporting an environment that allows our company to talk to a third party via IPT over our respective DMZ's (we have an outsourced arrangement, where data flows backwards and forwards over around 40 or so queues). It's been a hefty learning curve, but I've managed to gradually get my head around the basic building blocks of MQ. However, as with many MQ things, there is still much to learn!
So our infrastructure looks like:
[App Server] <--- MQ ---> [App Server 2] <--- MQ ---- IPT ---- MQ ---- > [Outsourced Company]
There are two sorts of data flow coming over the link between us and the outsource comnpany - one where the target application is agnostic over whether there are messages on the queue (it's a live flow), and another which is a big dump of data that comes in daily early morning and which the application reading off the queues has to fail itself if there isn't a message present. Currently this application will run and flag a success if there are messages on the queue or not.
The application is an extension on top of SQL Server (it's like a wrapper around DTS), so really any functionality that could be built in SQL Server, or VB.net (the programming language of choice here), would do the job.
As far as I can tell I need to make some sort of direct MQ API call (I've not done this before the application has this built in), - so if anyone could give me a steer as to what code I would need that would be helpful. I suppose I could find the MQ API programming guide, but I've got project managers shouting at me to get it fixed, and I'm finding it hard to get some thinknig time.... bloody project managers! The development team here (I'm more a DBA) also have no spare resource, so as much help as possible would be really great!
Sorry for seeming so n00b like, I'm sure as the years roll by maybe I'll be able to help people on the forum at a similar state of n00bishness to me  |
|
Back to top |
|
 |
Vitor |
Posted: Wed Nov 08, 2006 1:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
MQ supports .NET so there's all sorts of methods pre-supplied. These are documented in the .NET manual so I won't repeat them here!
You currently have an application which reads a queue and flags success no matter if it finds a message or not, yes? If what you're looking for is a separate application to check if there's something there before it starts (my interpretation of your problem only!!) then you need the same functionality but instead of the destructive read it currently does it should do a BROWSE FIRST. If it can browse at least one message then there's a message, if the browse fails the queue's empty.
Let me know if I've misunderstood your requirement.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Nov 08, 2006 1:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
P.S. Your other option would be to use PCF commands or some kind of scripting to issue a DISPLAY QUEUE command. One of the attributes of the queue is it's current depth.... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
zpat |
Posted: Wed Nov 08, 2006 2:03 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
You can inquire on depth using a MQINQ (one of the MQI verbs) call.
Normal applications should not need to use PCF. |
|
Back to top |
|
 |
cavalcade |
Posted: Wed Nov 08, 2006 2:28 am Post subject: |
|
|
Newbie
Joined: 08 Nov 2006 Posts: 6
|
Vitor wrote: |
MQ supports .NET so there's all sorts of methods pre-supplied. These are documented in the .NET manual so I won't repeat them here!
You currently have an application which reads a queue and flags success no matter if it finds a message or not, yes? If what you're looking for is a separate application to check if there's something there before it starts (my interpretation of your problem only!!) then you need the same functionality but instead of the destructive read it currently does it should do a BROWSE FIRST. If it can browse at least one message then there's a message, if the browse fails the queue's empty.
Let me know if I've misunderstood your requirement.  |
No, you seem to be right on the money. Thanks for your help - wasn't aware MQ had native .net support - I've found some decent stuff here that looks like it might give me a steer as I hack my way through trying to create a vb .net program!
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzav.doc/csqzav0525.htm
Cheers guys! |
|
Back to top |
|
 |
Vitor |
Posted: Wed Nov 08, 2006 2:32 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
That's the doc I was thinking of. You may need to refer to the Application Programming Reference (available on the same web location) for some of the options and structures, but .NET insulates you from a lot of that.
Happy Reading!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
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
|
|
|
|