http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/queue-selector/src/main/java/org/apache/activemq/artemis/jms/example/QueueSelectorExample.java
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/queue-selector/src/main/java/org/apache/activemq/artemis/jms/example/QueueSelectorExample.java
 
b/examples/broker-features/standard/queue-selector/src/main/java/org/apache/activemq/artemis/jms/example/QueueSelectorExample.java
new file mode 100644
index 0000000..465a4e2
--- /dev/null
+++ 
b/examples/broker-features/standard/queue-selector/src/main/java/org/apache/activemq/artemis/jms/example/QueueSelectorExample.java
@@ -0,0 +1,143 @@
+/*
+ * 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.
+ */
+package org.apache.activemq.artemis.jms.example;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * A simple JMS example that uses selectors with queue consumers.
+ */
+public class QueueSelectorExample {
+
+   public static void main(final String[] args) throws Exception {
+      AtomicBoolean result = new AtomicBoolean(true);
+      Connection connection = null;
+      InitialContext initialContext = null;
+      try {
+         // Step 1. Create an initial context to perform the JNDI lookup.
+         initialContext = new InitialContext();
+
+         // Step 2. look-up the JMS queue object from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+
+         // Step 3. look-up the JMS connection factory object from JNDI
+         ConnectionFactory cf = (ConnectionFactory) 
initialContext.lookup("ConnectionFactory");
+
+         // Step 4. Create a JMS Connection
+         connection = cf.createConnection();
+
+         // Step 5. Start the connection
+         connection.start();
+
+         // Step 5. Create a JMS Session
+         Session senderSession = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
+
+         // Step 6. Create a JMS Message Producer
+         MessageProducer producer = senderSession.createProducer(queue);
+
+         // Step 8. Prepare two selectors
+         String redSelector = "color='red'";
+         String greenSelector = "color='green'";
+
+         // Step 9. Create a JMS Message Consumer that receives 'red' messages
+         Session redSession = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer redConsumer = redSession.createConsumer(queue, 
redSelector);
+         redConsumer.setMessageListener(new SimpleMessageListener("red", 
result));
+
+         // Step 10. Create a second JMS message consumer that receives 
'green' messages
+         Session greenSession = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer greenConsumer = greenSession.createConsumer(queue, 
greenSelector);
+         greenConsumer.setMessageListener(new SimpleMessageListener("green", 
result));
+
+         // Step 11. Create another JMS message consumer that receives any 
messages.
+         Session blankSession = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer anyConsumer = blankSession.createConsumer(queue);
+         anyConsumer.setMessageListener(new SimpleMessageListener("any", 
result));
+
+         // Step 12. Create three messages, each has a color property
+         TextMessage redMessage = senderSession.createTextMessage("Red");
+         redMessage.setStringProperty("color", "red");
+         TextMessage greenMessage = senderSession.createTextMessage("Green");
+         greenMessage.setStringProperty("color", "green");
+         TextMessage blueMessage = senderSession.createTextMessage("Blue");
+         blueMessage.setStringProperty("color", "blue");
+
+         // Step 13. Send the Messages
+         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());
+
+         Thread.sleep(5000);
+
+         if (!result.get())
+            throw new IllegalStateException();
+      }
+      finally {
+         // Step 12. Be sure to close our JMS resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}
+
+class SimpleMessageListener implements MessageListener {
+
+   private final String name;
+   private AtomicBoolean result;
+
+   public SimpleMessageListener(final String listener, AtomicBoolean result) {
+      name = listener;
+      this.result = result;
+   }
+
+   public void onMessage(final Message msg) {
+      TextMessage textMessage = (TextMessage) msg;
+      try {
+         String colorProp = msg.getStringProperty("color");
+         System.out.println("Receiver " + name +
+                               " receives message [" +
+                               textMessage.getText() +
+                               "] with color property: " +
+                               colorProp);
+         if (!colorProp.equals(name) && !name.equals("any")) {
+            result.set(false);
+         }
+      }
+      catch (JMSException e) {
+         e.printStackTrace();
+         result.set(false);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/queue-selector/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/queue-selector/src/main/resources/jndi.properties
 
b/examples/broker-features/standard/queue-selector/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ 
b/examples/broker-features/standard/queue-selector/src/main/resources/jndi.properties
@@ -0,0 +1,20 @@
+# 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.
+
+java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
+connectionFactory.ConnectionFactory=tcp://localhost:61616
+queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/queue/pom.xml 
b/examples/broker-features/standard/queue/pom.xml
new file mode 100644
index 0000000..e20a38c
--- /dev/null
+++ b/examples/broker-features/standard/queue/pom.xml
@@ -0,0 +1,109 @@
+<?xml version='1.0'?>
+<!--
+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.
+-->
+
+<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>
+      <groupId>org.apache.activemq.examples.broker</groupId>
+      <artifactId>jms-examples</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>queue</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Queue Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+   </dependencies>
+
+   <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.broker</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/21bf4406/examples/broker-features/standard/queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/queue/readme.html 
b/examples/broker-features/standard/queue/readme.html
new file mode 100644
index 0000000..0cdbd5f
--- /dev/null
+++ b/examples/broker-features/standard/queue/readme.html
@@ -0,0 +1,38 @@
+<!--
+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 Queue 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 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>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/queue/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/queue/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
 
b/examples/broker-features/standard/queue/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
new file mode 100644
index 0000000..b6ce381
--- /dev/null
+++ 
b/examples/broker-features/standard/queue/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
@@ -0,0 +1,84 @@
+/*
+ * 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.
+ */
+package org.apache.activemq.artemis.jms.example;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+/**
+ * A simple JMS Queue example that creates a producer and consumer on a queue 
and sends then receives a message.
+ */
+public class QueueExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection = null;
+      InitialContext initialContext = null;
+      try {
+         // Step 1. Create an initial context to perform the JNDI lookup.
+         initialContext = new InitialContext();
+
+         // Step 2. Perfom a lookup on the queue
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+
+         // Step 3. Perform a lookup on the Connection Factory
+         ConnectionFactory cf = (ConnectionFactory) 
initialContext.lookup("ConnectionFactory");
+
+         // Step 4.Create a JMS Connection
+         connection = cf.createConnection();
+
+         // Step 5. Create a JMS Session
+         Session session = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
+
+         // Step 6. Create a JMS Message Producer
+         MessageProducer producer = session.createProducer(queue);
+
+         // Step 7. Create a Text Message
+         TextMessage message = session.createTextMessage("This is a text 
message");
+
+         System.out.println("Sent message: " + message.getText());
+
+         // Step 8. Send the Message
+         producer.send(message);
+
+         // Step 9. Create a JMS Message Consumer
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         // Step 10. Start the Connection
+         connection.start();
+
+         // Step 11. Receive the message
+         TextMessage messageReceived = (TextMessage) 
messageConsumer.receive(5000);
+
+         System.out.println("Received message: " + messageReceived.getText());
+      }
+      finally {
+         // Step 12. Be sure to close our JMS resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/queue/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/queue/src/main/resources/jndi.properties 
b/examples/broker-features/standard/queue/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/broker-features/standard/queue/src/main/resources/jndi.properties
@@ -0,0 +1,20 @@
+# 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.
+
+java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
+connectionFactory.ConnectionFactory=tcp://localhost:61616
+queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/reattach-node/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/reattach-node/pom.xml 
b/examples/broker-features/standard/reattach-node/pom.xml
new file mode 100644
index 0000000..4683e86
--- /dev/null
+++ b/examples/broker-features/standard/reattach-node/pom.xml
@@ -0,0 +1,111 @@
+<?xml version='1.0'?>
+<!--
+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.
+-->
+
+<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>
+      <groupId>org.apache.activemq.examples.broker</groupId>
+      <artifactId>jms-examples</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>reattach-node</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Reattach Node Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+   </dependencies>
+
+   <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.broker</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/21bf4406/examples/broker-features/standard/reattach-node/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/reattach-node/readme.html 
b/examples/broker-features/standard/reattach-node/readme.html
new file mode 100644
index 0000000..bc7d090
--- /dev/null
+++ b/examples/broker-features/standard/reattach-node/readme.html
@@ -0,0 +1,55 @@
+<!--
+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 Automatic Reattach 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 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,
+     or the failure of a pong to arrive back from the server in good time 
after a ping is sent, instead of
+     failing the connection immediately and notifying any user 
ExceptionListener objects, ActiveMQ
+     can be configured to automatically retry the connection, and reattach to 
the server when it becomes
+     available again across the network.</p>
+     <p>When the client reattaches to the server it will be able to resume 
using its sessions and connections
+     where it left off</p>
+     <p>This is different to client reconnect as the sessions, consumers etc 
still exist on the server. With reconnect
+     The client recreates its sessions and consumers as needed.</p>
+    <p>This example starts a single server, connects to it and performs some 
JMS operations. We then
+     simulate failure of the network connection by temporarily stopping the 
network acceptor on the server.
+     (This is done by sending management messages, but that is not central to 
the purpose of the example).</p>
+     <p>We then wait a few seconds, then restart the acceptor. The client 
reattaches and the session resumes
+     as if nothing happened.</p>
+     <p>The JMS Connection Factory is configured to reattach automatically by 
specifying the various reconnect
+     related attributes in the <code>activemq-jms.xml</code> file.</p>
+
+     <p>For more details on how to configure this and for clustering in general
+     please consult the ActiveMQ Artemis user manual.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java
 
b/examples/broker-features/standard/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java
new file mode 100644
index 0000000..459c33b
--- /dev/null
+++ 
b/examples/broker-features/standard/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java
@@ -0,0 +1,150 @@
+/*
+ * 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.
+ */
+package org.apache.activemq.artemis.jms.example;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+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
+ *
+ * The network is brought back up and the client reconnects and resumes 
transparently.
+ */
+public class ReattachExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection = null;
+      InitialContext initialContext = null;
+
+      try {
+         // Step 1. Create an initial context to perform the JNDI lookup.
+         initialContext = new InitialContext();
+
+         // Step 2. Perform a lookup on the queue
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+
+         // Step 3. Perform a lookup on the Connection Factory
+         ConnectionFactory cf = (ConnectionFactory) 
initialContext.lookup("ConnectionFactory");
+
+         // Step 4. Create a JMS Connection
+         connection = cf.createConnection();
+
+         // Step 5. Create a JMS Session
+         Session session = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
+
+         // Step 6. Create a JMS Message Producer
+         MessageProducer producer = session.createProducer(queue);
+
+         // Step 7. Create a Text Message
+         TextMessage message = session.createTextMessage("This is a text 
message");
+
+         System.out.println("Sent message: " + message.getText());
+
+         // Step 8. Send the Message
+         producer.send(message);
+
+         // Step 9. Create a JMS Message Consumer
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         // Step 10. Start the Connection
+         connection.start();
+
+         // Step 11. To simulate a temporary problem on the network, we stop 
the remoting acceptor on the
+         // server which will close all connections
+         stopAcceptor();
+
+         System.out.println("Acceptor now stopped, will wait for 10 seconds. 
This simulates the network connection failing for a while");
+
+         // Step 12. Wait a while then restart the acceptor
+         Thread.sleep(10000);
+
+         System.out.println("Re-starting acceptor");
+
+         startAcceptor();
+
+         System.out.println("Restarted acceptor. The client will now 
reconnect.");
+
+         // Step 13. We receive the message
+         TextMessage messageReceived = (TextMessage) 
messageConsumer.receive(5000);
+
+         System.out.println("Received message: " + messageReceived.getText());
+      }
+      finally {
+         // Step 14. Be sure to close our JMS resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+
+   private static void stopAcceptor() throws Exception {
+      stopStartAcceptor(true);
+   }
+
+   private static void startAcceptor() throws Exception {
+      stopStartAcceptor(false);
+   }
+
+   // To do this we send a management message to close the acceptor, we do 
this on a different
+   // connection factory which uses a different remoting connection so we can 
still send messages
+   // when the main connection has been stopped
+   private static void stopStartAcceptor(final boolean stop) throws Exception {
+      ConnectionFactory cf = new 
ActiveMQConnectionFactory("tcp://localhost:61617");
+
+      Connection connection = null;
+      try {
+         connection = cf.createConnection();
+
+         Session session = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
+
+         Queue managementQueue = 
ActiveMQJMSClient.createQueue("activemq.management");
+
+         MessageProducer producer = session.createProducer(managementQueue);
+
+         connection.start();
+
+         Message m = session.createMessage();
+
+         String oper = stop ? "stop" : "start";
+
+         JMSManagementHelper.putOperationInvocation(m, 
"core.acceptor.netty-acceptor", oper);
+
+         producer.send(m);
+      }
+      finally {
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/reattach-node/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/reattach-node/src/main/resources/activemq/server0/artemis-roles.properties
 
b/examples/broker-features/standard/reattach-node/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..d82bc7e
--- /dev/null
+++ 
b/examples/broker-features/standard/reattach-node/src/main/resources/activemq/server0/artemis-roles.properties
@@ -0,0 +1,17 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+guest=guest,admin
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/reattach-node/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/reattach-node/src/main/resources/activemq/server0/artemis-users.properties
 
b/examples/broker-features/standard/reattach-node/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ 
b/examples/broker-features/standard/reattach-node/src/main/resources/activemq/server0/artemis-users.properties
@@ -0,0 +1,17 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml
 
b/examples/broker-features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..07e09bb
--- /dev/null
+++ 
b/examples/broker-features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,82 @@
+<?xml version='1.0'?>
+<!--
+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.
+-->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+               xmlns="urn:activemq"
+               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
+
+   <jms xmlns="urn:activemq:jms">
+      <!--the queue used by the example-->
+      <queue name="exampleQueue"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>./data/bindings</bindings-directory>
+
+      <journal-directory>./data/journal</journal-directory>
+
+      <large-messages-directory>./data/largemessages</large-messages-directory>
+
+      <paging-directory>./data/paging</paging-directory>
+
+      <!-- Connectors -->
+
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+
+         <!-- We just use this connector so we can send management operations 
while the other acceptor
+         is stopped -->
+         <connector name="netty-connector2">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+
+         <!-- We just use this acceptor so we can send management operations 
while the other acceptor
+         is stopped -->
+         <acceptor name="netty-acceptor2">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+
+         <!--security for example queue-->
+         <security-setting match="jms.queue.exampleQueue">
+            <permission type="createDurableQueue" roles="guest"/>
+            <permission type="deleteDurableQueue" roles="guest"/>
+            <permission type="createNonDurableQueue" roles="guest"/>
+            <permission type="deleteNonDurableQueue" roles="guest"/>
+            <permission type="consume" roles="guest"/>
+            <permission type="send" roles="guest"/>
+         </security-setting>
+
+         <security-setting match="jms.queue.activemq.management">
+            <!--  only the admin role can interact with the management address 
 -->
+            <permission type="consume" roles="admin"/>
+            <permission type="send" roles="admin"/>
+            <permission type="manage" roles="admin"/>
+         </security-setting>
+      </security-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/reattach-node/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/reattach-node/src/main/resources/jndi.properties
 
b/examples/broker-features/standard/reattach-node/src/main/resources/jndi.properties
new file mode 100644
index 0000000..b6f8ff8
--- /dev/null
+++ 
b/examples/broker-features/standard/reattach-node/src/main/resources/jndi.properties
@@ -0,0 +1,20 @@
+# 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.
+
+java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
+connectionFactory.ConnectionFactory=tcp://localhost:61616?retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1&failoverOnServerShutdown=true&confirmationWindowSize=1048576
+queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/request-reply/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/request-reply/pom.xml 
b/examples/broker-features/standard/request-reply/pom.xml
new file mode 100644
index 0000000..b4474b0
--- /dev/null
+++ b/examples/broker-features/standard/request-reply/pom.xml
@@ -0,0 +1,112 @@
+<?xml version='1.0'?>
+<!--
+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.
+-->
+
+<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>
+      <groupId>org.apache.activemq.examples.broker</groupId>
+      <artifactId>jms-examples</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>request-reply</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Request Reply Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+   </dependencies>
+
+   <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>
+                     <args>
+                        <arg>--queues</arg>
+                        <arg>exampleQueue</arg>
+                     </args>
+                  </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.RequestReplyExample</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.broker</groupId>
+                  <artifactId>request-reply</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/request-reply/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/request-reply/readme.html 
b/examples/broker-features/standard/request-reply/readme.html
new file mode 100644
index 0000000..73d278d
--- /dev/null
+++ b/examples/broker-features/standard/request-reply/readme.html
@@ -0,0 +1,180 @@
+<!--
+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 Request-Reply 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 Request-Reply Example</h1>
+
+     <p>This example shows you how to handle a request message and receive a 
reply. To get a reply message, the requesting client creates a temporary queue. 
Then it sends out the request message with JMSReplyTo set to the temporary 
queue. The request message is handled by a SimpleRequestServer, who is 
listening to the request queue for incoming requests. If a request message has 
arrived, it extracts the reply queue from the request message by JMSReplyTo 
header, and sends back a reply message. To let the client know to which request 
message a reply message is related, the server also set the JMSCorrelationID 
with the request message's JMSMessageID header to the reply message.</p>
+<p>Of course, in a real world example you would re-use the session, producer, 
consumer and temporary queue and not create a new one for each message!
+Or better still use the correlation id, and just store the requests in a map, 
then you don't need a temporary queue at all
+
+     <p>Request/Reply style messaging is supported through standard JMS 
message headers JMSReplyTo and JMSCorrelationID. This is often used in 
request-reply style communications between applications.
+     Whenever a client sends a message that expects a response, it can use 
this mechanism to implement. please consult the JMS 1.1 specification for full 
details.</p>
+
+     <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>We start the request server</li>
+        <pre class="prettyprint">
+           <code>SimpleRequestServer server = new SimpleRequestServer();</code>
+           <code>server.start();</code>
+        </pre>
+
+        <li>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 = getContext();</code>
+        </pre>
+
+        <li>We lookup the queue for sending the request message</li>
+        <pre class="prettyprint">
+           <code>Queue requestQueue = (Queue) 
initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>We lookup for 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 start the connection</li>
+        <pre class="prettyprint">
+           <code>connection.start();</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 to send request message</li>
+        <pre class="prettyprint">
+           <code>MessageProducer producer = 
session.createProducer(requestQueue);</code>
+        </pre>
+
+        <li>We create a temporary queue used to send reply message to and 
receive reply from</li>
+        <pre class="prettyprint">
+           <code>TemporaryQueue replyQueue = 
session.createTemporaryQueue();</code>
+        </pre>
+
+        <li>We create a consumer to receive reply message</li>
+        <pre class="prettyprint">
+           <code>MessageConsumer replyConsumer = 
session.createConsumer(replyQueue);</code>
+        </pre>
+
+        <li>We create a request Text Message</li>
+        <pre class="prettyprint">
+           <code>TextMessage requestMsg = session.createTextMessage("A request 
message");</code>
+        </pre>
+
+        <li>We set the ReplyTo header so that the request receiver knows where 
to send the reply.</li>
+        <pre class="prettyprint">
+           <code>requestMsg.setJMSReplyTo(replyQueue);</code>
+        </pre>
+
+        <li>We sent the request message</li>
+        <pre class="prettyprint">
+           <code>producer.send(requestMsg);</code>
+        </pre>
+
+        <li>We put the request message to the map. Later we use it to check 
out which request message a reply message is for. Here we use the MessageID as 
the correlation id (JMSCorrelationID). You don't have to use it though. You can 
use some arbitrary string for example.</li>
+        <pre class="prettyprint">
+           <code>requestMap.put(requestMsg.getJMSMessageID(), 
requestMsg);</code>
+        </pre>
+
+        <li>We receive the reply message</li>
+        <pre class="prettyprint">
+           <code>TextMessage replyMessageReceived = 
(TextMessage)replyConsumer.receive();</code>
+        </pre>
+
+        <li>We check out which request message is this reply message sent for. 
Here we just have one request message for illustrative purpose. In real world 
there may be many requests and many replies.</li>
+        <pre class="prettyprint">
+           <code>TextMessage matchedMessage = 
requestMap.get(replyMessageReceived.getJMSCorrelationID());</code>
+        </pre>
+
+        <li>We close the consumer and producer on the replyQueue</li>
+        <pre class="prettyprint">
+           <code>replyConsumer.close();</code>
+        </pre>
+
+        <li>We delete the temporary queue</li>
+        <pre class="prettyprint">
+           <code>replyQueue.delete();</code>
+        </pre>
+
+        <li>We shutdown the request server</li>
+        <pre class="prettyprint">
+           <code>server.shutdown();</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>
+
+     Request Messages are handled in SimpleRequestServer.onMessage(),
+
+     <ol>
+        <li>Extract the ReplyTo destination</li>
+        <pre class="prettyprint">
+           <code>Destination replyDestination = request.getJMSReplyTo();</code>
+        </pre>
+
+        <li>Create the reply message</li>
+        <pre class="prettyprint">
+           <code>TextMessage replyMessage = session.createTextMessage("A reply 
message");</code>
+        </pre>
+
+        <li>Set the CorrelationID</li>
+        <pre class="prettyprint">
+           
<code>replyMessage.setJMSCorrelationID(request.getJMSCorrelationID());</code>
+        </pre>
+
+        <li>Send out the reply message</li>
+        <pre class="prettyprint">
+           <code>replyProducer.send(replyMessage);</code>
+        </pre>
+     </ol>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/request-reply/src/main/java/org/apache/activemq/artemis/jms/example/RequestReplyExample.java
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/request-reply/src/main/java/org/apache/activemq/artemis/jms/example/RequestReplyExample.java
 
b/examples/broker-features/standard/request-reply/src/main/java/org/apache/activemq/artemis/jms/example/RequestReplyExample.java
new file mode 100644
index 0000000..5d2e4dc
--- /dev/null
+++ 
b/examples/broker-features/standard/request-reply/src/main/java/org/apache/activemq/artemis/jms/example/RequestReplyExample.java
@@ -0,0 +1,202 @@
+/*
+ * 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.
+ */
+package org.apache.activemq.artemis.jms.example;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TemporaryQueue;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+/**
+ * A simple JMS example that shows how to use Request/Replay style messaging.
+ *
+ * Of course, in a real world example you would re-use the session, producer, 
consumer and temporary queue
+ * and not create a new one for each message!
+ *
+ * Or better still use the correlation id, and just store the requests in a 
map, then you don't need a temporary queue at all
+ */
+public class RequestReplyExample {
+
+   public static void main(final String[] args) throws Exception {
+      final Map<String, TextMessage> requestMap = new HashMap<String, 
TextMessage>();
+      Connection connection = null;
+      InitialContext initialContext = null;
+
+      try {
+         // Step 1. Start the request server
+         SimpleRequestServer server = new SimpleRequestServer();
+         server.start();
+
+         // Step 2. Create an initial context to perform the JNDI lookup.
+         initialContext = new InitialContext();
+
+         // Step 3. Lookup the queue for sending the request message
+         Queue requestQueue = (Queue) 
initialContext.lookup("queue/exampleQueue");
+
+         // Step 4. Lookup for the Connection Factory
+         ConnectionFactory cf = (ConnectionFactory) 
initialContext.lookup("ConnectionFactory");
+
+         // Step 5. Create a JMS Connection
+         connection = cf.createConnection();
+
+         // Step 6. Start the connection.
+         connection.start();
+
+         // Step 7. Create a JMS Session
+         Session session = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
+
+         // Step 8. Create a JMS Message Producer to send request message
+         MessageProducer producer = session.createProducer(requestQueue);
+
+         // Step 9. Create a temporary queue used to send reply message
+         TemporaryQueue replyQueue = session.createTemporaryQueue();
+
+         // Step 10. Create consumer to receive reply message
+         MessageConsumer replyConsumer = session.createConsumer(replyQueue);
+
+         // Step 11. Create a request Text Message
+         TextMessage requestMsg = session.createTextMessage("A request 
message");
+
+         // Step 12. Set the ReplyTo header so that the request receiver knows 
where to send the reply.
+         requestMsg.setJMSReplyTo(replyQueue);
+
+         // Step 13. Sent the request message
+         producer.send(requestMsg);
+
+         System.out.println("Request message sent.");
+
+         // Step 14. Put the request message to the map. Later we can use it to
+         // check out which request message a reply message is for. Here we 
use the MessageID as the
+         // correlation id (JMSCorrelationID). You don't have to use it 
though. You can use some arbitrary string for
+         // example.
+         requestMap.put(requestMsg.getJMSMessageID(), requestMsg);
+
+         // Step 15. Receive the reply message.
+         TextMessage replyMessageReceived = (TextMessage) 
replyConsumer.receive();
+
+         System.out.println("Received reply: " + 
replyMessageReceived.getText());
+         System.out.println("CorrelatedId: " + 
replyMessageReceived.getJMSCorrelationID());
+
+         // Step 16. Check out which request message is this reply message 
sent for.
+         // Here we just have one request message for illustrative purpose. In 
real world there may be many requests and
+         // many replies.
+         TextMessage matchedMessage = 
requestMap.get(replyMessageReceived.getJMSCorrelationID());
+
+         System.out.println("We found matched request: " + 
matchedMessage.getText());
+
+         // Step 17. close the consumer.
+         replyConsumer.close();
+
+         // Step 18. Delete the temporary queue
+         replyQueue.delete();
+
+         // Step 19. Shutdown the request server
+         server.shutdown();
+      }
+      finally {
+         // Step 20. Be sure to close our JMS resources!
+         if (connection != null) {
+            connection.close();
+         }
+         // Step 21. Also close the initialContext!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+      }
+   }
+}
+
+class SimpleRequestServer implements MessageListener {
+
+   private Connection connection;
+
+   private Session session;
+
+   MessageProducer replyProducer;
+
+   MessageConsumer requestConsumer;
+
+   public void start() throws Exception {
+      // Get an initial context to perform the JNDI lookup.
+      InitialContext initialContext = new InitialContext();
+
+      // Lookup the queue to receive the request message
+      Queue requestQueue = (Queue) initialContext.lookup("queue/exampleQueue");
+
+      // Lookup for the Connection Factory
+      ConnectionFactory cfact = (ConnectionFactory) 
initialContext.lookup("ConnectionFactory");
+
+      // Create a connection
+      connection = cfact.createConnection();
+
+      // Start the connection;
+      connection.start();
+
+      // Create a session
+      session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+      // Create a producer to send the reply message
+      replyProducer = session.createProducer(null);
+
+      // Create the request comsumer
+      requestConsumer = session.createConsumer(requestQueue);
+
+      // register the listener
+      requestConsumer.setMessageListener(this);
+   }
+
+   public void onMessage(final Message request) {
+      try {
+         System.out.println("Received request message: " + ((TextMessage) 
request).getText());
+
+         // Extract the ReplyTo destination
+         Destination replyDestination = request.getJMSReplyTo();
+
+         System.out.println("Reply to queue: " + replyDestination);
+
+         // Create the reply message
+         TextMessage replyMessage = session.createTextMessage("A reply 
message");
+
+         // Set the CorrelationID, using message id.
+         replyMessage.setJMSCorrelationID(request.getJMSMessageID());
+
+         // Send out the reply message
+         replyProducer.send(replyDestination, replyMessage);
+
+         System.out.println("Reply sent");
+      }
+      catch (JMSException e) {
+         e.printStackTrace();
+      }
+   }
+
+   public void shutdown() throws JMSException {
+      connection.close();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/request-reply/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/request-reply/src/main/resources/jndi.properties
 
b/examples/broker-features/standard/request-reply/src/main/resources/jndi.properties
new file mode 100644
index 0000000..7f7a19f
--- /dev/null
+++ 
b/examples/broker-features/standard/request-reply/src/main/resources/jndi.properties
@@ -0,0 +1,20 @@
+# 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.
+
+java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
+connectionFactory.ConnectionFactory=tcp://localhost:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1
+queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/rest/dup-send/README.txt
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/dup-send/README.txt 
b/examples/broker-features/standard/rest/dup-send/README.txt
new file mode 100644
index 0000000..0e794b8
--- /dev/null
+++ b/examples/broker-features/standard/rest/dup-send/README.txt
@@ -0,0 +1,41 @@
+System Requirements:
+You will need JDK 1.6 and Maven to run this example.  This example has been 
tested with Maven 2.2.1.  It may or may not work 
+with earlier or later versions of Maven.
+
+
+This is an example of using duplicate detection for posted messages.  The 
first file to look at is:
+
+src/main/resource/activemq-rest.xml
+
+You see that by default, all messages posted to msg-create URLs will follow 
the duplicate detection pattern talked
+about in the documentation.
+
+To run the example you will need 3 shell-script windows (or you'll need to run 
2 processes in background)
+
+Step 1:
+$ mvn jetty:run
+
+This will bring up ActiveMQ Artemis and the ActiveMQ Artemis REST Interface.
+
+Step 2:
+$ mvn exec:java -Dexec.mainClass="ReceiveOrder"
+
+This will bring up a REST client that is continuously pulling the server 
through a consume-next (see doco for details).
+
+Step 3:
+$ mvn exec:java -Dexec.mainClass="PostOrder"
+
+This class will post 3 orders.  The first order will cause the 307 redirection 
as stated in the docs.  A 2nd order
+will be posted twice through the same consume-next URL.  You'll see from the 
ReceiveOrder process that only 2 messages
+are actually processed through the queue (instead of the 3 posts that were 
done).
+
+Step 4:
+
+In Step 4, you will use the create-with-id URL published by the container.  To 
run the example, you must pass in
+your own order id.  For example:
+
+$ mvn exec:java -Dexec.mainClass="PostOrderWithId" -Dexec.args="001"
+
+If you run this program with the same argument you'll see that only one of the 
messages passes through the queue
+and is consumed by the ReceiveOrder process.  Pass a different string to 
-Dexec.args to post a new message that
+isn't caught by the dup-detection facility.

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/rest/dup-send/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/dup-send/pom.xml 
b/examples/broker-features/standard/rest/dup-send/pom.xml
new file mode 100644
index 0000000..f31240a
--- /dev/null
+++ b/examples/broker-features/standard/rest/dup-send/pom.xml
@@ -0,0 +1,170 @@
+<?xml version='1.0'?>
+<!--
+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.
+-->
+
+<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>
+      <groupId>org.apache.activemq.examples.rest</groupId>
+      <artifactId>artemis-rests-pom</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+   <artifactId>dup-send</artifactId>
+   <packaging>war</packaging>
+   <name>Duplicate Send Demo</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../../..</activemq.basedir>
+   </properties>
+
+   <repositories>
+      <repository>
+         <id>jboss</id>
+         <url>http://repository.jboss.org/nexus/content/groups/public/</url>
+      </repository>
+   </repositories>
+
+   <profiles>
+      <profile>
+         <id>example</id>
+         <build>
+            <finalName>order-flow</finalName>
+            <plugins>
+               <plugin>
+                  <groupId>org.apache.maven.plugins</groupId>
+                  <artifactId>maven-surefire-plugin</artifactId>
+                  <configuration>
+                     <skip>true</skip>
+                  </configuration>
+                  <executions>
+                     <execution>
+                        <id>surefire-it</id>
+                        <phase>integration-test</phase>
+                        <goals>
+                           <goal>test</goal>
+                        </goals>
+                        <configuration>
+                           <skip>false</skip>
+                        </configuration>
+                     </execution>
+                  </executions>
+               </plugin>
+               <plugin>
+                  <groupId>org.codehaus.mojo</groupId>
+                  <artifactId>exec-maven-plugin</artifactId>
+                  <version>1.1</version>
+                  <executions>
+                     <execution>
+                        <goals>
+                           <goal>java</goal>
+                        </goals>
+                     </execution>
+                  </executions>
+               </plugin>
+               <plugin>
+                  <groupId>org.mortbay.jetty</groupId>
+                  <artifactId>maven-jetty-plugin</artifactId>
+                  <version>6.1.15</version>
+                  <configuration>
+                     <!-- By default the artifactId is taken, override it with 
something simple -->
+                     <contextPath>/</contextPath>
+                     <scanIntervalSeconds>2</scanIntervalSeconds>
+                     <stopKey>foo</stopKey>
+                     <stopPort>9999</stopPort>
+                     <connectors>
+                        <connector 
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+                           <port>9095</port>
+                           <maxIdleTime>60000</maxIdleTime>
+                        </connector>
+                     </connectors>
+                  </configuration>
+                  <executions>
+                     <execution>
+                        <id>start-jetty</id>
+                        <phase>pre-integration-test</phase>
+                        <goals>
+                           <goal>run</goal>
+                        </goals>
+                        <configuration>
+                           <scanIntervalSeconds>0</scanIntervalSeconds>
+                           <daemon>true</daemon>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop-jetty</id>
+                        <phase>post-integration-test</phase>
+                        <goals>
+                           <goal>stop</goal>
+                        </goals>
+                     </execution>
+                  </executions>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
+   </profiles>
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-core-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>io.netty</groupId>
+         <artifactId>netty-all</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.geronimo.specs</groupId>
+         <artifactId>geronimo-jms_2.0_spec</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq.rest</groupId>
+         <artifactId>artemis-rest</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.resteasy</groupId>
+         <artifactId>resteasy-jaxrs</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.resteasy</groupId>
+         <artifactId>resteasy-jaxb-provider</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>junit</groupId>
+         <artifactId>junit</artifactId>
+         <scope>test</scope>
+      </dependency>
+   </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/rest/dup-send/src/main/java/Order.java
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/rest/dup-send/src/main/java/Order.java 
b/examples/broker-features/standard/rest/dup-send/src/main/java/Order.java
new file mode 100644
index 0000000..2b938f7
--- /dev/null
+++ b/examples/broker-features/standard/rest/dup-send/src/main/java/Order.java
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
+
+@XmlRootElement(name = "order")
+public class Order implements Serializable {
+
+   private String name;
+   private String amount;
+   private String item;
+
+   public Order() {
+   }
+
+   public Order(String name, String amount, String item) {
+      this.name = name;
+      this.amount = amount;
+      this.item = item;
+   }
+
+   public String getName() {
+      return name;
+   }
+
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   public String getAmount() {
+      return amount;
+   }
+
+   public void setAmount(String amount) {
+      this.amount = amount;
+   }
+
+   public String getItem() {
+      return item;
+   }
+
+   public void setItem(String item) {
+      this.item = item;
+   }
+
+   @Override
+   public String toString() {
+      return "Order{" +
+         "name='" + name + '\'' +
+         ", amount='" + amount + '\'' +
+         ", item='" + item + '\'' +
+         '}';
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/rest/dup-send/src/main/java/PostOrder.java
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/rest/dup-send/src/main/java/PostOrder.java 
b/examples/broker-features/standard/rest/dup-send/src/main/java/PostOrder.java
new file mode 100644
index 0000000..a864e44
--- /dev/null
+++ 
b/examples/broker-features/standard/rest/dup-send/src/main/java/PostOrder.java
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+
+import org.jboss.resteasy.client.ClientRequest;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.spi.Link;
+
+public class PostOrder {
+
+   public static void main(String[] args) throws Exception {
+      // first get the create URL for the shipping queue
+      ClientRequest request = new 
ClientRequest("http://localhost:9095/queues/jms.queue.orders";);
+      ClientResponse res = request.head();
+      Link create = res.getHeaderAsLink("msg-create");
+
+      System.out.println("Send Bill's order...");
+      Order order = new Order();
+      order.setName("Bill");
+      order.setItem("iPhone4");
+      order.setAmount("$199.99");
+
+      res = create.request().body("application/xml", order).post();
+
+      if (res.getStatus() == 307) {
+         Link redirect = res.getLocationLink();
+         res.releaseConnection();
+         res = redirect.request().body("application/xml", order).post();
+      }
+
+      if (res.getStatus() != 201)
+         throw new RuntimeException("Failed to post");
+
+      create = res.getHeaderAsLink("msg-create-next");
+
+      if (res.getStatus() != 201)
+         throw new RuntimeException("Failed to post");
+
+      System.out.println("Send Monica's order...");
+      order.setName("Monica");
+
+      res.releaseConnection();
+      res = create.request().body("application/xml", order).post();
+
+      if (res.getStatus() != 201)
+         throw new RuntimeException("Failed to post");
+
+      System.out.println("Resend Monica's order over same create-next 
link...");
+
+      res.releaseConnection();
+      res = create.request().body("application/xml", order).post();
+
+      if (res.getStatus() != 201)
+         throw new RuntimeException("Failed to post");
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/rest/dup-send/src/main/java/PostOrderWithId.java
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/rest/dup-send/src/main/java/PostOrderWithId.java
 
b/examples/broker-features/standard/rest/dup-send/src/main/java/PostOrderWithId.java
new file mode 100644
index 0000000..6b610e7
--- /dev/null
+++ 
b/examples/broker-features/standard/rest/dup-send/src/main/java/PostOrderWithId.java
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+import org.jboss.resteasy.client.ClientRequest;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.spi.Link;
+
+public class PostOrderWithId {
+
+   public static void main(String[] args) throws Exception {
+      if (args.length < 1 || args[0] == null)
+         throw new RuntimeException("You must pass in a parameter");
+
+      // first get the create URL for the shipping queue
+      ClientRequest request = new 
ClientRequest("http://localhost:9095/queues/jms.queue.orders";);
+      ClientResponse res = request.head();
+      Link create = res.getHeaderAsLink("msg-create-with-id");
+
+      Order order = new Order();
+      order.setName(args[0]);
+      order.setItem("iPhone4");
+      order.setAmount("$199.99");
+
+      res = create.request().pathParameter("id", 
args[0]).body("application/xml", order).post();
+
+      if (res.getStatus() != 201)
+         throw new RuntimeException("Failed to post");
+
+      System.out.println("Sent order " + args[0]);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/rest/dup-send/src/main/java/ReceiveOrder.java
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/rest/dup-send/src/main/java/ReceiveOrder.java
 
b/examples/broker-features/standard/rest/dup-send/src/main/java/ReceiveOrder.java
new file mode 100644
index 0000000..a00d110
--- /dev/null
+++ 
b/examples/broker-features/standard/rest/dup-send/src/main/java/ReceiveOrder.java
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+
+import org.jboss.resteasy.client.ClientRequest;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.spi.Link;
+
+public class ReceiveOrder {
+
+   public static void main(String[] args) throws Exception {
+      // first get the create URL for the shipping queue
+      ClientRequest request = new 
ClientRequest("http://localhost:9095/queues/jms.queue.orders";);
+      ClientResponse res = request.head();
+      Link pullConsumers = res.getHeaderAsLink("msg-pull-consumers");
+      res.releaseConnection();
+      res = pullConsumers.request().post();
+      Link consumeNext = res.getHeaderAsLink("msg-consume-next");
+      res.releaseConnection();
+      while (true) {
+         System.out.println("Waiting...");
+         res = consumeNext.request().header("Accept-Wait", "10").post();
+         if (res.getStatus() == 503) {
+            System.out.println("Timeout...");
+            consumeNext = res.getHeaderAsLink("msg-consume-next");
+         }
+         else if (res.getStatus() == 200) {
+            Order order = (Order) res.getEntity(Order.class);
+            System.out.println(order);
+            consumeNext = res.getHeaderAsLink("msg-consume-next");
+         }
+         else {
+            throw new RuntimeException("Failure! " + res.getStatus());
+         }
+         res.releaseConnection();
+      }
+   }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/rest/dup-send/src/main/resources/activemq-client.xml
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/rest/dup-send/src/main/resources/activemq-client.xml
 
b/examples/broker-features/standard/rest/dup-send/src/main/resources/activemq-client.xml
new file mode 100644
index 0000000..6fe4547
--- /dev/null
+++ 
b/examples/broker-features/standard/rest/dup-send/src/main/resources/activemq-client.xml
@@ -0,0 +1,36 @@
+<?xml version='1.0'?>
+<!--
+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.
+-->
+
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+            xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
+
+   <jms xmlns="urn:activemq:jms">
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+      </connectors>
+   </core>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/21bf4406/examples/broker-features/standard/rest/dup-send/src/main/resources/activemq-rest.xml
----------------------------------------------------------------------
diff --git 
a/examples/broker-features/standard/rest/dup-send/src/main/resources/activemq-rest.xml
 
b/examples/broker-features/standard/rest/dup-send/src/main/resources/activemq-rest.xml
new file mode 100644
index 0000000..c1a7f21
--- /dev/null
+++ 
b/examples/broker-features/standard/rest/dup-send/src/main/resources/activemq-rest.xml
@@ -0,0 +1,23 @@
+<?xml version='1.0'?>
+<!--
+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.
+-->
+
+<rest-messaging>
+    <dups-ok>false</dups-ok>
+</rest-messaging>

Reply via email to