Michael Strasser
|
Posted: August 03, 2010 23:26 by Michael Strasser
|
|
Adam, I am really enjoying your book and am starting to use the patterns in modernising our Java app here. We are implementing an events framework internal to the app that uses a JMS topic. My initial design for dispatching messages was to have a single MDB that subscribes to all event messages, which then uses a factory to generate an implementation of an action class according to the message contents. But doing that makes it difficult to use EJBs as action classes (you have sold me on the value of stateless session beans!) so I have changed the design to use a different MDB for each action. In the new design, each MDB specifies a JMS message selector when it subscribes to the topic and it has its own action class (EJB) injected into it. (Obviously the JMS properties need to include enough information for the message selector to discriminate between messages.) Does that sound like a good design? Are MDBs as inexpensive to use as session beans in Java EE 5? Thanks in advance for any advice! |
JMS message selectors and message dispatch
Replies: 1 - Last Post: August 04, 2010 16:07
by: abien
by: abien
showing 1 - 2 of 2
abien
|
Posted: August 04, 2010 16:07 by abien
|
The quality of the EJB implementation is highly container dependent. The overhead, however, is pretty low in general. Just think of MDS / Stateless session beans, as POJOs decorated with aspects. I guess in the MDB case the overhead is a few (<10) local method calls. Just throw a RuntimeException and look at the StackTrace .In case you MDBs have clear defined single responsibility and are properly named - I would appreciate your choice. The routing algorithms shouldn't be also good maintainable / testable. |
Replies: 1 - Last Post: August 04, 2010 16:07
by: abien
by: abien


.




