This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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
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.
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
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.