Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Regarding JMS

Regarding JMS

2004-07-06       - By Michael Marson

 Back
Reply:     1     2     3     4  


With respect to the answer to #4 below,  I respectfully disagree that
the answer is "No".  It is true that there is no standard "client" as
such, but an MDB can participate in a transaction, and if the
transaction is rolled back the message will be retained on the queue for
redelivery, if configured as such.  I believe this is part of the JMS
spec not a vendor-specific extension (we are using Weblogic 8.1), but we
are relying on the transactional nature of JMS, and the ability to have
multiple redelivery attempts, heavily in the project I am currently
working on.  WLS also has error destinations where you can place
"failed" messages, so that you never truly discard messages, unless you
choose to.  Again, I am not sure if this is part of the spec or
vendor-specific, so other servers may offer comparable functionality.

Hard-won side note on MDB drawbacks: if your MDB does any type of db
work (such as save message content to a database), you need to use an XA
transaction because a JMS provider is always its own resource manager,
even if the JMS store is a (the same) database.


-- --Original Message-- --
From: ashraf galal [mailto:ashrafwg@(protected)]
Sent: Sunday, July 04, 2004 5:33 PM
Subject: Re: Regarding JMS



K.Pushparaj wrote:
       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.
         &nbs

p; The implementation of MDB  uses some sort of the observer pattern
       2) Where can I get the details about drawbacks of using MDB.
           J2EE specification (section 17 of EJB 2.0 specification ) or
any J2EE book,
I recommend the expert one by one by Rod Johnson
       3) Can I use MDB as a normal stateless session bean including
database transaction.
              MDB does not have either a home interface nor remote
interface, so it is not visible
to the client, Whereas the session beans are. MDB is a message
consumers,
it does not have a client view.
Transaction in MDB have to be committed before the OnMessage() method
returns.
I don't think that possible since that means the instances of a message
driven bean
are equivalent.

       4) If any exception happens can the message will be retained so
that
it will be served next time


MDB can throw system exception upon which the container discards the
bean instance.
However, the exceptions are not propagated to the client, since there
are no clients.
So, MDB cannot throw application exception. The answer is No.
Ashraf Galal




====================================================================
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)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o =
"urn:schemas-microsoft-com:office:office"><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=969450805-06072004><FONT face=Arial color=#0000ff size=2>With
respect to the answer to #4 below, &nbsp;I respectfully disagree that the
answer
is "No".&nbsp; It is true that there is no standard "client" as such, but an
MDB
can participate in a transaction, and if the transaction is rolled back the
message&nbsp;will be retained on the queue for redelivery, if configured as
such.&nbsp; I believe this is part of the JMS spec&nbsp;not&nbsp;a
vendor-specific extension (we are using Weblogic 8.1), but we are relying on
the
transactional nature of JMS, and the ability to have multiple redelivery
attempts, heavily in the project I am currently working on.&nbsp; WLS also has
error destinations where you can place "failed" messages, so that you never
truly discard messages, unless you choose to.&nbsp; Again, I am not sure if
this
is part of the spec or vendor-specific, so other servers may offer comparable
functionality.</FONT></SPAN></DIV>
<DIV><SPAN class=969450805-06072004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=969450805-06072004><FONT face=Arial color=#0000ff
size=2>Hard-won side note on MDB drawbacks: if your MDB does any type of db
work
(such as save message content to a database), you&nbsp;need to&nbsp;use an XA
transaction because a JMS provider is always its own resource manager, even if
the JMS store is a (the same)&nbsp;database. </FONT></SPAN></DIV>
<DIV><SPAN class=969450805-06072004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=969450805-06072004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><FONT face=Tahoma size=2>-- --Original Message-- --<BR><B>From:</B> ashraf
galal [mailto:ashrafwg@(protected)] <BR><B>Sent:</B> Sunday, July 04, 2004 5:33
PM<BR><B>Subject:</B> Re: Regarding JMS<BR><BR></FONT></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
 <DIV><PRE><SPAN style="COLOR: black"><FONT size=2><FONT face="Arial Unicode
MS">K.Pushparaj wrote:<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style=
"COLOR: black"><FONT size=2><FONT face="Arial Unicode MS">&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; We are using weblogic JMS Queue and MDB in our system.
I am having<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="COLOR: black
"><FONT size=2><FONT face="Arial Unicode MS">some questions on the same<o:p></o
:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="COLOR: black"><FONT size=2><FONT
face="Arial Unicode MS">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1) Is there
any pattern available for using message beans.<o:p></o:p></FONT></FONT></SPAN><
/PRE><PRE><FONT size=2><FONT face="Arial Unicode MS"><SPAN style="COLOR: black">
<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&amp;nbs
p; </SPAN></SPAN><SPAN style="COLOR: blue">The implementation of MDB</SPAN>
<SPAN style="COLOR: black"> </SPAN><SPAN style="COLOR: blue"><SPAN style="mso
-spacerun: yes">&nbsp;</SPAN>uses some sort of the observer pattern<o:p></o:p><
/SPAN></FONT></FONT></PRE><PRE><SPAN style="COLOR: black"><FONT size=2><FONT
face="Arial Unicode MS">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2) Where can
I get the details about drawbacks of using MDB.<o:p></o:p></FONT></FONT></SPAN>
</PRE><PRE><SPAN style="COLOR: blue"><FONT size=2><FONT face="Arial Unicode MS">
<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; </SPAN>J2EE specification (section 17 of EJB 2.0
specification ) or any J2EE book, </FONT></FONT></SPAN></PRE><PRE><SPAN style=
"COLOR: blue"><FONT size=2><FONT face="Arial Unicode MS">I recommend the expert
one by one by Rod Johnson<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style
="COLOR: black"><FONT size=2><FONT face="Arial Unicode MS&#13;&#10; ">&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3) Can I use MDB as a normal stateless
session bean including<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style=
"COLOR: black"><FONT size=2><FONT face="Arial Unicode MS">database transaction.
<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><FONT size=2><FONT face="Arial
Unicode MS"><SPAN style="COLOR: black"><SPAN style="mso-tab-count: 1">&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <
/SPAN></SPAN><SPAN style="COLOR: blue">MDB does not have either a home interface
nor remote interface, so it is not visible </SPAN></FONT></FONT></PRE><PRE>
<FONT size=2><FONT face="Arial Unicode MS"><SPAN style="COLOR: blue">to the
client, Whereas the session beans are. MDB is a message consumers, </SPAN><
/FONT></FONT></PRE><PRE><FONT size=2><FONT face="Arial Unicode MS"><SPAN style=
"COLOR: blue">it does not have a client view. </SPAN></FONT></FONT></PRE><PRE>
<FONT size=2><FONT face="Arial Unicode MS"><SPAN style="COLOR: blue">Transaction
in MDB have to be committed before the OnMessage() method returns. </SPAN><
/FONT></FONT></PRE><PRE><FONT size=2><FONT face="Arial Unicode MS"><SPAN style=
"COLOR: blue">I don&#8217;t think that possible since that means the instances
of a message driven bean </SPAN></FONT></FONT></PRE><PRE><FONT size=2><FONT
face="Arial Unicode MS"><SPAN style="COLOR: blue">are equivalent. <SPAN style=
"mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></SPAN></FONT></FONT></PRE><PRE>
<SPAN style="COLOR: black"><FONT size=2><FONT face="Arial Unicode MS"><SPAN
style="mso-spacerun: yes">&nbsp;</SPAN><o:p></o:p></FONT></FONT></SPAN></PRE>
<PRE><SPAN style="COLOR: black"><FONT size=2><FONT face="Arial Unicode MS">&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4) If any exception happens can the
message will be retained so that<o:p></o:p></FONT></FONT></SPAN></PRE><PRE>
<SPAN style="COLOR: black"><FONT size=2><FONT face="Arial Unicode MS">it will be
served next time<o:p></o:p></FONT></FONT>
</SPAN></PRE><PRE><SPAN style="COLOR: blue"><FONT size=2><FONT face="Arial
Unicode MS">MDB can throw system exception upon which the container discards
the bean instance. </FONT></FONT></SPAN></PRE><PRE><SPAN style="COLOR: blue">
<FONT size=2><FONT face="Arial Unicode MS">However, the exceptions are not
propagated to the client, since there are no clients.<SPAN style="mso-spacerun:
yes">&nbsp; </SPAN></FONT></FONT></SPAN></PRE><PRE><SPAN style="COLOR: blue">
<FONT size=2><FONT face="Arial Unicode MS"><SPAN style="mso-spacerun: yes"><
/SPAN>So, MDB cannot throw application exception. The answer is No. <o:p></o:p><
/FONT></FONT></SPAN></PRE><PRE><SPAN style="COLOR: black"><FONT size=2><FONT
face="Arial Unicode MS">&nbsp;Ashraf Galal<o:p></o:p></FONT></FONT></SPAN></PRE
><PRE><SPAN style="COLOR: black"><FONT size=2><FONT face="Arial Unicode MS">
&nbsp;<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="COLOR: black">
<FONT size=2><FONT face="Arial Unicode MS"></FONT></SPAN></PRE></DIV></FONT><
/BLOCKQUOTE></BODY></HTML>
====================================================================
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)

©2008 junlu.com - Jax Systems, LLC, U.S.A.