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 Java / JMS » MQDEAD problem

Post new topic  Reply to topic
 MQDEAD problem « View previous topic :: View next topic » 
Author Message
Sandip
PostPosted: Wed Nov 29, 2006 11:32 pm    Post subject: MQDEAD problem Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu Nov 30, 2006 1:07 am    Post subject: Reply with quote

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
View user's profile Send private message
Sandip
PostPosted: Thu Nov 30, 2006 4:11 am    Post subject: BytesMessage Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Nov 30, 2006 5:13 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu Nov 30, 2006 2:45 pm    Post subject: Re: BytesMessage Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQDEAD problem
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.