Author |
Message
|
langrand |
Posted: Tue Sep 04, 2007 1:59 am Post subject: read only the message in a Dead Letter |
|
|
Newbie
Joined: 31 Aug 2007 Posts: 7
|
Hi,
I would like to know how I can separate the MQDLH form the message.
If I do:
inMessage = qReceiver.receive(Integer.parseInt(waitReponse));
String messageLu = null;
int lgMessage = 0;
if (inMessage instanceof BytesMessage){
byte reponse[] = new byte[4096];
lgMessage = ((BytesMessage) inMessage).readBytes(reponse);
messageLu = new String(reponse);
messageLu = messageLu.substring(0, lgMessage);
}
In messageLu I've got MQDLH+MESSAGE.
I just whan the MESSAGE, could some one help me.
Best regards
Ludovic |
|
Back to top |
|
 |
Vitor |
Posted: Tue Sep 04, 2007 2:35 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Sep 04, 2007 2:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Remember it won't be the same. Now you could use MQ to strip the DLQ header and restore the old MQMD including format, then try post the message and read it again (due to get with convert...)
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
langrand |
Posted: Tue Sep 04, 2007 3:44 am Post subject: |
|
|
Newbie
Joined: 31 Aug 2007 Posts: 7
|
Hi,
but how can I convert a
javax.jms.BytesMessage to a MQ Message to skip the Header ?? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Sep 04, 2007 3:47 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The easiest way to ignore the DLH in JMS is to not use the DLQ in the first place, and thus ensure that you won't have to deal with messages with DLHs.
The easiest way to do this is to use a Backout Queue and backout processing to put "bad" messages on an application specific queue, rather than a system wide Dead Letter Queue (that is really only intended for messages that can't be delivered by the system). _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
langrand |
Posted: Tue Sep 04, 2007 4:38 am Post subject: |
|
|
Newbie
Joined: 31 Aug 2007 Posts: 7
|
thanks a lot,
I will definetly use a back OUT queue
Best Regard
Ludovic |
|
Back to top |
|
 |
|