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 » General IBM MQ Support » Removing uncommitted messages from a Queue.

Post new topic  Reply to topic Goto page 1, 2  Next
 Removing uncommitted messages from a Queue. « View previous topic :: View next topic » 
Author Message
T4ss1nf
PostPosted: Tue May 12, 2009 6:34 am    Post subject: Removing uncommitted messages from a Queue. Reply with quote

Newbie

Joined: 30 Sep 2008
Posts: 6

We have a queue with the Following Status:

AMQ8450: Display queue status details.
QUEUE(Q.xxxxxxxxxxxxxxxxx) TYPE(QUEUE)
CURDEPTH(0) IPPROCS(22)
LGETDATE(2009-05-12) LGETTIME(16.12.15)
LPUTDATE(2009-05-12) LPUTTIME(16.12.15)
MONQ(LOW) MSGAGE(5567240)
OPPROCS(0) QTIME(23788, 65424)
UNCOM(YES)

My assumption is that we have an uncommitted message for 64 days.
I checked for the oldest connection on our QManager but none of them is that old.
I tried to get the content of the q file and found that indeed we have a message having some date and time tags that perfectly fit to the message age.
I don't want to restart the QManager as it is used by business critical applications.

Does anyone have an idea on how I can remove this outdated message from the Queue?

Regards,
F
Back to top
View user's profile Send private message
zpat
PostPosted: Tue May 12, 2009 6:41 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

One of the applications has performed a MQGET and not commited it and is keeping the connection open. This is a program logic error.

If you stop that application then it will force the message to be either rolled back or removed from the queue.

It will most likely happen again unless you fix the application logic.
Back to top
View user's profile Send private message
T4ss1nf
PostPosted: Tue May 12, 2009 7:05 am    Post subject: Reply with quote

Newbie

Joined: 30 Sep 2008
Posts: 6

Only one application puts messages on this Queue and only one is reading message from it.

Unfortunately for us, this application has been stopped a few times these 64 last days and this message is still present where it should have gone.

Another question: Could it be that the sending application has performed a MQPUT and has not commited it?
Back to top
View user's profile Send private message
zpat
PostPosted: Tue May 12, 2009 7:23 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Your status display shows that 22 threads have the queue open for input and 0 for output.

Therefore it is a uncommitted MQGET.

If the application is stopped, ie disconnected, MQ will either commit or remove the message.

Therefore a uncommitted message means that unit of work is still active which usually means the application has not disconnected or stopped.

Look at the queue handle usage to work out which one it is.
Back to top
View user's profile Send private message
aditya.aggarwal
PostPosted: Tue May 12, 2009 7:42 am    Post subject: Reply with quote

Master

Joined: 13 Jan 2009
Posts: 252

Agree with Zpat..it is the application code issue.

Application should issue Commit after consuming the message from the queue.

Best Regards,
Aditya A
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue May 12, 2009 8:37 pm    Post subject: Reply with quote

Grand High Poobah

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

You may also look at the manuals for the dspmqtrn command, do a search on ghost messages and remind us which XA transaction manager(s) you are using
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
sumit
PostPosted: Wed May 13, 2009 1:34 am    Post subject: Reply with quote

Partisan

Joined: 19 Jan 2006
Posts: 398

use this command:
dis qs(qname) type(handle)

and find out the list of those 22 app. which are holding the queue. All should point to 1 application. And if that's the case, then modify your application so that it will close the queue connection handle properly before quiting.
_________________
Regards
Sumit
Back to top
View user's profile Send private message Yahoo Messenger
bruce2359
PostPosted: Wed May 13, 2009 7:03 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Quote:
QUEUE(Q.xxxxxxxxxxxxxxxxx) TYPE(QUEUE)
CURDEPTH(0) IPPROCS(22)
LGETDATE(2009-05-12) LGETTIME(16.12.15)
LPUTDATE(2009-05-12) LPUTTIME(16.12.15)
MONQ(LOW) MSGAGE(5567240)
OPPROCS(0) QTIME(23788, 65424)
UNCOM(YES)

I am troubled by the apparent inconsistency of curdepth(0) and uncom(yes).
Any messages in the queue inside or outside a UofW would have depth greater than zero.

I'm wondering if the queue object is damaged.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed May 13, 2009 8:31 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

The queue is probbaly fine.

Do a put under syncpoint and the uncommitted message will contribute to Q depth. MQBACK and the depth will go back down.

Do a get under syncpoint and the uncommitted message will drop from the queue depth. MQBACK and the depth will go back up.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed May 13, 2009 8:53 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

From MQSC manual:
CURDEPTH
The current depth of the queue, that is, the number of messages on the
queue. This includes both committed messages and uncommitted
messages.

_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed May 13, 2009 9:06 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

I just tested this. MQ 6.0.2.4. MQ Client app running on my laptop connecting to the QM on my laptop. Put a committed message to the queue, depth = 1.

Fire up my VB.net app and step thru the code. Right after the MQGET with syncpoint, the IPROCS equals 1, the depth equals zero. Kill the debug session which rollsback the message and the depth goes back to 1.

_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed May 13, 2009 9:13 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Whoa! PMR time.

Anyone from Hursley care to offer some insight?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
bbburson
PostPosted: Wed May 13, 2009 1:49 pm    Post subject: Reply with quote

Partisan

Joined: 06 Jan 2004
Posts: 378
Location: Nowhere near a queue manager

bruce2359 wrote:
From MQSC manual:
CURDEPTH
The current depth of the queue, that is, the number of messages on the
queue. This includes both committed messages and uncommitted
messages.


We had a situation awhile back where a queue kept having more than MAXDEPTH number of messages on it. It took some time to figure out what was happening: an app was doing lots of gets without committing and eventually failing. The rolled-back messages plus the other messages on the queue pushed it right past the limit without batting an eye.
Back to top
View user's profile Send private message
sumit
PostPosted: Thu May 14, 2009 8:56 am    Post subject: Reply with quote

Partisan

Joined: 19 Jan 2006
Posts: 398

bruce2359 wrote:
CURDEPTH
The current depth of the queue, that is, the number of messages on the
queue. This includes both committed messages and uncommitted
messages.


What we have seen often is, xmitq displays 0 curdepth with UNCOM(YES) and the svr channel in retry mode. Did a resolve channel backout, and messages are back in the queue.

Surprised to see if message stays in q and only a copy is send to destination qmgr and this original msg is not discarded until the copy of msg is reached properly to end site q then how come msg count of xmitq is not correct. Is this anyway related to the maximum uncommitted messages capacity of qmgr?
_________________
Regards
Sumit
Back to top
View user's profile Send private message Yahoo Messenger
bruce2359
PostPosted: Thu May 14, 2009 9:07 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Found this searching Mr. Google for hursley+curdepth: http://hursleyonwmq.wordpress.com/2007/02/06/what-messages-are-included-in-curdepth/

What messages are included in CURDEPTH?

February 6, 2007 in webspheremq | by Russell Finn

If you have trouble remembering what messages are included and excluded from the CurrentQDepth of a queue, the easy way to remember is that we expect all units of work to commit. So it goes down as soon as you do an MQGET, and it goes up as soon as you do an MQPUT.

The CurrentQDepth documentation in the Application Programming Reference does describe this but to my mind it reads like a set of rules to be learned. I remember things much better when given a model that I can understand.

CurrentQDepth is the number of messages currently on the queue. It is incremented during an MQPUT call, and during backout of an MQGET call. It is decremented during a nonbrowse MQGET call, and during backout of an MQPUT call. The effect of this is that the count includes messages that have been put on the queue within a unit of work, but that have not yet been committed, even though they are not eligible to be retrieved by the MQGET call. Similarly, it excludes messages that have been retrieved within a unit of work using the MQGET call, but that have yet to be committed.

The count also includes messages that have passed their expiry time but have not yet been discarded, although these messages are not eligible to be retrieved. See MQMD Expiry for more information.

Unit-of-work processing and the segmentation of messages can both cause CurrentQDepth to exceed MaxQDepth. However, this does not affect the retrievability of the messages; all messages on the queue can be retrieved using the MQGET call in the normal way.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » General IBM MQ Support » Removing uncommitted messages from a Queue.
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.