File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes JMS Message Filtering Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JMS Message Filtering" Watch "JMS Message Filtering" New topic
Author

JMS Message Filtering

Sayed AI
Greenhorn

Joined: Mar 06, 2006
Posts: 1
Hi ALL,
I'm new to JMS.I've to implement JMS in my project.
I followed so many docs regarding Message Filteration but couldnt solve my problem.

Pls guide or suggest me to the sol.
Here 's my requirement:
---------------------
Sending a msg with client id and receiving the msg with that client id.Looks very simple.But the problem is where to use the filteration mechanism.I set the message msg.setStringProperty("User", user); and while receiving msg.getStringProperty(User);.It works aslo fine.If i proceed in this way to read a specific msg i've to scan all the messages in the queue.
what kind of messaging is best suitable here pls suggest and guide .My requirement is I dont need to scan all the messsages to get my required msg.
Thanx for early answer.
Regards
SayedAI
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9336
    
110

The requirement you state, can be met by using "Message Selectors". Have a look at:

http://www.onjava.com/pub/a/onjava/2003/01/29/ejbinherit4.html

http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Message.html


[My Blog] [JavaRanch Journal]
Pranav Shukla
Ranch Hand

Joined: Oct 05, 2005
Posts: 64
Hello,

You can specify the messageSelector while creating your QueueReceiver.

createReceiver

MessageSelector string is a SQL like query language where you specify the filtering criteria.


Pranav Shukla
SCJP, SCWCD, SCBCD
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JMS Message Filtering
 
Similar Threads
MDBs...help..urgent?
Problem with jms Message Selector
Problem with jms Message Selector
MDBs...help..urgent?
How to write a jms queue message to external file