• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMS Message Filtering

 
Sayed AI
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Pranav Shukla
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic