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 » Swapping messages based on priority to a full queue

Post new topic  Reply to topic
 Swapping messages based on priority to a full queue « View previous topic :: View next topic » 
Author Message
JohnRodey
PostPosted: Mon May 16, 2005 1:01 pm    Post subject: Swapping messages based on priority to a full queue Reply with quote

Centurion

Joined: 13 Apr 2005
Posts: 103

If a queue is full and an application wishes to place a high priority message on the queue, is there a way to tell mq to trash a low priority message and put this message in place of it.

I would like to find way to do the deletion of the low priority message and the put of the high priority message simultaneously, because if I manually delete a message from the queue another request might come in to place a message on the queue (and be successful, since now there is an empty slot) prior to my message being posted.

Thanks for any help in advance
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon May 16, 2005 3:05 pm    Post subject: Reply with quote

Grand High Poobah

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

What is your message delivery option for the queue: priority or FIFO ??
Back to top
View user's profile Send private message Send e-mail
JohnRodey
PostPosted: Tue May 17, 2005 4:37 am    Post subject: Reply with quote

Centurion

Joined: 13 Apr 2005
Posts: 103

Priority
Back to top
View user's profile Send private message
JT
PostPosted: Tue May 17, 2005 6:25 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Quote:
If a queue is full and an application wishes to place a high priority message on the queue, is there a way to tell mq to trash a low priority message and put this message in place of it.

AFAIK, no.
Quote:
I would like to find way to do the deletion of the low priority message and the put of the high priority message simultaneously, because if I manually delete a message from the queue another request might come in to place a message on the queue (and be successful, since now there is an empty slot) prior to my message being posted

I'm not 100% sure, but wouldn't this work if you put the get and the put in the same unit of work, and then issued the MQCMIT?
Back to top
View user's profile Send private message
JohnRodey
PostPosted: Fri May 20, 2005 3:35 am    Post subject: Reply with quote

Centurion

Joined: 13 Apr 2005
Posts: 103

Thanks JT for your response.

I thought what you said made sense so I tried it. I issued a get and put prior to disconnecting from the manager (with a sleep between the get and put). I figured either 2 things could happen.

Since the "got" message could still be backed out to the Q I wasn't sure if it (1) remained on the Q and was just blocked from other applications trying to get messages or if (2) it was physically taken off the Q (leaving an empty spot) and if a backout was called then just placed back on Q in the empty spot.

if (1) was true then could the put find a spot on the queue to place its message? And if (2) then could any application fill that spot?

I tried it and it turns out 2 is true. When an application pulls these messages from the queue there is an empty spot created on the queue that any application can place a message on. So, even if prior to disconnecting from the QM (or committing) doing a get then a put, after a get there is a slice of time (granted a very small slice) in which other puts can come along and steal that open spot on the Q.

This now makes me wonder...
If you do a get on a poison message and have to backout that message but that queue could now be full since its spot could have been overwritten, it seems the backout would most likely fail. I haven't tried this scenario, but if that's true It doesn't seem like the desired fundtionality.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri May 20, 2005 4:05 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

JohnRodey wrote:
This now makes me wonder...
If you do a get on a poison message and have to backout that message but that queue could now be full since its spot could have been overwritten, it seems the backout would most likely fail. I haven't tried this scenario, but if that's true It doesn't seem like the desired fundtionality.


I would be surprised if the second put succeeded. Messages in transaction still count in queue depth - and probably for just this reason.

So if you have a queue that is 100% full, and you get a message in transaction, the queue depth will still be 100% - and so a put should fail.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JohnRodey
PostPosted: Fri May 20, 2005 11:05 am    Post subject: Reply with quote

Centurion

Joined: 13 Apr 2005
Posts: 103

I agree jeff and I thought that as well, although I tried this and it does seem to allow the put even though the get wasn't committed. Although it is always possible that I did something wrong in my test, so if anyone finds different results then I would be interested in hearing them.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Swapping messages based on priority to a full 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.