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 » Peek & Count????????

Post new topic  Reply to topic
 Peek & Count???????? « View previous topic :: View next topic » 
Author Message
HeadOffice
PostPosted: Thu Apr 10, 2008 9:45 am    Post subject: Peek & Count???????? Reply with quote

Newbie

Joined: 13 Mar 2008
Posts: 9

I'm relatively new to MQ but have built a client able to connect, write to, read from and disconnect MQ queues. This has been done in C#.NET.

My 2 questions are:

1. Can I "peek" at a message without removing it from a queue - and how?

2. Can I determine how many messages are on the queue - and how?

Using the amqmdnet dll I'm hoping the right flags/methods are exposed. Any ideas?

Many thanks in advance...
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Thu Apr 10, 2008 9:55 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

1) Yes. It's called "browse".

2) Yes, BUT. yes, you can do this. You never want to code a business application to use this, though. The only thing that has any business thinking about the queue depth is a monitoring/status application.

Read the queue until it's empty - you get back MQRC_NO_MSG_AVAILABLE.

You almost certainly don't want to browse the queue either. You likely want to use syncpoint.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
HeadOffice
PostPosted: Thu Apr 10, 2008 10:01 am    Post subject: Re: Peek & Count Reply with quote

Newbie

Joined: 13 Mar 2008
Posts: 9

I can't see "Browse" exposed as a method on the queue or queue manager classes. Any ideas where?

As for Counting - I'd just like to monitor how many messages on the queue.

Thanks for the advice - if you can point me in the direction of the browse I'd be eternally grateful.

Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Thu Apr 10, 2008 10:31 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Browse is an option, not a method.
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzav.doc/csq870f.htm

There are hundreds of better ways to monitor the depth of a queue than writing your own code to do it.

And, again, you never want to do this inside your business application.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Thu Apr 10, 2008 12:01 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

I know this will sound weird, but the # of messages that you can get can quite often be less than the q depth reports. Its an odd concept for new MQ people, but its been discussed a bunch of times here. Do a quick search for more info.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Apr 10, 2008 1:53 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9471
Location: US: west coast, almost. Otherwise, enroute.

A translation: current depth is the total number of messages in the queue. If some (or all) are not yet comitted, your app will not be able to mqget them.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
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 » Peek & Count????????
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.