• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JMS Message Filtering

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You don't like waffles? Well, do you like this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic