Author: timfox
Date: 2009-12-18 06:54:49 -0500 (Fri, 18 Dec 2009)
New Revision: 8698
Modified:
trunk/examples/jms/request-reply/readme.html
trunk/examples/jms/request-reply/src/org/hornetq/jms/example/RequestReplyExample.java
Log:
tweak to request reply example docs
Modified: trunk/examples/jms/request-reply/readme.html
===================================================================
--- trunk/examples/jms/request-reply/readme.html 2009-12-16 15:31:57 UTC (rev 8697)
+++ trunk/examples/jms/request-reply/readme.html 2009-12-18 11:54:49 UTC (rev 8698)
@@ -9,6 +9,8 @@
<h1>JMS Request-Reply Example</h1>
<br>
<p>This example shows you how to handle a request message and receive a reply.
To get a reply message, the requesting client creates a temporary queue. Then it sends out
the request message with JMSReplyTo set to the temporary queue. The request message is
handled by a SimpleRequestServer, who is listening to the request queue for incoming
requests. If a request message has arrived, it extracts the reply queue from the request
message by JMSReplyTo header, and sends back a reply message. To let the client know to
which request message a reply message is related, the server also set the JMSCorrelationID
with the request message's JMSMessageID header to the reply message.</p>
+<p>Of course, in a real world example you would re-use the session, producer,
consumer and temporary queue and not create a new one for each message!
+Or better still use the correlation id, and just store the requests in a map, then you
don't need a temporary queue at all
<p>Request/Reply style messaging is supported through standard JMS message
headers JMSReplyTo and JMSCorrelationID. This is often used in request-reply style
communications between applications.
Whenever a client sends a message that expects a response, it can use this mechanism
to implement. please consult the JMS 1.1 specification for full details.</p>
Modified:
trunk/examples/jms/request-reply/src/org/hornetq/jms/example/RequestReplyExample.java
===================================================================
---
trunk/examples/jms/request-reply/src/org/hornetq/jms/example/RequestReplyExample.java 2009-12-16
15:31:57 UTC (rev 8697)
+++
trunk/examples/jms/request-reply/src/org/hornetq/jms/example/RequestReplyExample.java 2009-12-18
11:54:49 UTC (rev 8698)
@@ -34,6 +34,11 @@
/**
* A simple JMS example that shows how to use Request/Replay style messaging.
*
+ * Of course, in a real world example you would re-use the session, producer, consumer
and temporary queue
+ * and not create a new one for each message!
+ *
+ * Or better still use the correlation id, and just store the requests in a map, then you
don't need a temporary queue at all
+ *
* @author <a href="hgao(a)redhat.com">Howard Gao</a>
*/
public class RequestReplyExample extends HornetQExample
Show replies by date