activemq-artemis/examples/features/standard/queue-requestor
Clebert Suconic 505b732843 [maven-release-plugin] prepare for next development iteration 2016-09-06 12:17:31 -04:00
..
src/main Use try-with-resources more 2016-02-21 12:09:43 +02:00
pom.xml [maven-release-plugin] prepare for next development iteration 2016-09-06 12:17:31 -04:00
readme.html renaming broker-features -> features on examples 2015-08-13 00:11:56 -04:00

readme.html

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<html>
  <head>
    <title>ActiveMQ Artemis JMS QueueRequestor Example</title>
    <link rel="stylesheet" type="text/css" href="../../../common/common.css" />
    <link rel="stylesheet" type="text/css" href="../../../common/prettify.css" />
    <script type="text/javascript" src="../../../common/prettify.js"></script>
  </head>
  <body onload="prettyPrint()">
     <h1>JMS QueueRequestor Example</h1>

     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>


     <p>This example shows you how to use a <a href="http://java.sun.com/javaee/5/docs/api/javax/jms/QueueRequestor.html">QueueRequestor</a> with ActiveMQ Artemis.</p>
     <p>JMS is mainly used to send messages asynchronously so that the producer of a message is not waiting for the result of the message consumption.
        However, there are cases where it is necessary to have a synchronous behavior: the code sending a message requires a reply for this message
        before continuing its execution.<br />
        A QueueRequestor facilitates this use case by providing a simple request/reply abstraction on top of JMS.</p>
     <p>The example consists in two classes:</p>
     <dl>
         <dt><code>TextReverserService</code></dt>
         <dd>A JMS MessageListener which consumes text messages and sends replies containing the reversed text</dd>
         <dt><code>QueueRequestorExample</code></dt>
         <dd>A JMS Client which uses a QueueRequestor to send text requests to a queue and receive replies with the reversed text in a synchronous fashion</dd>
    </dl>
  </body>
</html>