activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [07/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples
Date Fri, 07 Aug 2015 19:31:26 GMT
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue-message-redistribution/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue-message-redistribution/pom.xml b/examples/jms/queue-message-redistribution/pom.xml
index 8100fcc..bee7116 100644
--- a/examples/jms/queue-message-redistribution/pom.xml
+++ b/examples/jms/queue-message-redistribution/pom.xml
@@ -18,7 +18,8 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
 
    <parent>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-queue-message-redistribution-example</artifactId>
+   <artifactId>queue-message-redistribution</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Queue Message Redistribution Example</name>
 
@@ -37,115 +38,127 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create0</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>start0</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <spawn>true</spawn>
-                           <location>${basedir}/target/server0</location>
-                           <testURI>tcp://localhost:61616</testURI>
-                           <args>
-                              <param>run</param>
-                           </args>
-                           <name>server0</name>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>start1</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <spawn>true</spawn>
-                           <location>${basedir}/target/server1</location>
-                           <testURI>tcp://localhost:61617</testURI>
-                           <args>
-                              <param>run</param>
-                           </args>
-                           <name>server1</name>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.QueueMessageRedistributionExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <location>${basedir}/target/server0</location>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <location>${basedir}/target/server1</location>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-queue-message-redistribution-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.QueueMessageRedistributionExample
+                     </clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>queue-message-redistribution</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue-message-redistribution/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/queue-message-redistribution/readme.html b/examples/jms/queue-message-redistribution/readme.html
index 386e046..b5c6cf6 100644
--- a/examples/jms/queue-message-redistribution/readme.html
+++ b/examples/jms/queue-message-redistribution/readme.html
@@ -27,6 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Message Redistribution 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 demonstrates message redistribution between queues with the same name deployed in different
      nodes of a cluster.</p>
      <p>As demontrated in the clustered queue example, if queues with the same name are deployed on different nodes of
@@ -41,7 +44,7 @@ under the License.
      <p>Setting <code>redistribution-delay</code> to <code>0</code> will cause redistribution to occur immediately
      once there are no more matching consumers on a particular queue instance. Setting it to a positive value > 0 specifies
      a delay in milliseconds before attempting to redistribute. The delay is useful in the case that another consumer is
-     likely to be created on the queue, to avoid unnecessary redistribution.</p>     
+     likely to be created on the queue, to avoid unnecessary redistribution.</p>
      <p>Here's the relevant snippet from the <code>activemq-queues.xml</code> configuration, which tells the server
      to use a redistribution delay of <code>0</code> on any jms queues, i.e. any queues whose name starts with
      <code>jms.</code></p>
@@ -51,194 +54,8 @@ under the License.
       &lt;redistribution-delay&gt;0&lt;/redistribution-delay&gt;
    &lt;/address-setting&gt;
    </code>
-     </pre>    
+     </pre>
      <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
-     section of the user manual.</p>      
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-     <ol>
-        <li>Get an initial context for looking up JNDI from server 0</li>
-        <pre class="prettyprint">
-           <code>
-   ic0 = getContext(0);
-   </code>
-        </pre>
-
-        <li>Look-up the JMS Queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue)ic0.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 0</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>Get an initial context for looking up JNDI from server 1.</li>
-        <pre class="prettyprint">
-           <code>ic1 = getContext(1);</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 1</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>We create a JMS Connection connection0 which is a connection to server 0</li>
-        <pre class="prettyprint">
-          <code>
-   connection0 = cf0.createConnection();
-          </code>
-        </pre>
-        
-        <li>We create a JMS Connection connection1 which is a connection to server 1</li>
-        <pre class="prettyprint">
-          <code>
-   connection1 = cf1.createConnection();
-          </code>
-        </pre>
-
-        <li>We create a JMS Session on server 0, note the session is CLIENT_ACKNOWLEDGE</li>
-        <pre class="prettyprint">
-           <code>
-   Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           </code>
-        </pre>
-        
-        <li>We create a JMS Session on server 1, note the session is CLIENT_ACKNOWLEDGE</li>
-        <pre class="prettyprint">
-           <code>
-   Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            </code>
-        </pre>
-
-        <li>We start the connections to ensure delivery occurs on them</li>
-        <pre class="prettyprint">
-           <code>
-   connection0.start();
-
-   connection1.start();
-           </code>
-        </pre>
-
-        <li>We create JMS MessageConsumer objects on server 0 and server 1</li>
-        <pre class="prettyprint">
-           <code>
-   MessageConsumer consumer0 = session0.createConsumer(queue);
-
-   MessageConsumer consumer1 = session1.createConsumer(queue);
-           </code>
-        </pre>
-
-        <li>We create a JMS MessageProducer object on server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   MessageProducer producer = session0.createProducer(queue);</code>
-        </pre>
-
-        <li>We send some messages to server 0.</li>
-        <pre class="prettyprint">
-           <code>
-	final int numMessages = 10;
-
-	for (int i = 0; i < numMessages; i++)
-	{
-	   TextMessage message = session0.createTextMessage("This is text message " + i);
-	      
-	   producer.send(message);
-	
-	   System.out.println("Sent message: " + message.getText());
-	}
-           </code>
-        </pre>
-        
-        <li>We now consume those messages on *both* server 0 and server 1.
-         We note the messages have been distributed between servers in a round robin fashion.
-         ActiveMQ Artemis has <b>load balanced</b> the messages between the available consumers on the different nodes.
-         ActiveMQ Artemis can be configured to always load balance messages to all nodes, or to only balance messages
-         to nodes which have consumers with no or matching selectors. See the user manual for more details.</li>
-         JMS Queues implement point-to-point message where each message is only ever consumed by a
-         maximum of one consumer.
-        <pre class="prettyprint">
-           <code>
-	for (int i = 0; i < numMessages; i += 2)
-	{
-	   TextMessage message0 = (TextMessage)consumer0.receive(5000);
-	
-	   System.out.println("Got message: " + message0.getText() + " from node 0");
-	
-	   TextMessage message1 = (TextMessage)consumer1.receive(5000);
-	
-	   System.out.println("Got message: " + message1.getText() + " from node 1");
-	}
-           </code>
-        </pre> 
-        
-        <li>We acknowledge the messages consumed on node 0. The sessions are CLIENT_ACKNOWLEDGE so
-         messages will not get acknowledged until they are explicitly acknowledged.
-         Note that we <b>do not</b> acknowledge the message consumed on node 1 yet.</li>
-        <pre class="prettyprint">
-           <code>
-           message0.acknowledge();
-           </code>
-        </pre>
-        
-        <li>We now close the session and consumer on node 1. (Closing the session automatically closes the consumer)
-        </li>
-        <pre class="prettyprint">
-           <code>session1.close();</code>
-        </pre>
-        
-        <li>Since there is no more consumer on node 1, the messages on node 1 are now stranded (no local consumers)
-        so ActiveMQ Artemis will redistribute them to node 0 so they can be consumed. We consume them from
-        node 0.</li>
-        <pre class="prettyprint">
-           <code>
-           for (int i = 0; i < numMessages; i += 2)
-         {
-            message0 = (TextMessage)consumer0.receive(5000);
-
-            System.out.println("Got message: " + message0.getText() + " from node 0");           
-         }
-           </code>
-        </pre> 
-        
-        <li>We ack the redistributed messages.</li>
-        <pre class="prettyprint">
-           <code>message0.acknowledge();</code>
-        </pre>
-           
-        
-        <li>And finally (no pun intended), <b>always</b> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-	finally
-	{
-	      if (connection0 != null)
-         {
-            connection0.close();
-         }
-
-         if (connection1 != null)
-         {
-            connection1.close();
-         }
-
-         if (ic0 != null)
-         {
-            ic0.close();
-         }
-
-         if (ic1 != null)
-         {
-            ic1.close();
-         }
-	}
-           </code>
-        </pre>
-
-     </ol>
+     section of the user manual.</p>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java b/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
index aec56b1..f6cdb5e 100644
--- a/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
+++ b/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
@@ -26,6 +26,9 @@ import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 import java.util.Hashtable;
 
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
 /**
  * This example demonstrates a queue with the same name deployed on two nodes of a cluster.
  * Messages are initially round robin'd between both nodes of the cluster.
@@ -40,33 +43,16 @@ public class QueueMessageRedistributionExample
 
       Connection connection1 = null;
 
-      InitialContext ic0 = null;
-
-      InitialContext ic1 = null;
-
       try
       {
-         // Step 1. Get an initial context for looking up JNDI from server 0
-         Hashtable<String, Object> properties = new Hashtable<String, Object>();
-         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616");
-         properties.put("queue.queue/exampleQueue", "exampleQueue");
-         ic0 = new InitialContext(properties);
-
          // Step 2. Look-up the JMS Queue object from JNDI
-         Queue queue = (Queue)ic0.lookup("queue/exampleQueue");
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
          // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory");
-
-         // Step 4. Get an initial context for looking up JNDI from server 1
-         properties = new Hashtable<String, Object>();
-         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
-         ic1 = new InitialContext(properties);
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
 
          // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
-         ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("ConnectionFactory");
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
 
          // Step 6. We create a JMS Connection connection0 which is a connection to server 0
          connection0 = cf0.createConnection();
@@ -164,16 +150,6 @@ public class QueueMessageRedistributionExample
          {
             connection1.close();
          }
-
-         if (ic0 != null)
-         {
-            ic0.close();
-         }
-
-         if (ic1 != null)
-         {
-            ic1.close();
-         }
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue-requestor/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue-requestor/pom.xml b/examples/jms/queue-requestor/pom.xml
index 2b8e16f..35c380e 100644
--- a/examples/jms/queue-requestor/pom.xml
+++ b/examples/jms/queue-requestor/pom.xml
@@ -18,7 +18,8 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
 
    <parent>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-queue-requestor-example</artifactId>
+   <artifactId>queue-requestor</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Queue Requestor Example</name>
 
@@ -37,71 +38,76 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                     </execution>
-                     <execution>
-                        <id>start</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <spawn>true</spawn>
-                           <testURI>tcp://localhost:61616</testURI>
-                           <args>
-                              <param>run</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.QueueRequestorExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-queue-requestor-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <spawn>true</spawn>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.QueueRequestorExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>queue-requestor</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue-requestor/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/queue-requestor/readme.html b/examples/jms/queue-requestor/readme.html
index 416406a..af11c9c 100644
--- a/examples/jms/queue-requestor/readme.html
+++ b/examples/jms/queue-requestor/readme.html
@@ -27,6 +27,9 @@ under the License.
   <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
@@ -39,101 +42,5 @@ under the License.
          <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>
-
-         
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look up the JMS queue from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look up JMS queue connection factory from JNDI</li>
-        <pre class="prettyprint">
-           <code>QueueConnectionFactory cf = (QueueConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create the TextReverserService which will consume messages from the queue</li>
-        <pre class="prettyprint">
-           <code> TextReverserService reverserService = new TextReverserService(cf, queue);</code>
-        </pre>
-        
-        <li>We Create a JMS queue connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createQueueConnection();</code>
-        </pre>
-         
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-         
-        <li>We create a JMS queue session. The session is created as non transacted and will auto acknowledge messages (this is mandatory to use it to create a QueueRequestor)</li>
-        <pre class="prettyprint">
-           <code>QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-        
-        <li>We create a JMS QueueRequestor using the session and the queue</li>
-        <pre class="prettyprint">
-           <code>QueueRequestor queueRequestor = new QueueRequestor(session, queue);</code>
-        </pre>
-
-        <li>We create a JMS text message to send as a request</li>
-        <pre class="prettyprint">
-           <code>TextMessage request = session.createTextMessage("Hello, World!");</code>
-        </pre>
-   
-        <li><p>We use the queue requestor to send the request and block until a reply is received.<br />
-            Using the queue requestor simplify request/reply use case by abstracting boilerplate JMS code
-            (creating a temporary queue, a consumer and a producer, setting the JMS ReplyTo header on the request, 
-            sending the request with the producer, consuming the message from the consumer).
-            All this code is replaced by a single call to <code>QueueRequestor.request()</code> method.</p>
-            </li>
-        <pre class="prettyprint">
-           <code>TextMessage reply = (TextMessage)queueRequestor.request(request);</code>
-        </pre>
-
-        <li>The reply's text contains the reverse of the request's text</li>
-        <pre class="prettyprint">
-           <code>System.out.println("Send request: " + request.getText());
-           System.out.println("Received reply:" + reply.getText());</code>
-        </pre>
-
-        <li>We close the queue requestor to release all the JMS resources it created to provide request/reply mechanism</li>
-        <pre class="prettyprint">
-           <code>queueRequestor.close()</code>
-        </pre>
-
-        <li>We do the same for the text reverser service</li>
-        <pre class="prettyprint">
-           <code>reverserService.close()</code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-         
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue-selector/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue-selector/pom.xml b/examples/jms/queue-selector/pom.xml
index 7f179f6..dca3246 100644
--- a/examples/jms/queue-selector/pom.xml
+++ b/examples/jms/queue-selector/pom.xml
@@ -18,7 +18,8 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
 
    <parent>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-queue-selector-example</artifactId>
+   <artifactId>queue-selector</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Queue Selector Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                     </execution>
-                     <execution>
-                        <id>start</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <spawn>true</spawn>
-                           <testURI>tcp://localhost:61616</testURI>
-                           <args>
-                              <param>run</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.QueueSelectorExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-queue-selector-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.QueueSelectorExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>queue-selector</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue-selector/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/queue-selector/readme.html b/examples/jms/queue-selector/readme.html
index 4af57ba..edb3f7b 100644
--- a/examples/jms/queue-selector/readme.html
+++ b/examples/jms/queue-selector/readme.html
@@ -27,139 +27,26 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Queue Selector 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 selectively consume messages using message selectors with queue consumers.</p>
-     
+
      <p>Message selectors are strings with special syntax that can be used in creating consumers. Message consumers
      created with a message selector will only receive messages that match its selector. On message delivery, the JBoss Message
      Server evaluates the corresponding message headers of the messages against each selector, if any, and then delivers
      the 'matched' messages to its consumer. Please consult the JMS 1.1 specification for full details.</p>
-     
+
      <p>In this example, three message consumers are created on a queue. The first consumer is created with selector
      <code>'color=red'</code>, it only receives messages that
-     have a 'color' string property of 'red' value; the second is created with selector <code>'color=green'</code>, it 
-     only receives messages who have a 'color' string property of 
+     have a 'color' string property of 'red' value; the second is created with selector <code>'color=green'</code>, it
+     only receives messages who have a 'color' string property of
      'green' value; and the third without a selector, which means it receives all messages. To illustrate, three messages
      with different 'color' property values are created and sent.</p>
 
      <p>Selectors can be used with both queue consumers and topic consumers. The difference is that with queue consumers,
      a message is only delivered to one consumer on the queue, while topic consumers the message will be delivered to every
-     matching consumers. In this example, if the third consumer (anyConsumer) were the first consumer created, it will 
+     matching consumers. In this example, if the third consumer (anyConsumer) were the first consumer created, it will
      consume the first message delivered, therefore there is no chance for the next consumer to get the message, even if it
      matches the selector.</p>
-     
-
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We start the connection</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(queue);</code>
-       </pre>
-
-        <li>We create two selectors.</li>
-         <pre class="prettyprint">
-           <code>
-           String redSelector = "color='red'";
-           String greenSelector = "color='green'";
-           </code>
-         </pre>
-
-        <li>We Create a JMS Message Consumer that receives 'red' messages.</li>
-        <pre class="prettyprint">
-          <code>
-          MessageConsumer redConsumer = session.createConsumer(queue, redSelector);
-          redConsumer.setMessageListener(new SimpleMessageListener("red"));
-         </code>
-        </pre>
-
-        <li>We Create a second JMS Message Consumer that receives 'green' messages.</li>
-        <pre class="prettyprint">
-          <code>
-          MessageConsumer greenConsumer = session.createConsumer(queue, greenSelector);
-          greenConsumer.setMessageListener(new SimpleMessageListener("green"));
-         </code>
-        </pre>
-
-        <li>We Create another JMS Message Consumer that receives all messages. Please not that the order
-        of consumers on a queue is of significance. If the anyConsumer is created before the above two, the 
-        result will be totally different.</li>
-        <pre class="prettyprint">
-          <code>
-          MessageConsumer anyConsumer = session.createConsumer(queue);
-          anyConsumer.setMessageListener(new SimpleMessageListener("any"));
-         </code>
-        </pre>
-
-        <li>We Create three messages, each has a different color property.</li>
-        <pre class="prettyprint">
-           <code>
-           TextMessage redMessage = session.createTextMessage("Red");
-           redMessage.setStringProperty("color", "red");
-           TextMessage greenMessage = session.createTextMessage("Green");
-           greenMessage.setStringProperty("color", "green");
-           TextMessage blueMessage = session.createTextMessage("Blue");
-           blueMessage.setStringProperty("color", "blue");
-           </code>
-        </pre>
-
-        <li>We send the messages to the topic</li>
-        <pre class="prettyprint">
-           <code>
-           producer.send(redMessage);
-           System.out.println("Message sent: " + redMessage.getText());
-           producer.send(greenMessage);
-           System.out.println("Message sent: " + greenMessage.getText());
-           producer.send(blueMessage);
-           System.out.println("Message sent: " + blueMessage.getText());
-           </code>
-        </pre>
-        
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue/pom.xml b/examples/jms/queue/pom.xml
index fecaaf7..ba5e182 100644
--- a/examples/jms/queue/pom.xml
+++ b/examples/jms/queue/pom.xml
@@ -18,7 +18,8 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
 
    <parent>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-queue-example</artifactId>
+   <artifactId>queue</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Queue Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                     </execution>
-                     <execution>
-                        <id>start</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <spawn>true</spawn>
-                           <testURI>tcp://localhost:61616</testURI>
-                           <args>
-                              <param>run</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.QueueExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-queue-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <spawn>true</spawn>
+                     <ignore>${noServer}</ignore>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.QueueExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>queue</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/queue/readme.html b/examples/jms/queue/readme.html
index a80d973..71d4a9b 100644
--- a/examples/jms/queue/readme.html
+++ b/examples/jms/queue/readme.html
@@ -27,88 +27,12 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Queue 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 send and receive a message to a JMS Queue using ActiveMQ Artemis.</p>
      <p>Queues are a standard part of JMS, please consult the JMS 1.1 specification for full details.</p>
      <p>A Queue is used to send messages point to point, from a producer to a consumer. The queue guarantees message ordering between these 2 points.</p>
      <p>Notice this example is using pretty much a default stock configuration</p>
-
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create a JMS text message that we are going to send.</li>
-        <pre class="prettyprint">
-           <code>TextMessage message = session.createTextMessage("This is a text message");</code>
-        </pre>
-
-        <li>We send message to the queue</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message);</code>
-        </pre>
-
-        <li>We create a JMS Message Consumer to receive the message.</li>
-          <pre class="prettyprint">
-           <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>The message arrives at the consumer. In this case we use a timeout of 5000 milliseconds but we could use a blocking 'receive()'</li>
-        <pre class="prettyprint">
-           <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);</code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/reattach-node/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/reattach-node/pom.xml b/examples/jms/reattach-node/pom.xml
index 885adcf..cb0d5d3 100644
--- a/examples/jms/reattach-node/pom.xml
+++ b/examples/jms/reattach-node/pom.xml
@@ -18,7 +18,8 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
 
    <parent>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-reattach-node-example</artifactId>
+   <artifactId>reattach-node</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Reattach Node Example</name>
 
@@ -41,76 +42,79 @@ under the License.
          <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>start</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <spawn>true</spawn>
-                           <testURI>tcp://localhost:61616</testURI>
-                           <args>
-                              <param>run</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.ReattachExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-reattach-node-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ReattachExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>reattach-node</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/reattach-node/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/reattach-node/readme.html b/examples/jms/reattach-node/readme.html
index 36fbfa2..3ed6a4a 100644
--- a/examples/jms/reattach-node/readme.html
+++ b/examples/jms/reattach-node/readme.html
@@ -27,6 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Reattach 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 demonstrates how ActiveMQ Artemis connections can be configured to be resilient to
      temporary network failures.</p>
      <p>In the case of a network failure being detected, either as a result of a failure to read/write to the connection,
@@ -48,104 +51,5 @@ under the License.
 
      <p>For more details on how to configure this and for clustering in general
      please consult the ActiveMQ Artemis user manual.</p>
-
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li>Create an initial context to perform the JNDI lookup.</li>
-        <pre class="prettyprint">
-           <code>initialContext = getContext(0);</code>
-        </pre>
-
-        <li>Perform a lookup on the queue</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>Perform a lookup on the Connection Factory</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. </li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create a JMS text message that we are going to send.</li>
-        <pre class="prettyprint">
-           <code>TextMessage message = session.createTextMessage("This is a text message");</code>
-        </pre>
-
-        <li>We send message to the queue</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message);</code>
-        </pre>
-
-        <li>We create a JMS Message Consumer to receive the message.</li>
-          <pre class="prettyprint">
-           <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>To simulate a temporary problem on the network, we stop the remoting acceptor on the
-         server which will cause all client connections to fail.</li>
-        <pre class="prettyprint">
-           <code>stopAcceptor(initialContext);</code>
-        </pre>
-
-        <li>We wait 10 seconds, before restarting the acceptor. During this period the client will be retrying
-        to connect. When the acceptor is restarted it will be successful in reconnecting.</li>
-
-        <pre class="prettyprint">
-           <code>
-            Thread.sleep(10000);
-
-            startAcceptor(initialContext);
-           </code>
-        </pre>
-
-        <li>We receive the message after reattachment! Note that no exceptions were received by the client.</li>
-
-        <pre class="prettyprint">
-           <code>
-           TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
-           </code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java b/examples/jms/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java
index 2b05090..3a47fca 100644
--- a/examples/jms/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java
+++ b/examples/jms/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.Message;
@@ -30,6 +28,7 @@ import javax.naming.InitialContext;
 
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
 /**
  * This examples demonstrates a connection created to a server. Failure of the network connection is then simulated
@@ -127,11 +126,7 @@ public class ReattachExample
    // when the main connection has been stopped
    private static void stopStartAcceptor(final boolean stop) throws Exception
    {
-      Hashtable<String, Object> properties = new Hashtable<String, Object>();
-      properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-      properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
-      InitialContext initialContext = new InitialContext(properties);
-      ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
+      ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61617");
 
       Connection connection = null;
       try

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/reattach-node/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/reattach-node/src/main/resources/activemq/server0/broker.xml b/examples/jms/reattach-node/src/main/resources/activemq/server0/broker.xml
index 20321a2..07e09bb 100644
--- a/examples/jms/reattach-node/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/reattach-node/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/replicated-failback-static/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback-static/pom.xml b/examples/jms/replicated-failback-static/pom.xml
index 2cd5072..a19dec5 100644
--- a/examples/jms/replicated-failback-static/pom.xml
+++ b/examples/jms/replicated-failback-static/pom.xml
@@ -18,7 +18,8 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
 
    <parent>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-replicated-failback-static-example</artifactId>
+   <artifactId>replicated-failback-static</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Replicated Failback Static Example</name>
 
@@ -42,66 +43,62 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create0</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedFailbackStaticExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-replicated-failback-static-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedFailbackStaticExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>replicated-failback-static</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/replicated-failback-static/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback-static/readme.html b/examples/jms/replicated-failback-static/readme.html
index 1dfb8b6..a3cf681 100644
--- a/examples/jms/replicated-failback-static/readme.html
+++ b/examples/jms/replicated-failback-static/readme.html
@@ -26,145 +26,13 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Multiple Failover using Replication Example</h1>
-     
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
+
      <p>This example demonstrates three servers coupled as a live-backup-backup group for high availability (HA) using replication, and a client
      connection failing over from live to backup when the live server is crashed and then to the second backup once the new live fails.</p>
 
      <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
      section of the user manual.</p>
-
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-     <p>In this example, the live server is server 1, and the backup server is server 0</p>
-     <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
-     seamlessly on server 0, the backup server.</p>
-
-     <ol>
-        <li>Get an initial context for looking up JNDI from server #0.</li>
-        <pre class="prettyprint">
-           initialContext = getContext(0);
-        </pre>
-
-        <li>Look up the JMS resources from JNDI on server #0.</li>
-        <pre class="prettyprint">
-           Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-           ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-        </pre>
-
-        <li>Create a JMS Connection</li>
-        <pre class="prettyprint">
-           connection = connectionFactory.createConnection();
-        </pre>
-        
-        <li>Create a client acknowledged Session</li>
-        <pre class="prettyprint">
-           Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-        </pre>
-        
-        <li>Start the connection to ensure delivery occurs</li>
-        <pre class="prettyprint">
-           connection.start();
-        </pre>
-
-        <li>Create a JMS MessageProducer</li>
-        <pre class="prettyprint">
-           MessageProducer producer = session.createProducer(queue);
-        </pre>
-
-        <li>Create a JMS MessageConsumer</li>
-        <pre class="prettyprint">
-           MessageConsumer consumer = session.createConsumer(queue);
-        </pre>
-
-        <li>Send some messages to server #0, the live server</li>
-        <pre class="prettyprint">
-           for (int i = 0; i < numMessages; i++)
-            {
-                TextMessage message = session.createTextMessage("This is text message " + i);
-                producer.send(message);
-                System.out.println("Sent message: " + message.getText());
-            }
-        </pre>
-
-        <li>Receive and acknowledge a third of the sent messages</li>
-        <pre class="prettyprint">
-           TextMessage message0 = null;
-            for (int i = 0; i < numMessages / 3; i++)
-            {
-               message0 = (TextMessage)consumer.receive(5000);
-               System.out.println("Got message: " + message0.getText());
-            }
-            message0.acknowledge();
-        </pre>
-
-        <p>When server #0 crashes, the client automatically detects the failure and automatically
-            fails over from server #0 to server #1 (in your real program you wouldn't need to sleep).
-        </p>
-        
-        <li>Acknowledging the 2nd third of the sent messages will fail as failover to the backup server has occurred</li>
-        <pre class="prettyprint">
-           try
-             {
-               message0.acknowledge();
-            }
-             catch (JMSException e)
-            {
-               System.err.println("Got exception while acknowledging message: " + e.getMessage());
-            }
-        </pre>
-        
-        <li>Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.</li>
-        <pre class="prettyprint">
-           for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++)
-            {
-              message0 = (TextMessage)consumer.receive(5000);
-             System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-             }
-         message0.acknowledge();
-        </pre>
-
-         <p>now we Kill server #1 and wait for the server #2 to take over the responsibilities.</p>
-
-        <li>Acknowledging the 3rd third of the sent messages will fail as failover to the backup server has occurred</li>
-        <pre class="prettyprint">
-           try
-            {
-               message0.acknowledge();
-           }
-           catch (JMSException e)
-          {
-                System.err.println("Got exception while acknowledging message: " + e.getMessage());
-             }
-        </pre>
-        
-
-        <li>Consume again the 3rd third of the messages again. Note that they are not considered as redelivered</li>
-        <pre class="prettyprint">
-            for (int i = (numMessages / 3) * 2; i < numMessages; i++)
-             {
-               message0 = (TextMessage)consumer.receive(5000);
-               System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-            }
-             message0.acknowledge();
-        </pre>
-        
-        <li>And finally, <strong>always</strong> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           finally
-           {
-              if (connection != null)
-              {
-                 connection.close();
-              }
-
-              if (initialContext != null)
-              {
-                 initialContext.close();
-              }
-           }
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/broker.xml b/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
index f59bdbc..f6fa349 100644
--- a/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <cluster-user>exampleUser</cluster-user>
 


Mime
View raw message