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 » Backing out messages to DLQ, resulting in corrupted DLH

Post new topic  Reply to topic
 Backing out messages to DLQ, resulting in corrupted DLH « View previous topic :: View next topic » 
Author Message
moe
PostPosted: Thu May 14, 2009 5:14 pm    Post subject: Backing out messages to DLQ, resulting in corrupted DLH Reply with quote

Apprentice

Joined: 05 Sep 2006
Posts: 33
Location: Sydney, Australia

Platform: WMQ 6.0.2.3 on Solaris SPARC
JMS client using mq 6.0.2.3 jars.

A few months ago we ran into this bug when attempting to move backed out messages to the DLQ from a jms client.

http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg1IY99683

Supposedly this issue was fixed in fix pack 6023, we have applied fix pack 6023 and it seems the issue is still there.

To test, I wrote two applications, a publisher and a subscriber. They both use JMS interfaces to mq and lookup resources using the WMQInitialContextFactory class.

My test is as follows:

1 - Register subscription by starting subscriber, then quit without calling unsubscribe, leaving durable subscription intact.
2 - Run publisher and publish 5 messages, these are now queued.
3 - Run subscriber with CLIENT_ACKNOWLEDGE but dont acknowledge anything received, stop the subscriber without calling unsubscribe.
4 - Messages are rolled back on the queue, repeat step 3

At this point the messages have breached their backout threshold (set to 1) and have been moved to the dead letter queue, however the DLH is not there since I can see these errors in the qmgr error log:

AMQ8721: Dead-letter queue message not prefixed by a valid MQDLH.

What am i doing wrong?
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Thu May 14, 2009 6:27 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Set the BackoutQueue on your Input Queue and have the messages rolled back to an application specific BackoutQueue. You shouldn't be sending these to the system's DLQ.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
moe
PostPosted: Thu May 14, 2009 7:13 pm    Post subject: Reply with quote

Apprentice

Joined: 05 Sep 2006
Posts: 33
Location: Sydney, Australia

Sorry, I didnt mention that the backout queue was set directly to the SYSTEM.DEAD.LETTER.QUEUE.

I was hoping that this would result in the JMS client identifying it as the dead letter queue and building the appropriate header
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu May 14, 2009 11:46 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

moe wrote:
I was hoping that this would result in the JMS client identifying it as the dead letter queue and building the appropriate header


No, it doesn't. JMS just thinks it's a backout queue and moves the message there. Also SYSTEM.DEAD.LETTER.QUEUE has no attributes that would identify it as a dead letter queue to any application; it's the use the queue manager makes of it that makes it a DLQ.

As my associate points out, the dead letter queue has a specific use in WMQ and you shouldn't use it for application problems. IMHO it's easier to define a local queue DEAD.LETTER so it's not hidden in the system objects, but that's a side point.

You could do what you're doing but you'd need to build the DLH in your code. It would remain a non-standard use of the DLQ though, and not best practice. Define a new local queue for backout and roll the messages there.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
zpat
PostPosted: Fri May 15, 2009 12:27 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

It's often a good idea to add a DLH for any backed out messages and assign a reason code (outside the IBM range) so that your support people have a clue why it's there.

They will need a means to remove the DLH when re-queueing - and a number of IBM utilities can do this.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri May 15, 2009 12:37 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

zpat wrote:
It's often a good idea to add a DLH for any backed out messages




But (just to be clear) implementing this good idea requires a DLH to be built because the system won't, and the messages so enhanced shouldn't be put on the queue manager's DLQ.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
moe
PostPosted: Fri May 15, 2009 12:43 am    Post subject: Reply with quote

Apprentice

Joined: 05 Sep 2006
Posts: 33
Location: Sydney, Australia

Putting aside the argument of whether or not an application should put messages to the dead letter queue.

I'm of the thought that since jms hides the process of checking the redelivery count on a message and then goes to the trouble of moving it to a backout queue without me needing to do anything further then there is no real reason why ibm's jms implementation cant put a dead letter header on it in the process.

I understand that to the queue manager SYSTEM.DEAD.LETTER.QUEUE is just a regular queue so there is no way of distinguishing it as a special queue other than its name but in all honesty, has anybody ever called their application's queue SYSTEM.DEAD.LETTER.QUEUE and the REAL qmgr dlq something else?

Just my 2c
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri May 15, 2009 12:50 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

moe wrote:
in all honesty, has anybody ever called their application's queue SYSTEM.DEAD.LETTER.QUEUE and the REAL qmgr dlq something else?


Well I never use SYSTEM.DEAD.LETTER.QUEUE as the actual dlq defined to the queue manager.

And don't forget JMS is (as the name suggests) a standard. The standard doesn't say anything about extra headers on backed out messages so far as I know (which as regular readers will know is not all that far). So this ability would be another of the infamous "IBM extensions" to a standard and make any Java so written non-standard & non-portable.

I know this site doesn't use DLH for any of the backed out messages in Java.

Again, just my point of view.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
moe
PostPosted: Fri May 15, 2009 12:54 am    Post subject: Reply with quote

Apprentice

Joined: 05 Sep 2006
Posts: 33
Location: Sydney, Australia

Meh, ill work around it
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri May 15, 2009 1:19 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

moe wrote:
Meh, ill work around it


Frankly you've no realistic option. Even if we all signed up to an enhancement request, and IBM said "Gosh, yes, the JMS code should do that" it's unlikely their solution would arrive in a timeframe useful to your development.

Don't forget that, as a license paying customer, you do have a perfect right to request such an enhancement. No immediate help as I indicated above, but you'd gain the satisfaction of making the world a better place for future generations of JMS developers.

Cold comfort while you're building code to add a DLH I know.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri May 15, 2009 1:07 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

moe wrote:

I'm of the thought that since jms hides the process of checking the redelivery count on a message and then goes to the trouble of moving it to a backout queue without me needing to do anything further then there is no real reason why ibm's jms implementation cant put a dead letter header on it in the process.


Again check the manuals including WAS

It is stated clearly that JMS will follow this pattern: (from memory)
Quote:
If there is a bothresh on the queue the JMS consumer will attempt to put the message to the boqueue after the bothresh has been reached. IF NO BOQUEUE is defined the message will be put the DLQ (with reason code 2362 (X'093A')
MQRC_BACKOUT_THRESHOLD_REACHED)


This did not tell you to put the DLQ into the BOQUEUE . It told you to not define a BOQUEUE (leave blank) but define a BOTHRESH.

So read your manuals and verify what you do!
_________________
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 » Backing out messages to DLQ, resulting in corrupted DLH
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.