Author |
Message
|
yoman |
Posted: Thu Dec 20, 2012 1:58 am Post subject: Browsing messages with java without dowloading them |
|
|
Newbie
Joined: 13 Nov 2012 Posts: 9
|
Good day
I am trying to write simple automated monitoring tool. That connects to Queue Manager, it browses every queue for messages that are older than 5 minutes, and write their info to db.
My question is, can I get message info like messageId, Date and etc, without downloading it from the queue, to save bandwith? |
|
Back to top |
|
 |
zpat |
Posted: Thu Dec 20, 2012 2:09 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Why would you want to perform this?
You can issue a MQGET Browse with a zero length data buffer and it should still have the MQMD. You will get a message truncated return code which you can ignore.
If you are likely to access many messages, it would be advisable to run this tool either on the QM server, or on another server in the data center on the same high-speed network. |
|
Back to top |
|
 |
yoman |
Posted: Thu Dec 20, 2012 2:57 am Post subject: |
|
|
Newbie
Joined: 13 Nov 2012 Posts: 9
|
Could you please show how to do it in java ? I tried finding examples of in google or documentation, but without result. |
|
Back to top |
|
 |
zpat |
Posted: Thu Dec 20, 2012 3:27 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Specifying zero data length? On the MQGET you pass options, buffer and buffer length etc. Set the buffer length value to zero.
It's all in the IBM documentation. I can't possibly explain everything needed to code a MQ program in Java here.
Seems to me you need to re-think your requirement - what are you trying to achieve?
People new to MQ, who start to code their own admin/monitoring tools before looking at other options are usually wrong to do so. I haven't needed to code my own tools in over 15 years of working with MQ.
What are you trying to achieve exactly? Not literally "save the details in database", but to what end? |
|
Back to top |
|
 |
yoman |
Posted: Thu Dec 20, 2012 3:47 am Post subject: |
|
|
Newbie
Joined: 13 Nov 2012 Posts: 9
|
Thanks for you help. Found how to do it in java
Objective of this app, to gather data of queues that have messages for more time than they should, we can use gathered data for future reference |
|
Back to top |
|
 |
zpat |
Posted: Thu Dec 20, 2012 3:54 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
To what end?
If you have a problem with delays - is it not better to fix the problem? |
|
Back to top |
|
 |
yoman |
Posted: Thu Dec 20, 2012 4:09 am Post subject: |
|
|
Newbie
Joined: 13 Nov 2012 Posts: 9
|
Its for AIM team, that they can later get all info they need it to adress developers about problematic type of messages. Currently they use Mqmon tool for manual stuff, they wanted more automated tool. |
|
Back to top |
|
 |
zpat |
Posted: Thu Dec 20, 2012 4:47 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Seems all wrong to me.
Fix the problem(s) by understanding and addressing the root cause.
Alert in real-time if it happens again.
MO71 has a lot of features buried inside it, worth studying the documentation carefully.
Qflex is a free tool that can generate alerts.
If you start intensively browsing all the queues, you are more likely to cause problems than you are to solve them. |
|
Back to top |
|
 |
yoman |
Posted: Thu Dec 20, 2012 6:15 am Post subject: |
|
|
Newbie
Joined: 13 Nov 2012 Posts: 9
|
Asked for better wording from my team leader.
Ok, let’s say we have 100 QM in PROD and over 1500 integrations that are running there. (Multiple DCs)
Each next day some amount of messages are backed out and are handled by support personal.
Each next day there are deploys and changes of existing/new integrations.
When we see that some integration cause a lot of problem we fix the reason of that but looking for those BUGS manually takes a lot of time so we try to automatize this process. We need an application that will provide us info about the amount of stuck messages in the infrastructure let’s say for last two weeks/Month etc .
Do have some good advice how we can accomplish this task with tools that are FREE and available out from the box? Will Qflex able to do that? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Dec 20, 2012 6:25 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
No tool is completely free.
Even if it costs you nothing to acquire and install and run, it still costs you time and effort to download and configure and manage.
Pretty much all MQ monitoring tools - cost or not - give you the ability to define conditions that should be monitored for and raise an alert or respond via a script. |
|
Back to top |
|
 |
zpat |
Posted: Thu Dec 20, 2012 6:27 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
First of all - backed out messages will (or should) go to separate, dedicated error queues - these can be monitored for non-zero depth - there is no need to work out how old each message is.
Any message on these queues represents a problem, and generally requires intervention to deal with it.
Alerting when messages arrive on a predefined list of error queues, is about as basic a system management requirement as it's possible to have, and has been solved by numerous people over the years.
Yes, Qflex should be able to do this.
There are probably other free tools, but if you really have 100 QMs in prod - why don't you use one of the commercial tools?
Why would you want alerting two weeks later? Seems to me that this is still the wrong way to approach this problem.
You want to fix the problems and alert immediately on exceptions to it. Every message might represent a customer problem - I would be rather unhappy about waiting two weeks for someone to deal with these, if I was a customer.
If you're determined to code it yourself - look at using PCF messages to find out queue depth. |
|
Back to top |
|
 |
|