permaculture playing cards*
The moose likes EJB and other Java EE Technologies and the fly likes Dynamically Configuring MDB Message Selectors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Dynamically Configuring MDB Message Selectors" Watch "Dynamically Configuring MDB Message Selectors" New topic
Author

Dynamically Configuring MDB Message Selectors

John Pritchard
Ranch Hand

Joined: Nov 15, 2002
Posts: 49
Hello All-
I've got a system I am designing where a set of several JMS topics exist. Clients would like to subscribe to one or more of these topics anbd provide some filtering criteria as part of the subscription request. The MDB Message Selector semed like an alternative but it doesn't seem that it is dynamically configurable, e.g. specifying the selector at runtime. Any suggestions on a design solution that helps minimize traffic back to the client?
Thanks,
john


John Pritchard<br />If a JTree falls in the woods, is it Observable
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Unfortunately, message selectors are not dynamically configurable in a standard way. Some J2EE Servers might support this (I honestly don't know) but I wouldn't count on this functionality.
I really don't have enough context on the problem to suggest a good solution. However, if you really think you need this functionality then you could always create a MessageListener for each client and specify the message selector at creation time. Alternately you could set up some type of artificial filter code in your MDB which serves a similar purpose to message selector yet it is configurable at runtime. Again, I am not sure if either of those solutions fits your situation.
Probably, the best bet is to write back and explain your problem in greater detail and maybe one of us can come up with a better solution.
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
The only way to configure a message selector dynamically is to do so with a MessageListener, not an MDB. However, due to restrictions in the J2EE specification (which are not enforced by all vendors -- but should be) this will only work in an application container.
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
John Pritchard
Ranch Hand

Joined: Nov 15, 2002
Posts: 49
Thanks for the replies Chris and Kyle. I essentially have a vey large pub/sub architecture where various events are being published to a set of JMS Topics. Our clients would like to pull specific information (messages) off of the topics by using some filter criteria they specify at subscription time. I'm trying to define a mechanism where I can take a client's subscription request and filter criteria and have the filtering occur on the server side to minimize traffic back to the clients. Server side componenets would then asycnronously update the clients when a message did meet their filter criteria.
Appreciate the help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamically Configuring MDB Message Selectors
 
Similar Threads
Does the exam include the MDB deployment?
How to use JMS MESSAHE SELECTOR
Message Selectors in MDB
HF EJB page 617
How MDB works