| Author | 
		  Message
		 | 
		
		  | JohnRodey | 
		  
		    
			  
				 Posted: Thu Jul 28, 2005 7:53 am    Post subject: Pure JMS question - QueueBrowser filtering based on range | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Thu Jul 28, 2005 8:23 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | JohnRodey | 
		  
		    
			  
				 Posted: Thu Jul 28, 2005 9:03 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Thu Jul 28, 2005 9:18 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | JohnRodey | 
		  
		    
			  
				 Posted: Thu Jul 28, 2005 11:35 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |