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 » Counting messages as they arrive into a queue

Post new topic  Reply to topic
 Counting messages as they arrive into a queue « View previous topic :: View next topic » 
Author Message
themqstudent
PostPosted: Tue Dec 27, 2011 9:41 am    Post subject: Counting messages as they arrive into a queue Reply with quote

Novice

Joined: 26 May 2011
Posts: 22

Hello Team,

I was wondering if there is an easy way to count messages as the arrive to a queue.
I need to do it as they arrive because messages on my queues get consumed immediately as they arrive.

Also, there might be an mq log that contains the message count. I just don't know where to look for.

I have over 100 queues and I would like to know how many messages arrive and their frequency.

Thank you
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Dec 27, 2011 10:05 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

You might want to look at the queue manager's monitoring abilities. You should be able to do something with enqueue and dequeue.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
vmcgloin
PostPosted: Fri Dec 30, 2011 2:41 am    Post subject: Reply with quote

Knight

Joined: 04 Apr 2002
Posts: 560
Location: Scotland

Try queue statistics.

Which version of MQ are you using?
Back to top
View user's profile Send private message
themqstudent
PostPosted: Fri Dec 30, 2011 8:44 am    Post subject: Reply with quote

Novice

Joined: 26 May 2011
Posts: 22

This is my current WMQ Version

dspmqver
Name: WebSphere MQ
Version: 7.0.1.3
CMVC level: p701-103-100813
BuildType: IKAP - (Production)

Regards,
Back to top
View user's profile Send private message
themqstudent
PostPosted: Sat Dec 31, 2011 4:31 am    Post subject: Reply with quote

Novice

Joined: 26 May 2011
Posts: 22

There must be some kind of counter kept by the receiving server, maintained by the queue manager, which gets incremented as msgs arrive. I just can't find it!

Any help is greatly appreciated, as usual.

Thanks to everyone.
Back to top
View user's profile Send private message
Vitor
PostPosted: Sat Dec 31, 2011 6:27 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

themqstudent wrote:
There must be some kind of counter kept by the receiving server, maintained by the queue manager, which gets incremented as msgs arrive.


Why? What possible value does this information have for the queue manager that it would record it?

The only counter you might be able to use is the sequence number on the receiving channel which "counts" how many messages are received by that channel. It's not all the messages received by the queue manager if there's more than one channel, it gets reset to zero for a number of perfectly good reasons and isn't split down by target queue. You could obtain that information from the channel, but the amount & complexity of the code you'd need would dwarf the effort needed to obtain monitoring and statistics.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sat Dec 31, 2011 9:49 am    Post subject: Reply with quote

Poobah

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

Please be precise. What is the exact requirement?

Is it just a count of messages arriving in a specific queue? Multiple queues? All queues?

Will you next be asked to count the number of messages from a particular source (application, qmgr, user)?

Will you next be asked to count the number of reply messages?

Other than curiosity, what will this data be used for?
_________________
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
themqstudent
PostPosted: Sat Dec 31, 2011 3:15 pm    Post subject: Reply with quote

Novice

Joined: 26 May 2011
Posts: 22

Victor and Bruce,

Let me explain you what's going on:

We have a relatively small WMQ installation at the largest law enforcement agency in the country. They recently started using WMQ V7 and currently we have few dozens queues for production and test.
We have one server to which a number of clients send (PUT) messages. I created two queue managers, one for test and one for production.
Currently the server receives an estimated number of msgs between 50,000 to 500,000. Since the producers and consumers are spread all over we are having a hard time getting to know the exact number of messages.

Now, very soon, a large number of additional messages will start to flow into the server: All the 911 class (25,000 to 60,000 per day), hundred of thousands of msgs containing the license plate of all the cars the enter the city and another dozen of of the type of messages and possible files sent as messages. At the end of the day we expect at least two million msgs per day and probably around five millions.

Since we know the size of these messages I was asked if there is a way to actually count ALL the messages arriving at the server. This number is needed for planning purposes. All these msgs are persistent and management wants to know if for some reasons these msgs can't be consumed we need continue the down flow and have enough storage to keep the msgs until they can be consumed.
We also would like to know, based on the numbers, if we have to upgrade the hardware.

I hope this clarifies why I am looking to count msgs. Although it looks like there is no easy way to do that.

Thank you
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sat Dec 31, 2011 3:43 pm    Post subject: Reply with quote

Poobah

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

This solution has already been invented. Yours is not the first law-enforcement agency, or first large institution to implement WMQ. Your is not the first organization to capture statistics and accounting to monitor performance, and to do capacity planning.

Research IBM's Tivoli (Omegamon), and 3rd-party software products like TMON, and others.

Some providers advertise here. Look at the top of this page. Click when you see something relating to performance or monitoring.
_________________
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
themqstudent
PostPosted: Sat Dec 31, 2011 3:59 pm    Post subject: Reply with quote

Novice

Joined: 26 May 2011
Posts: 22

Bruce,

I know we are not the first or last to walk this path. I also know that those tools you mentioned and others can get the info I'm looking for. I just thought that perhaps I could write a simple program and get the info myself. Now I know that this is not as simple as I thought it would be.

Thank you for your time
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sat Dec 31, 2011 4:19 pm    Post subject: Reply with quote

Poobah

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

Many before you have blazed this trail. Some re-invented this wheel.

Most, like you, discovered that this is more complicated than it appears at first glance. Most things in IT are.

There is a performance monitoring forum here: http://www.mqseries.net/phpBB2/viewforum.php?f=14

Do a bit of testing. Enable queue statistics. Examine the results. Look at channel statistics.
_________________
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
themqstudent
PostPosted: Sun Jan 01, 2012 7:14 am    Post subject: Reply with quote

Novice

Joined: 26 May 2011
Posts: 22

Bruce,

All great suggestions the ones you are giving me. I will investigate them.

Thanks again
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jan 02, 2012 10:02 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

themqstudent wrote:
I hope this clarifies why I am looking to count msgs.


You're trying to monitor the queue manager to confirm correct operation and provide details for future planning. Both very reasonable things to do.

themqstudent wrote:
Although it looks like there is no easy way to do that.


If by "easy" you mean the single counter you can read with a single command then no.

But the queue manager has comprehensive monitoring as I've indicated earlier in this thread. This is what the rest of us are using for our versions of your fairly straightforward requirements. There are (as my associate correctly mentions) a number of tools which will give you this out of the box, with varying levels of graphs & predication. If they're giving more information than you need (or are more expensive than your budget), it's easy enough to roll your own app to pull what you need.

FWIW the message volumes you're talking about are not exceptional. Decent hardware & proper tuning easily handle them.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » Counting messages as they arrive into a queue
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.