Author: chirino
Date: Fri Aug 18 03:10:34 2006
New Revision: 432542
URL: http://svn.apache.org/viewvc?rev=432542&view=rev
Log:
Latest export from confluence
Modified:
incubator/activemq/site/how-should-i-implement-request-response-with-jms.html
incubator/activemq/site/jms.html
Modified:
incubator/activemq/site/how-should-i-implement-request-response-with-jms.html
URL:
http://svn.apache.org/viewvc/incubator/activemq/site/how-should-i-implement-request-response-with-jms.html?rev=432542&r1=432541&r2=432542&view=diff
==============================================================================
---
incubator/activemq/site/how-should-i-implement-request-response-with-jms.html
(original)
+++
incubator/activemq/site/how-should-i-implement-request-response-with-jms.html
Fri Aug 18 03:10:34 2006
@@ -185,7 +185,7 @@
<LI><A href="ajax.html" title="Ajax">Ajax</A></LI>
<LI><A href="axis-support.html" title="Axis Support">Axis
Support</A></LI>
<LI><A href="c-integration.html" title="C Integration">C
Integration</A></LI>
- <LI><A href="activemq-cpp-client.html" title="ActiveMQ CPP
Client">C++ Integration</A></LI>
+ <LI><A href="activemq-c-clients.html" title="ActiveMQ C++
Clients">C++ Integration</A></LI>
<LI><A href="nms.html" title="NMS">C# and .Net Integration</A></LI>
<LI><A href="cms.html" title="CMS">CMS</A></LI>
<LI><A href="geronimo.html" title="Geronimo">Geronimo</A></LI>
@@ -276,8 +276,7 @@
<!--
<div class="pagetitle">How should I implement request response
with JMS</div>
-->
- <DIV class="wiki-content">
-<P>You might think at first that to implement request-response type operations
in JMS that you should create a new consumer with a selector per request; or
maybe create a new temporary queue per request.</P>
+ <DIV class="wiki-content"><P>You might think at first that to
implement request-response type operations in JMS that you should create a new
consumer with a selector per request; or maybe create a new temporary queue per
request.</P>
<P>Creating temporary destinations, consumers, producers and connections are
all synchronous request-response operations with the broker and so should be
avoided for processing each request as it results in lots of chat with the JMS
broker.</P>
@@ -289,7 +288,36 @@
<P>The actual class which does this is the <SPAN class="nobr"><A
href="http://lingo.codehaus.org/maven/apidocs/org/logicblaze/lingo/jms/impl/MultiplexingRequestor.html"
title="Visit page outside Confluence"
rel="nofollow">MultiplexingRequestor<SUP><IMG class="rendericon"
src="http://goopen.org/confluence/images/icons/linkext7.gif" height="0"
width="0" align="absmiddle" alt="" border="0"></SUP></A></SPAN> . It may be
just using Spring remoting with Lingo is the simplest way of implementing
request response - or maybe you could just use Lingo's <SPAN
class="nobr"><A
href="http://lingo.codehaus.org/maven/apidocs/org/logicblaze/lingo/jms/Requestor.html"
title="Visit page outside Confluence" rel="nofollow">Requestor<SUP><IMG
class="rendericon" src="http://goopen.org/confluence/images/icons/linkext7.gif"
height="0" width="0" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
interface to keep the JMS semantics.</P>
-<P>More details <SPAN class="nobr"><A
href="http://lingo.codehaus.org/Request%20Response%20with%20JMS" title="Visit
page outside Confluence" rel="nofollow">here<SUP><IMG class="rendericon"
src="http://goopen.org/confluence/images/icons/linkext7.gif" height="0"
width="0" align="absmiddle" alt="" border="0"></SUP></A></SPAN></P></DIV>
+<P>More details <SPAN class="nobr"><A
href="http://lingo.codehaus.org/Request%20Response%20with%20JMS" title="Visit
page outside Confluence" rel="nofollow">here<SUP><IMG class="rendericon"
src="http://goopen.org/confluence/images/icons/linkext7.gif" height="0"
width="0" align="absmiddle" alt="" border="0"></SUP></A></SPAN></P>
+
+<H3><A name="HowshouldIimplementrequestresponsewithJMS-Clientside"></A>Client
side</H3>
+
+<P>So the client side creates a consumer on a temporary queue as follows...</P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-comment">// client side
+</SPAN>Destination tempDest = session.createTemporaryQueue();
+MessageConsumer responseConsumer = session.createConsumer(tempDest);
+...
+
+<SPAN class="code-comment">// send a request..
+</SPAN>message.setJMSReplyTo(tempDest)
+message.setJMSCorrelationID(myCorrelationID);
+
+producer.send(message);</PRE>
+</DIV></DIV>
+
+<H3><A name="HowshouldIimplementrequestresponsewithJMS-Serverside"></A>Server
side</H3>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> void
onMessage(Message request) {
+
+ Message response = session.createMessage();
+ response.setJMSCorrelationID(request.getJMSCorrelationID())
+
+ producer.send(request.getJMSReplyTo(), response)
+}</PRE>
+</DIV></DIV></DIV>
</DIV>
</TD>
@@ -299,8 +327,8 @@
</DIV>
<DIV id="site-footer">
Added by <A
href="http://goopen.org/confluence/users/viewuserprofile.action?username=jstrachan">James
Strachan</A>,
- last edited by <A
href="http://goopen.org/confluence/users/viewuserprofile.action?username=jstrachan">James
Strachan</A> on Dec 19, 2005
- (<A
href="http://goopen.org/confluence/pages/diffpages.action?pageId=13&originalId=1558">view
change</A>)
+ last edited by <A
href="http://goopen.org/confluence/users/viewuserprofile.action?username=jstrachan">James
Strachan</A> on Aug 18, 2006
+ (<A
href="http://goopen.org/confluence/pages/diffpages.action?pageId=13&originalId=9695">view
change</A>)
(<A
href="http://goopen.org/confluence/pages/editpage.action?pageId=13">edit
page</A>)
</DIV>
Modified: incubator/activemq/site/jms.html
URL:
http://svn.apache.org/viewvc/incubator/activemq/site/jms.html?rev=432542&r1=432541&r2=432542&view=diff
==============================================================================
--- incubator/activemq/site/jms.html (original)
+++ incubator/activemq/site/jms.html Fri Aug 18 03:10:34 2006
@@ -185,7 +185,7 @@
<LI><A href="ajax.html" title="Ajax">Ajax</A></LI>
<LI><A href="axis-support.html" title="Axis Support">Axis
Support</A></LI>
<LI><A href="c-integration.html" title="C Integration">C
Integration</A></LI>
- <LI><A href="activemq-cpp-client.html" title="ActiveMQ CPP
Client">C++ Integration</A></LI>
+ <LI><A href="activemq-c-clients.html" title="ActiveMQ C++
Clients">C++ Integration</A></LI>
<LI><A href="nms.html" title="NMS">C# and .Net Integration</A></LI>
<LI><A href="cms.html" title="CMS">CMS</A></LI>
<LI><A href="geronimo.html" title="Geronimo">Geronimo</A></LI>