|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQDEAD problem |
« View previous topic :: View next topic » |
Author |
Message
|
Sandip |
Posted: Wed Nov 29, 2006 11:32 pm Post subject: MQDEAD problem |
|
|
Newbie
Joined: 29 Nov 2006 Posts: 2 Location: Pune
|
Hi Guys,
I have problem with MQDEAD messages. Actually in most of the cases My queue manager puts (if there is any problem with message) in System dead letter queue with format MQSTR. In code am checking for TextMessage so it works fine. But sometimes MQ puts the messages in dead letter queue with format MQDEAD. At that time code thorws CastException.
Now my question is
1: Can we avoid putting MQDEAD messages to dead letter queue. If yes, how?
2: how can handle all format types messages in JMS code. I mean frist check the message format and then convert it as per reqt.
Please help me in this regard.
Thanks in advance
Sandip |
|
Back to top |
|
 |
Vitor |
Posted: Thu Nov 30, 2006 1:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
There's no way to prevent the queue manager adding the dead letter header (Format MQDEAD) to messages it sends to the dead letter queue. This is functioning as designed and you should not want to override it - the header contains useful information about what went wrong to cause the message to end up there.
If there are messages in the dead letter queue with format MQSTR they're being added by an application program, probably using it as some kind of error queue. This should not be allowed - the queue manager dead letter queue has a specific use and specific tools that allow you to manipulate it. These rely on the DLH being present.
So to answer your questions:
1a) No, and you shouldn't. Find whatever's adding the string format messages and recode it to send them to a separate queue for analysis by your code.
1b) Anything the queue manager adds to the DLQ (MQDEAD) is a true undeliverable error which you should look at separately.
2) Do a search on the forum. MQDEAD is still a text message, it just has a header on the front you need to strip off & I recall this being discussed (I'm not a Java person).
Alternatively you could use the dead letter handler provided to redirect the messages to another queue(s) for investigation. This would strip the DLH off but I repeat it contains valuable diagnostic information.
Look it up - it's in the Application Programming Reference. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Sandip |
Posted: Thu Nov 30, 2006 4:11 am Post subject: BytesMessage |
|
|
Newbie
Joined: 29 Nov 2006 Posts: 2 Location: Pune
|
Hi Guys,
The message which I'm getting is of format MQDEAD which is not TextMessage, its BytesMessage. So its giving CastException. If it is BytesMessage, how can I read that using JMS?
Thanks
Sandip |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Nov 30, 2006 5:13 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You have to read it as a BytesMessage.
You should not be writing TextMessages into this queue.
You should probably not be using JMS to process this queue, in general.
If you aren't writing a Monitoring or Administration application, you should not be reading this queue, in general. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Nov 30, 2006 2:45 pm Post subject: Re: BytesMessage |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Sandip wrote: |
Hi Guys,
The message which I'm getting is of format MQDEAD which is not TextMessage, its BytesMessage. So its giving CastException. If it is BytesMessage, how can I read that using JMS?
Thanks
Sandip |
I do it all the time. Created a helper class for the DLH. It probably exists somewhere in the jars but I was trying to do some additional stuff.....
Read the x bytes of the DLH into the helper class from your BytesMessage...
However I do not read the content much because you will not get the automatic CCSID conversion. The DLH helper class will give me all the info I need (via getter and setter classes) to evaluate why the message landed on the DLQ. It even takes care (in a very rudamentary way) of the littleEndian, bigEndian problem...  _________________ MQ & Broker admin |
|
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
|
|
|
|