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 » Pure JMS question - QueueBrowser filtering based on range

Post new topic  Reply to topic
 Pure JMS question - QueueBrowser filtering based on range « View previous topic :: View next topic » 
Author Message
JohnRodey
PostPosted: Thu Jul 28, 2005 7:53 am    Post subject: Pure JMS question - QueueBrowser filtering based on range Reply with quote

Centurion

Joined: 13 Apr 2005
Posts: 103

Does anyone know if there is a way to filter with a QueueBrowser using a range of priorities?

You can say something like QueueBrowser qb = qSession.createQueueBrowser(queue, "JMSPriority = 1");

Is there a way to get all, say 1-5 priority messages?

Just trying to find a way so I dont have to traverse the queue 5 times. Also didnt want to have to return all messages and have to go through the entire enumeration.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Jul 28, 2005 8:23 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If you tell the queue to return messages in priority order, then you can browse and stop when the priority of the message is less than what you want.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JohnRodey
PostPosted: Thu Jul 28, 2005 9:03 am    Post subject: Reply with quote

Centurion

Joined: 13 Apr 2005
Posts: 103

Thanks Jeff,

Figured that was the only way, thought maybe there would be a faster way.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Jul 28, 2005 9:18 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Using any JMS filters is slower than not using any.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JohnRodey
PostPosted: Thu Jul 28, 2005 11:35 am    Post subject: Reply with quote

Centurion

Joined: 13 Apr 2005
Posts: 103

Jeff thanks, you are right.

But just for completeness wanted to record that I did find a way to filter based on range.

QueueBrowser qb = qSession.createQueueBrowser(queue, "JMSPriority > 0 AND JMSPriority < 6");
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 » IBM MQ Java / JMS » Pure JMS question - QueueBrowser filtering based on range
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.