Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Does anyone have a message filtering implementation?  RSS feed

 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello guys..
this is my problem:
A user can define as many properties as he wants: For example, for a car he can define:
model
color
type (sedan,..)
He can also specify values for it:
model > 1999
color = blue
type = sedan
Now, I have an application that publishes messages to a topic. So a publisher will do something like this:
model = 200 AND color = blue AND type = sedan
these rules fulfill the user's requirements, so the message should go this user. It is basically the concept of message selector in Java MEssage Service (JMS), and it is a subset of sql-92.
I need to implement this functionality for a different context (without using JMS) and I was wondering if someone here has any open source implementation of this message filtering, i don't wanna reinvent the wheel..
thanks
 
Peter Kristensson
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on what you wan't to do with it.
I once build something similar that parses a search string containing a=b AND c=d AND ... and inserts the results in a tree-like structure. The tree was then used to get results and combining these.
Is this what you want, to filter the stuff and then use it for searching?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!