  | 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 | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | JSP - A mailing list about Java Server Pages specification and reference | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Using JMS in a session bean | Using JMS in a session bean 2004-10-15 - By Dhiren Mehta
Back Milind,
The question was whether the response can be received in the same method that sent the message.
If I have understood the question clearly, what is expected is that once the message is sent the execution thread should wait until the response is sent back and the response should be received in the same method that sent the message. Well the answer is NO. The whole idea of using JMS is to have Asynchronous communication and not wait for the response.
Dhiren
-- --Original Message-- -- From: A mailing list for Java(tm) 2 Platform, Enterprise Edition [mailto:J2EE-INTEREST@(protected)] On Behalf Of Milind Patil Sent: Friday, October 15, 2004 1:00 PM To: J2EE-INTEREST@(protected) Subject: Re: Using JMS in a session bean
To receive message from a queue you have to have listener associated with it or you can create a queue browser and filer a particular message from a queue.
Milind Bhaskar Patil Tata Consultancy Services Limited Mailto: milind.patil@(protected) Website: http://www.tcs.com
DISCLAIMER: The information contained in this message is intended only and solely for the addressed individual or entity indicated in this message and for the exclusive use of the said addressed individual or entity indicated in this message (or responsible for delivery of the message to such person) and may contain legally privileged and confidential information belonging to Tata Consultancy Services Limited. It must not be printed, read, copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person other than the addressee. Unauthorized use, disclosure or copying is strictly prohibited and may constitute unlawful act and can possibly attract legal action, civil and/or criminal. The contents of this message need not necessarily reflect or endorse the views of Tata Consultancy Services limited on any subject matter. Any action taken or omitted to be taken based on this message is entirely at your risk and neither the originator of this message nor Tata Consultancy Services Limited takes any responsibility or liability towards the same. Opinions, conclusions and any other information contained in this message that do not relate to the official business of Tata Consultancy Services limited shall be understood as neither given nor endorsed by Tata Consultancy Services Limited or any affiliate of Tata Consultancy Services Limited. If you have received this message in error, you should destroy this message and may please notify the sender by e-mail. Thank you.
======================================================================== === To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
<html>
<head> <meta http-equiv=Content-Type content="text/html; charset=us-ascii"> <meta name=Generator content="Microsoft Word 10 (filtered)">
<style> <!-- /* Font Definitions */ @(protected) {font-family:Tahoma; panose-1 (See http://ose-1.ora-code.com):2 11 6 4 3 5 4 4 2 4;} @(protected) {font-family:sans-serif; panose-1 (See http://ose-1.ora-code.com):0 0 0 0 0 0 0 0 0 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline;} p {margin-right:0in; margin-left:0in; font-size:12.0pt; font-family:"Times New Roman";} span.EmailStyle18 {font-family:Arial; color:navy;} @(protected) Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in;} div.Section1 {page:Section1;} --> </style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>Milind,</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>The question was whether the response can be received in the same method that sent the message. </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>If I have understood the question clearly, what is expected is that once the message is sent the execution thread should wait until the response is sent back and the response should be received in the same method that sent the message. Well the answer is NO. The whole idea of using JMS is to have Asynchronous communication and not wait for the response.< /span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>Dhiren</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>-- --Original Message-- --<br> <b><span style='font-weight:bold'>From:</span></b> A mailing list for Java(tm) 2 Platform, Enterprise Edition [mailto:J2EE-INTEREST@(protected)] <b><span style='font-weight:bold'>On Behalf Of </span></b>Milind Patil<br> <b><span style='font-weight:bold'>Sent:</span></b> Friday, October 15, 2004 1:00 PM<br> <b><span style='font-weight:bold'>To:</span></b> J2EE-INTEREST@(protected)<br> <b><span style='font-weight:bold'>Subject:</span></b> Re: Using JMS in a session bean</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman" ><span style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman" ><span style='font-size:12.0pt'><br> </span></font><font size=2 face=sans-serif><span style='font-size:10.0pt; font-family:sans-serif'>To receive message from a queue you have to have listener associated with it </span></font><br> <font size=2 face=sans-serif><span style='font-size:10.0pt;font-family:sans -serif'>or </span></font><br> <font size=2 face=sans-serif><span style='font-size:10.0pt;font-family:sans -serif'>you can create a queue browser and filer a particular message from a queue.</span>< /font> <br> <br> <font size=2 face=sans-serif><span style='font-size:10.0pt;font-family:sans -serif'><br> Milind Bhaskar Patil<br> Tata Consultancy Services Limited<br> Mailto: milind.patil@(protected)<br> Website: http://www.tcs.com</span></font> </p>
<table class=MsoNormalTable border=0 cellpadding=0 width=582 style='width:436 .5pt; margin-left:.5in'> <tr> <td bgcolor=white style='background:white;padding:.75pt .75pt .75pt .75pt'> <p class=MsoNormal><font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt;color:black'>DISCLAIMER: The information contained in this message is intended only and solely for the addressed individual or entity indicated in this message and for the exclusive use of the said addressed individual or entity indicated in this message (or responsible for delivery of the message to such person) and may contain legally privileged and confidential information belonging to Tata Consultancy Services Limited. It must not be printed, read, copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person other than the addressee. Unauthorized use, disclosure or copying is strictly prohibited and may constitute unlawful act and can possibly attract legal action, civil and/or criminal. The contents of this message need not necessarily reflect or endorse the views of Tata Consultancy Services limited on any subject matter. <br> Any action taken or omitted to be taken based on this message is entirely at your risk and neither the originator of this message nor Tata Consultancy Services Limited takes any responsibility or liability towards the same. Opinions, conclusions and any other information contained in this message that do not relate to the official business of Tata Consultancy Services limited shall be understood as neither given nor endorsed by Tata Consultancy Services Limited or any affiliate of Tata Consultancy Services Limited. If you have received this message in error, you should destroy this message and may please notify the sender by e-mail. <br> Thank you.</span></font></p> </td> </tr> </table>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman" ><span style='font-size:12.0pt'>====================================================== ===================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help". </span></font></p>
</div>
</body>
</html>
|
|
|