Regarding JMS 2004-07-05 - By Binildas C. A.
Back Answers to Query: 1. Referr to http://java.sun.com/blueprints/corej2eepatterns/ You will definitely find ServiceActivator pattern.
2. Drawbacks ! If we use MDB in scenarios where it is inappropriate, we would face drawbacks. But that can be evaluated only on a case-by-case basis.
3. TX - You can (with restrictions). But you need to check with the JMS provider documentation, backing your MDB. Especially if it is a foreign JMS provider, you need to check if you can propogate JMS transaction from within your App Server to the foreign JMS provider. Single vendor solution portfolio (like IBM WAS + MQ) would ususlly facilitate such TX propogation, but in Mix-N-Max cases, we need to either follow vendor prescribed procedures, or use workarounds.
A cleaner approach is to use MDB just as an Activator, and put all Business Logic inside Stateless Session EJB. MDB in turn can delegate work to Session EJB. Also, MDB is a listener, without any active clients, while Session EJBs are not passive listeners, but needs to explicitely called by clients.
4. It depends upon your configuration settings. If the Queue is persistant and if the onMessage() is in Transaction, a System Exception should re-try with another instance of MDB (again depending upon Max. Number of tries configured) - But, we need to look into vendor specific documentation, for such QoS concerns.
Binildas Sr. Tech.Architect (http://www.infosys.com/setlabs)
-- -- Original Message -- -- From: "Kamaraj, Pushparaj" <Pushparaj_Kamaraj@(protected)> To: <J2EEPATTERNS-INTEREST@(protected)> Sent: Sunday, July 04, 2004 6:08 PM Subject: Regarding JMS
> Hi, > We are using weblogic JMS Queue and MDB in our system. I am having > some questions on the same > 1) Is there any pattern available for using message beans. > > 2) Where can I get the details about drawbacks of using MDB. > > 3) Can I use MDB as a normal stateless session bean including > database transaction. > > 4) If any exception happens can the message will be retained so that > it will be served next time > > > Thanks > K.Pushparaj. > > __ ____ ____ ____ ____ ____ ____ ____ ______ > Confidential: This electronic message and all contents contain information > from Syntel, Inc. which may be privileged, confidential or otherwise > protected from disclosure. The information is intended to be for the > addressee only. If you are not the addressee, any disclosure, copy, > distribution or use of the contents of this message is prohibited. If you > have received this electronic message in error, please notify the sender > immediately and destroy the original message and all copies. > > ==================================================================== > Companion Site: http://www.corej2eepatterns.com > J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns > List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html > Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected) >
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|