Author |
Message
|
patryx |
Posted: Fri Aug 10, 2007 12:15 am Post subject: needed some samples connected with dead-letter queue... |
|
|
Novice
Joined: 07 Aug 2007 Posts: 12 Location: Poland
|
Hi!
Maybe someone created a program based on WebSphere Mq IBM where task was to generate a report in detail about messages in dead-letter queue and delete some / all of them and resend some / all of them. Also could be better if there will be oportunity to give easily parameters of work and configuration. My program should be based on C++/C in Unix/Linux. Maybe somebody could show me some codes which could h4elp me to do it? It's my first program connected with WebSpehere so that's why it would be nice to have some samples ot get help to complete my task. Unfortunataly I don't have sufficient number of samples/codes to do it all myself. Could somebody help me? _________________ Patryx |
|
Back to top |
|
 |
Mr Butcher |
Posted: Fri Aug 10, 2007 2:38 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
if you want to write mq programs and need samples, take the samples that come with mq. they show you e.g. how to put or get messages. google for more free program samples.
for your special dlq case - there is already a dlq handler available that comes with mq. this dlq performs actions on messages sitting in the dlq according to a rule table. check the system administration guide. _________________ Regards, Butcher |
|
Back to top |
|
 |
patryx |
Posted: Fri Aug 10, 2007 3:12 am Post subject: |
|
|
Novice
Joined: 07 Aug 2007 Posts: 12 Location: Poland
|
Problem is that I don't have any samples - they all were deleted unfortunately and I don't have chance to get them back so that's why I asked for them. Could you send me the samples (my WebSphere version is 5.3)?
When it comes to DQL handler - I think there is no use in considering it because I have to create a program in C/C++, not only give some commands in command line: runmqdlq...is there sth to use in C/C++? _________________ Patryx |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 10, 2007 3:36 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What do you mean, you don't have a chance to get them back?
The install media should be available, and you should be able to reinstall them.
If the install media is *not* available, then either you don't have a license for the product, or you don't have access/permission to download stuff from your entitlement.
In the second case... someone at your company does.
The DLQ is just another queue. The only thing that's different about it is the format of the messages.
There's a whole big section in the Application Programming Guide on what samples are included with the product.
The rest of the Application Programming Guide is dedicated to teaching you how the MQ API that is used by those samples work.
Happy Reading. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Nigelg |
Posted: Fri Aug 10, 2007 3:44 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
There is sample source code for a dead letter queue handler in the samp/dlq directory. _________________ MQSeries.net helps those who help themselves.. |
|
Back to top |
|
 |
patryx |
Posted: Fri Aug 10, 2007 5:50 am Post subject: |
|
|
Novice
Joined: 07 Aug 2007 Posts: 12 Location: Poland
|
Nigelg wrote: |
There is sample source code for a dead letter queue handler in the samp/dlq directory. |
As I wrote, I don;t have sample sources!
I can't reinstall the WebSphere because i don;t have enough permission to do it in the company and my boss is on holiday so that;s why I asked for the sample codes...could sb send me some?
Could sb tell me if in the same queue could be more than one message with the same messageId? or is it unique in the queue? Because I have to browse all messages in the queue and then some of them remove from the queue and I have no ideal how to do it (ho to recognise in the queue the message). If messageId should be always unique then i could use it to recognise the message but if not (i put some messages with the same messagedIds in local queue and the depth od queue was increased so that's why I donl;t know how does it work)?? Could sb explain me because I couldn't find the answe in the documentacion... _________________ Patryx |
|
Back to top |
|
 |
Vitor |
Posted: Fri Aug 10, 2007 8:38 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
patryx wrote: |
As I wrote, I don;t have sample sources!
I can't reinstall the WebSphere because i don;t have enough permission to do it in the company and my boss is on holiday so that;s why I asked for the sample codes...could sb send me some? |
And all the samples on the web (like the IBM site) and in this forum are of no help?
patryx wrote: |
Could sb tell me if in the same queue could be more than one message with the same messageId? or is it unique in the queue? ..... (i put some messages with the same messagedIds in local queue and the depth od queue was increased so that's why I donl;t know how does it work)?? Could sb explain me because I couldn't find the answe in the documentacion... |
MessageId is unique to a queue manager. Do not try and set it yourself, do not treat it as a string, read the Application Programming Guide more carefully and you'll find all this explained. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 10, 2007 9:02 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
MessageId is entirely set by the application that wrote the message.
You can not make any assumptions about a set of messages placed on a queue, if you do not know anything about the applications that wrote them.
Ergo, you can not assume that they have unique message ids, or that they don't all have the same MsgId. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
patryx |
Posted: Sun Aug 12, 2007 3:39 am Post subject: |
|
|
Novice
Joined: 07 Aug 2007 Posts: 12 Location: Poland
|
Vitor and jefflowrey -> you've different point of view about messageId...so who's right?
how can I put messages to the queue with other messageId? For example when I have ImqMessage msq and then I do msq.setMessageId() and write data and then put it to the queue, what should I do to have other messageId every time when I run program (containing this code)? Because every time the queue is making longer BUT messageId is still the same... _________________ Patryx |
|
Back to top |
|
 |
jefflowrey |
Posted: Sun Aug 12, 2007 4:23 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can read the Application Programming Guide and find out who's right for yourself.
It will also tell you the answer to your other question. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Sun Aug 12, 2007 4:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
We both are, though jefflowrey has perhaps been clearer in his posting.
I advised that you should not set or manipulate message id, and told you that a queue manager will always generate a unique message id, as explained in the APG.
But as jefflowrey correctly points out, you can't rely on the application following this advice and trying to set message id in spite of it. Hence while message id should be unique and in 99% of cases will be, it's not something which can be guaranteed except by knowledge of the application program.
I repeat my advice that you shouldn't be messing with it. But it's your requirement and you must do what you feel best. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
patryx |
Posted: Sun Aug 12, 2007 11:48 am Post subject: |
|
|
Novice
Joined: 07 Aug 2007 Posts: 12 Location: Poland
|
ok i understand. But how should I find the right message to delete after browsing all messages in the queue? just tell me how...? _________________ Patryx |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Aug 12, 2007 12:23 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
patryx wrote: |
ok i understand. But how should I find the right message to delete after browsing all messages in the queue? just tell me how...? |
What does the APG say about Get message under cursor??  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Vitor |
Posted: Sun Aug 12, 2007 12:34 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
patryx wrote: |
But how should I find the right message to delete after browsing all messages in the queue? just tell me how...? |
a) It depends what message you're trying to delete, which in turn depends on your requirements
b) If you're trying to remove messages from the system you've still not made it clear why you're not using the provided handler as previously indicated in this post? Don't reinvent the wheel
c) You're also not made it clear why you're browsing all the messages in the queue, then trying to delete them rather than deleting them as you go. Do you have message affinity issues? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
patryx |
Posted: Sun Aug 12, 2007 1:03 pm Post subject: |
|
|
Novice
Joined: 07 Aug 2007 Posts: 12 Location: Poland
|
I have to browse all messages in dead-letter queue and show information about it and in the program there should be an option to delete all of the messages or only some of them (after browsing I could choose which one/ones...)...
and I don't know how to browse all messages (how should it look like, which options of get to set etc) and the biggest problem how to find again in the dead-letter queue the messages which after browsing I decided to delete...?
Despite this, what's more I have to have an opportunity to try to resend some messages which I point... -> but firstly i would like to know how to resolve earlier problems which I asked you... _________________ Patryx |
|
Back to top |
|
 |
|