You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2018/03/01 21:23:02 UTC

[5/9] activemq-artemis git commit: NO-JIRA fix-up examples

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/mqtt/basic-pubsub/readme.md
----------------------------------------------------------------------
diff --git a/examples/protocols/mqtt/basic-pubsub/readme.md b/examples/protocols/mqtt/basic-pubsub/readme.md
deleted file mode 100644
index a8207e1..0000000
--- a/examples/protocols/mqtt/basic-pubsub/readme.md
+++ /dev/null
@@ -1,69 +0,0 @@
-# MQTT Example
-
-This is a basic MQTT example that demonstrates how to setup and connect to an Apache Artemis broker and send and receive messages using the MQTT protocol.
-
-## Setting up the Broker
-
-This example will use the default out of the box configuration of Artemis you don't need to change anything to run this example. Artemis ships with all protocols enabled on port 61616 and also MQTT on port 1883. To enable MQTT on a different port you can add the following XML snippet to the `acceptors` section of your broker.xml configuration file (changing the port from 1883 to what ever you require).
-
-    <acceptor name="mqtt">tcp://0.0.0.0:1883?protocols=MQTT"></acceptor>
-
-For more information on configuring protocol transports see the "Configuring Transports" section of the user manual, specifically the section called "Single Port Support".
-
-## MQTT Clients
-
-There are a number of MQTT client implementations for various languages. The Paho project: https://www.eclipse.org/paho/ offers a number of clients for languages such as C, Python, JavaScript and .Net and is also a great resource for all things MQTT. This example is actually based on the Fuse MQTT java client and was chosen as it is Apache 2.0 licensed and available to download from maven central. The specific client used in the example is not of importance and is used simply to demonstrate the features of MQTT as provided by Apache Artemis.
-
-If you'd like to use the client demonstrated in this example, simple add the following dependency to your pom.xml
-
-    <dependency>
-       <groupId>org.fusesource.mqtt-client</groupId>
-       <artifactId>mqtt-client</artifactId>
-       <version>1.10</version>
-    </dependency>
-
-## Example Step by Step
-
-* Connect to Artemis
-
-We start by creating a connection to the Apache Artemis broker. In this example we specify to use TCP protocol on localhost. By default Apache Artemis will start all protocols on port 61616, so we connect to that port.
-
-    MQTT mqtt = new MQTT();
-    mqtt.setHost("tcp://localhost:61616");
-    BlockingConnection connection = mqtt.blockingConnection();
-    connection.connect();
-
-* Create subscriptions
-
-Subscriptions in MQTT are realised by subscribing to a particular Topic. Each Topic has an address and a quality of service level (QoS level). Subscriptions also support wildcards. In the code below we subscribe to a Topic with address "mqtt/example/publish", a wildcard address "test/#" which will match anything starting with "test/" and also a wildcard "foo/+/bar", where + matches a single level of the hierarchy (foo/something/bar)
-
-    Topic[] topics = { new Topic("mqtt/example/publish", QoS.AT_LEAST_ONCE), new Topic("test/#", QoS.EXACTLY_ONCE), new Topic("foo/+/bar", QoS.AT_LEAST_ONCE) };
-    connection.subscribe(topics);
-
-* Sending messages
-
-There is no type system in MQTT, messages simply consist of a number of bytes. Below we send three messages with UTF8 encoded strings (as a byte array). Notice the second message is sent to "test/test" which should match the first wildcard subscription we defined previously. The third message is sent to "foo/1/bar", which matches the second wildcard subscription.
-
-    String payload1 = "This is message 1";
-    String payload2 = "This is message 2";
-    String payload3 = "This is message 3";
-
-    connection.publish("mqtt/example/publish", payload1.getBytes(), QoS.AT_LEAST_ONCE, false);
-    connection.publish("mqtt/test", payload2.getBytes(), QoS.AT_MOST_ONCE, false);
-    connection.publish("foo/1/bar", payload3.getBytes(), QoS.AT_MOST_ONCE, false);
-
-* Receiving messages
-
-Since we have subscribed to a number of topics and sent messages to them, the client should now receive 2 messages. We are not using callbacks here on message receive so we specifically call receive to get the messages. Once we receive the message we convert the payload consisting of bytes back to a UTF8 encoded string and print the result.
-    
-    Message message1 = connection.receive(5, TimeUnit.SECONDS);
-    Message message2 = connection.receive(5, TimeUnit.SECONDS);
-    Message message3 = connection.receive(5, TimeUnit.SECONDS);
-
-    System.out.println(new String(message1.getPayload()));
-    System.out.println(new String(message2.getPayload()));
-    System.out.println(new String(message3.getPayload()));
-
-## Result
-
-This example has shown you how to set up the basics of MQTT including how to connect to the Artemis broker and how to send and receive messages including subscriptions using wildcard addresses.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/mqtt/basic-pubsub/src/main/java/org/apache/activemq/artemis/mqtt/example/MQTTBasicPubSubExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/mqtt/basic-pubsub/src/main/java/org/apache/activemq/artemis/mqtt/example/MQTTBasicPubSubExample.java b/examples/protocols/mqtt/basic-pubsub/src/main/java/org/apache/activemq/artemis/mqtt/example/MQTTBasicPubSubExample.java
deleted file mode 100644
index dd64731..0000000
--- a/examples/protocols/mqtt/basic-pubsub/src/main/java/org/apache/activemq/artemis/mqtt/example/MQTTBasicPubSubExample.java
+++ /dev/null
@@ -1,65 +0,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.
- */
-package org.apache.activemq.artemis.mqtt.example;
-
-import java.util.concurrent.TimeUnit;
-
-import org.fusesource.mqtt.client.BlockingConnection;
-import org.fusesource.mqtt.client.MQTT;
-import org.fusesource.mqtt.client.Message;
-import org.fusesource.mqtt.client.QoS;
-import org.fusesource.mqtt.client.Topic;
-
-/**
- * A simple MQTT publish and subscribe example.
- */
-public class MQTTBasicPubSubExample {
-
-   public static void main(final String[] args) throws Exception {
-      // Create a new MQTT connection to the broker.  We are not setting the client ID.  The broker will pick one for us.
-      System.out.println("Connecting to Artemis using MQTT");
-      MQTT mqtt = new MQTT();
-      mqtt.setHost("tcp://localhost:1883");
-      BlockingConnection connection = mqtt.blockingConnection();
-      connection.connect();
-      System.out.println("Connected to Artemis");
-
-      // Subscribe to topics
-      Topic[] topics = {new Topic("mqtt/example/publish", QoS.AT_LEAST_ONCE), new Topic("test/#", QoS.EXACTLY_ONCE), new Topic("foo/+/bar", QoS.AT_LEAST_ONCE)};
-      connection.subscribe(topics);
-      System.out.println("Subscribed to topics.");
-
-      // Publish Messages
-      String payload1 = "This is message 1";
-      String payload2 = "This is message 2";
-      String payload3 = "This is message 3";
-
-      connection.publish("mqtt/example/publish", payload1.getBytes(), QoS.AT_LEAST_ONCE, false);
-      connection.publish("test/test", payload2.getBytes(), QoS.AT_MOST_ONCE, false);
-      connection.publish("foo/1/bar", payload3.getBytes(), QoS.AT_MOST_ONCE, false);
-      System.out.println("Sent messages.");
-
-      Message message1 = connection.receive(5, TimeUnit.SECONDS);
-      Message message2 = connection.receive(5, TimeUnit.SECONDS);
-      Message message3 = connection.receive(5, TimeUnit.SECONDS);
-      System.out.println("Received messages.");
-
-      System.out.println(new String(message1.getPayload()));
-      System.out.println(new String(message2.getPayload()));
-      System.out.println(new String(message3.getPayload()));
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/mqtt/clustered-queue-mqtt/pom.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/mqtt/clustered-queue-mqtt/pom.xml b/examples/protocols/mqtt/clustered-queue-mqtt/pom.xml
index 190cfbe..be1d87f 100644
--- a/examples/protocols/mqtt/clustered-queue-mqtt/pom.xml
+++ b/examples/protocols/mqtt/clustered-queue-mqtt/pom.xml
@@ -29,7 +29,7 @@ under the License.
 
    <artifactId>clustered-queue-mqtt</artifactId>
    <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Clustered Queue Example</name>
+   <name>ActiveMQ Artemis MQTT Clustered Queue Example</name>
 
    <properties>
       <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
@@ -117,7 +117,7 @@ under the License.
                      <goal>runClient</goal>
                   </goals>
                   <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ClusteredQueueMQTTExample</clientClass>
+                     <clientClass>org.apache.activemq.artemis.mqtt.example.ClusteredQueueMQTTExample</clientClass>
                   </configuration>
                </execution>
                <execution>
@@ -149,7 +149,7 @@ under the License.
             </executions>
             <dependencies>
                <dependency>
-                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <groupId>org.apache.activemq.examples.mqtt</groupId>
                   <artifactId>clustered-queue-mqtt</artifactId>
                   <version>${project.version}</version>
                </dependency>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/mqtt/clustered-queue-mqtt/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueMQTTExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/mqtt/clustered-queue-mqtt/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueMQTTExample.java b/examples/protocols/mqtt/clustered-queue-mqtt/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueMQTTExample.java
deleted file mode 100644
index 51845ac..0000000
--- a/examples/protocols/mqtt/clustered-queue-mqtt/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueMQTTExample.java
+++ /dev/null
@@ -1,81 +0,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.
- */
-package org.apache.activemq.artemis.jms.example;
-
-import java.util.concurrent.TimeUnit;
-import org.fusesource.mqtt.client.BlockingConnection;
-import org.fusesource.mqtt.client.MQTT;
-import org.fusesource.mqtt.client.Message;
-import org.fusesource.mqtt.client.QoS;
-import org.fusesource.mqtt.client.Topic;
-
-/**
- * A simple example that demonstrates an MQTT subscription on different nodes of the cluster.
- */
-public class ClusteredQueueMQTTExample {
-
-   public static void main(final String[] args) throws Exception {
-      // Create a new MQTT connection to the broker.  We are not setting the client ID.  The broker will pick one for us.
-      System.out.println("Connecting to Artemis using MQTT");
-      BlockingConnection connection1 = retrieveMQTTConnection("tcp://localhost:1883");
-      System.out.println("Connected to Artemis 1");
-      BlockingConnection connection2 = retrieveMQTTConnection("tcp://localhost:1884");
-      System.out.println("Connected to Artemis 2");
-
-      // Subscribe to topics
-      Topic[] topics = {new Topic("test/+/some/#", QoS.AT_MOST_ONCE)};
-      connection1.subscribe(topics);
-      connection2.subscribe(topics);
-      System.out.println("Subscribed to topics.");
-
-      // Publish Messages
-      String payload1 = "This is message 1";
-      String payload2 = "This is message 2";
-      String payload3 = "This is message 3";
-
-      connection1.publish("test/1/some/la", payload1.getBytes(), QoS.AT_LEAST_ONCE, false);
-      connection1.publish("test/1/some/la", payload2.getBytes(), QoS.AT_MOST_ONCE, false);
-      connection1.publish("test/1/some/la", payload3.getBytes(), QoS.AT_MOST_ONCE, false);
-      System.out.println("Sent messages.");
-
-      Message message1 = connection1.receive(5, TimeUnit.SECONDS);
-      Message message2 = connection1.receive(5, TimeUnit.SECONDS);
-      Message message3 = connection1.receive(5, TimeUnit.SECONDS);
-      Message message4 = connection2.receive(5, TimeUnit.SECONDS);
-      Message message5 = connection2.receive(5, TimeUnit.SECONDS);
-      Message message6 = connection2.receive(5, TimeUnit.SECONDS);
-      System.out.println("Received messages.");
-
-      System.out.println("Broker 1: " + new String(message1.getPayload()));
-      System.out.println("Broker 1: " + new String(message2.getPayload()));
-      System.out.println("Broker 1: " + new String(message3.getPayload()));
-      System.out.println("Broker 2: " + new String(message4.getPayload()));
-      System.out.println("Broker 2: " + new String(message5.getPayload()));
-      System.out.println("Broker 2: " + new String(message6.getPayload()));
-   }
-
-   private static BlockingConnection retrieveMQTTConnection(String host) throws Exception {
-      MQTT mqtt = new MQTT();
-      mqtt.setHost(host);
-      mqtt.setUserName("admin");
-      mqtt.setPassword("admin");
-      BlockingConnection connection = mqtt.blockingConnection();
-      connection.connect();
-      return connection;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/mqtt/clustered-queue-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/ClusteredQueueMQTTExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/mqtt/clustered-queue-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/ClusteredQueueMQTTExample.java b/examples/protocols/mqtt/clustered-queue-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/ClusteredQueueMQTTExample.java
new file mode 100644
index 0000000..3ac5b49
--- /dev/null
+++ b/examples/protocols/mqtt/clustered-queue-mqtt/src/main/java/org/apache/activemq/artemis/mqtt/example/ClusteredQueueMQTTExample.java
@@ -0,0 +1,81 @@
+/*
+ * 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.mqtt.example;
+
+import java.util.concurrent.TimeUnit;
+import org.fusesource.mqtt.client.BlockingConnection;
+import org.fusesource.mqtt.client.MQTT;
+import org.fusesource.mqtt.client.Message;
+import org.fusesource.mqtt.client.QoS;
+import org.fusesource.mqtt.client.Topic;
+
+/**
+ * A simple example that demonstrates an MQTT subscription on different nodes of the cluster.
+ */
+public class ClusteredQueueMQTTExample {
+
+   public static void main(final String[] args) throws Exception {
+      // Create a new MQTT connection to the broker.  We are not setting the client ID.  The broker will pick one for us.
+      System.out.println("Connecting to Artemis using MQTT");
+      BlockingConnection connection1 = retrieveMQTTConnection("tcp://localhost:1883");
+      System.out.println("Connected to Artemis 1");
+      BlockingConnection connection2 = retrieveMQTTConnection("tcp://localhost:1884");
+      System.out.println("Connected to Artemis 2");
+
+      // Subscribe to topics
+      Topic[] topics = {new Topic("test/+/some/#", QoS.AT_MOST_ONCE)};
+      connection1.subscribe(topics);
+      connection2.subscribe(topics);
+      System.out.println("Subscribed to topics.");
+
+      // Publish Messages
+      String payload1 = "This is message 1";
+      String payload2 = "This is message 2";
+      String payload3 = "This is message 3";
+
+      connection1.publish("test/1/some/la", payload1.getBytes(), QoS.AT_LEAST_ONCE, false);
+      connection1.publish("test/1/some/la", payload2.getBytes(), QoS.AT_MOST_ONCE, false);
+      connection1.publish("test/1/some/la", payload3.getBytes(), QoS.AT_MOST_ONCE, false);
+      System.out.println("Sent messages.");
+
+      Message message1 = connection1.receive(5, TimeUnit.SECONDS);
+      Message message2 = connection1.receive(5, TimeUnit.SECONDS);
+      Message message3 = connection1.receive(5, TimeUnit.SECONDS);
+      Message message4 = connection2.receive(5, TimeUnit.SECONDS);
+      Message message5 = connection2.receive(5, TimeUnit.SECONDS);
+      Message message6 = connection2.receive(5, TimeUnit.SECONDS);
+      System.out.println("Received messages.");
+
+      System.out.println("Broker 1: " + new String(message1.getPayload()));
+      System.out.println("Broker 1: " + new String(message2.getPayload()));
+      System.out.println("Broker 1: " + new String(message3.getPayload()));
+      System.out.println("Broker 2: " + new String(message4.getPayload()));
+      System.out.println("Broker 2: " + new String(message5.getPayload()));
+      System.out.println("Broker 2: " + new String(message6.getPayload()));
+   }
+
+   private static BlockingConnection retrieveMQTTConnection(String host) throws Exception {
+      MQTT mqtt = new MQTT();
+      mqtt.setHost(host);
+      mqtt.setUserName("admin");
+      mqtt.setPassword("admin");
+      BlockingConnection connection = mqtt.blockingConnection();
+      connection.connect();
+      return connection;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/mqtt/pom.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/mqtt/pom.xml b/examples/protocols/mqtt/pom.xml
index 5df091c..c215d65 100644
--- a/examples/protocols/mqtt/pom.xml
+++ b/examples/protocols/mqtt/pom.xml
@@ -40,15 +40,15 @@ under the License.
       <profile>
          <id>release</id>
          <modules>
-            <module>basic-pubsub</module>
             <module>clustered-queue-mqtt</module>
+            <module>publish-subscribe</module>
          </modules>
       </profile>
       <profile>
          <id>examples</id>
          <modules>
-            <module>basic-pubsub</module>
             <module>clustered-queue-mqtt</module>
+            <module>publish-subscribe</module>
          </modules>
       </profile>
    </profiles>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/mqtt/publish-subscribe/pom.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/mqtt/publish-subscribe/pom.xml b/examples/protocols/mqtt/publish-subscribe/pom.xml
new file mode 100644
index 0000000..a2f5828
--- /dev/null
+++ b/examples/protocols/mqtt/publish-subscribe/pom.xml
@@ -0,0 +1,120 @@
+<?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.mqtt</groupId>
+      <artifactId>mqtt-examples</artifactId>
+      <version>2.5.0-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>publish-subscribe</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis MQTT Publish/Subscribe Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.fusesource.mqtt-client</groupId>
+         <artifactId>mqtt-client</artifactId>
+      </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>
+               </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.mqtt.example.MQTTPublishSubscribeExample</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.mqtt</groupId>
+                  <artifactId>publish-subscribe</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-clean-plugin</artifactId>
+         </plugin>
+      </plugins>
+   </build>
+   <profiles>
+      <profile>
+         <id>release</id>
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>com.vladsch.flexmark</groupId>
+                  <artifactId>markdown-page-generator-plugin</artifactId>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
+   </profiles>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/mqtt/publish-subscribe/readme.md
----------------------------------------------------------------------
diff --git a/examples/protocols/mqtt/publish-subscribe/readme.md b/examples/protocols/mqtt/publish-subscribe/readme.md
new file mode 100644
index 0000000..75cd36f
--- /dev/null
+++ b/examples/protocols/mqtt/publish-subscribe/readme.md
@@ -0,0 +1,69 @@
+# MQTT Publish/Subscribe Example
+
+This is a basic MQTT example that demonstrates how to setup and connect to an Apache Artemis broker and send and receive messages using the MQTT protocol.
+
+## Setting up the Broker
+
+This example will use the default out of the box configuration of Artemis you don't need to change anything to run this example. Artemis ships with all protocols enabled on port 61616 and also MQTT on port 1883. To enable MQTT on a different port you can add the following XML snippet to the `acceptors` section of your broker.xml configuration file (changing the port from 1883 to what ever you require).
+
+    <acceptor name="mqtt">tcp://0.0.0.0:1883?protocols=MQTT"></acceptor>
+
+For more information on configuring protocol transports see the "Configuring Transports" section of the user manual, specifically the section called "Single Port Support".
+
+## MQTT Clients
+
+There are a number of MQTT client implementations for various languages. The Paho project: https://www.eclipse.org/paho/ offers a number of clients for languages such as C, Python, JavaScript and .Net and is also a great resource for all things MQTT. This example is actually based on the Fuse MQTT java client and was chosen as it is Apache 2.0 licensed and available to download from maven central. The specific client used in the example is not of importance and is used simply to demonstrate the features of MQTT as provided by Apache Artemis.
+
+If you'd like to use the client demonstrated in this example, simple add the following dependency to your pom.xml
+
+    <dependency>
+       <groupId>org.fusesource.mqtt-client</groupId>
+       <artifactId>mqtt-client</artifactId>
+       <version>1.10</version>
+    </dependency>
+
+## Example Step by Step
+
+* Connect to Artemis
+
+We start by creating a connection to the Apache Artemis broker. In this example we specify to use TCP protocol on localhost. By default Apache Artemis will start all protocols on port 61616, so we connect to that port.
+
+    MQTT mqtt = new MQTT();
+    mqtt.setHost("tcp://localhost:61616");
+    BlockingConnection connection = mqtt.blockingConnection();
+    connection.connect();
+
+* Create subscriptions
+
+Subscriptions in MQTT are realised by subscribing to a particular Topic. Each Topic has an address and a quality of service level (QoS level). Subscriptions also support wildcards. In the code below we subscribe to a Topic with address "mqtt/example/publish", a wildcard address "test/#" which will match anything starting with "test/" and also a wildcard "foo/+/bar", where + matches a single level of the hierarchy (foo/something/bar)
+
+    Topic[] topics = { new Topic("mqtt/example/publish", QoS.AT_LEAST_ONCE), new Topic("test/#", QoS.EXACTLY_ONCE), new Topic("foo/+/bar", QoS.AT_LEAST_ONCE) };
+    connection.subscribe(topics);
+
+* Sending messages
+
+There is no type system in MQTT, messages simply consist of a number of bytes. Below we send three messages with UTF8 encoded strings (as a byte array). Notice the second message is sent to "test/test" which should match the first wildcard subscription we defined previously. The third message is sent to "foo/1/bar", which matches the second wildcard subscription.
+
+    String payload1 = "This is message 1";
+    String payload2 = "This is message 2";
+    String payload3 = "This is message 3";
+
+    connection.publish("mqtt/example/publish", payload1.getBytes(), QoS.AT_LEAST_ONCE, false);
+    connection.publish("mqtt/test", payload2.getBytes(), QoS.AT_MOST_ONCE, false);
+    connection.publish("foo/1/bar", payload3.getBytes(), QoS.AT_MOST_ONCE, false);
+
+* Receiving messages
+
+Since we have subscribed to a number of topics and sent messages to them, the client should now receive 2 messages. We are not using callbacks here on message receive so we specifically call receive to get the messages. Once we receive the message we convert the payload consisting of bytes back to a UTF8 encoded string and print the result.
+    
+    Message message1 = connection.receive(5, TimeUnit.SECONDS);
+    Message message2 = connection.receive(5, TimeUnit.SECONDS);
+    Message message3 = connection.receive(5, TimeUnit.SECONDS);
+
+    System.out.println(new String(message1.getPayload()));
+    System.out.println(new String(message2.getPayload()));
+    System.out.println(new String(message3.getPayload()));
+
+## Result
+
+This example has shown you how to set up the basics of MQTT including how to connect to the Artemis broker and how to send and receive messages including subscriptions using wildcard addresses.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/mqtt/publish-subscribe/src/main/java/org/apache/activemq/artemis/mqtt/example/MQTTPublishSubscribeExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/mqtt/publish-subscribe/src/main/java/org/apache/activemq/artemis/mqtt/example/MQTTPublishSubscribeExample.java b/examples/protocols/mqtt/publish-subscribe/src/main/java/org/apache/activemq/artemis/mqtt/example/MQTTPublishSubscribeExample.java
new file mode 100644
index 0000000..2c8cb18
--- /dev/null
+++ b/examples/protocols/mqtt/publish-subscribe/src/main/java/org/apache/activemq/artemis/mqtt/example/MQTTPublishSubscribeExample.java
@@ -0,0 +1,65 @@
+/*
+ * 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.mqtt.example;
+
+import java.util.concurrent.TimeUnit;
+
+import org.fusesource.mqtt.client.BlockingConnection;
+import org.fusesource.mqtt.client.MQTT;
+import org.fusesource.mqtt.client.Message;
+import org.fusesource.mqtt.client.QoS;
+import org.fusesource.mqtt.client.Topic;
+
+/**
+ * A simple MQTT publish and subscribe example.
+ */
+public class MQTTPublishSubscribeExample {
+
+   public static void main(final String[] args) throws Exception {
+      // Create a new MQTT connection to the broker.  We are not setting the client ID.  The broker will pick one for us.
+      System.out.println("Connecting to Artemis using MQTT");
+      MQTT mqtt = new MQTT();
+      mqtt.setHost("tcp://localhost:1883");
+      BlockingConnection connection = mqtt.blockingConnection();
+      connection.connect();
+      System.out.println("Connected to Artemis");
+
+      // Subscribe to topics
+      Topic[] topics = {new Topic("mqtt/example/publish", QoS.AT_LEAST_ONCE), new Topic("test/#", QoS.EXACTLY_ONCE), new Topic("foo/+/bar", QoS.AT_LEAST_ONCE)};
+      connection.subscribe(topics);
+      System.out.println("Subscribed to topics.");
+
+      // Publish Messages
+      String payload1 = "This is message 1";
+      String payload2 = "This is message 2";
+      String payload3 = "This is message 3";
+
+      connection.publish("mqtt/example/publish", payload1.getBytes(), QoS.AT_LEAST_ONCE, false);
+      connection.publish("test/test", payload2.getBytes(), QoS.AT_MOST_ONCE, false);
+      connection.publish("foo/1/bar", payload3.getBytes(), QoS.AT_MOST_ONCE, false);
+      System.out.println("Sent messages.");
+
+      Message message1 = connection.receive(5, TimeUnit.SECONDS);
+      Message message2 = connection.receive(5, TimeUnit.SECONDS);
+      Message message3 = connection.receive(5, TimeUnit.SECONDS);
+      System.out.println("Received messages.");
+
+      System.out.println(new String(message1.getPayload()));
+      System.out.println(new String(message2.getPayload()));
+      System.out.println(new String(message3.getPayload()));
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/openwire/message-listener/pom.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/openwire/message-listener/pom.xml b/examples/protocols/openwire/message-listener/pom.xml
index db947f4..f17c349 100644
--- a/examples/protocols/openwire/message-listener/pom.xml
+++ b/examples/protocols/openwire/message-listener/pom.xml
@@ -29,7 +29,7 @@ under the License.
 
    <artifactId>message-listener</artifactId>
    <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Queue Example for openwire</name>
+   <name>ActiveMQ Artemis OpenWire JMS Message Listener Example</name>
 
    <properties>
       <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
@@ -84,7 +84,7 @@ under the License.
                      <goal>runClient</goal>
                   </goals>
                   <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.QueueExample</clientClass>
+                     <clientClass>org.apache.activemq.artemis.jms.example.MessageListenerExample</clientClass>
                   </configuration>
                </execution>
                <execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/openwire/message-listener/readme.md
----------------------------------------------------------------------
diff --git a/examples/protocols/openwire/message-listener/readme.md b/examples/protocols/openwire/message-listener/readme.md
index 04c43d3..b82e6f7 100644
--- a/examples/protocols/openwire/message-listener/readme.md
+++ b/examples/protocols/openwire/message-listener/readme.md
@@ -1,5 +1,5 @@
-# JMS Queue Message Listener for OpenWire
+# OpenWire JMS Message Listener Example
 
 To run the example, simply type **mvn verify** from this directory, or **mvn -PnoServer verify** if you want to start and create the broker manually.
 
-This example shows how to use a MessageListener with the OpenWire client
\ No newline at end of file
+This example shows how to use a MessageListener with the OpenWire client.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/openwire/message-listener/src/main/java/org/apache/activemq/artemis/jms/example/MessageListenerExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/openwire/message-listener/src/main/java/org/apache/activemq/artemis/jms/example/MessageListenerExample.java b/examples/protocols/openwire/message-listener/src/main/java/org/apache/activemq/artemis/jms/example/MessageListenerExample.java
new file mode 100644
index 0000000..61f444d
--- /dev/null
+++ b/examples/protocols/openwire/message-listener/src/main/java/org/apache/activemq/artemis/jms/example/MessageListenerExample.java
@@ -0,0 +1,96 @@
+/*
+ * 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.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+
+public class MessageListenerExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection = null;
+      try {
+
+         ConnectionFactory cf = new ActiveMQConnectionFactory();
+
+         connection = cf.createConnection();
+
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         Queue queue = session.createQueue("exampleQueue");
+
+         int nMessages = 1000;
+
+         CountDownLatch latch = new CountDownLatch(nMessages);
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+         messageConsumer.setMessageListener(new LocalListener(latch));
+
+         connection.start();
+
+         MessageProducer producer = session.createProducer(queue);
+
+         for (int i = 0; i < 1000; i++) {
+            TextMessage message = session.createTextMessage("This is a text message " + i);
+
+            System.out.println("Sent message: " + message.getText());
+
+            producer.send(message);
+         }
+
+         if (!latch.await(5, TimeUnit.SECONDS)) {
+            throw new RuntimeException("listener didn't receive all the messages");
+         }
+
+         System.out.println("Finished ok!");
+
+      } finally {
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+
+   private static class LocalListener implements MessageListener {
+
+      CountDownLatch latch;
+
+      LocalListener(CountDownLatch latch) {
+         this.latch = latch;
+      }
+
+      @Override
+      public void onMessage(Message message) {
+         latch.countDown();
+         try {
+            System.out.println("Received " + ((TextMessage) message).getText());
+         } catch (Exception e) {
+            e.printStackTrace();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/openwire/message-listener/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/openwire/message-listener/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java b/examples/protocols/openwire/message-listener/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
deleted file mode 100644
index cfb0aca..0000000
--- a/examples/protocols/openwire/message-listener/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
+++ /dev/null
@@ -1,99 +0,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.
- */
-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.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.activemq.ActiveMQConnectionFactory;
-
-/**
- * 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;
-      try {
-
-         ConnectionFactory cf = new ActiveMQConnectionFactory();
-
-         connection = cf.createConnection();
-
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         Queue queue = session.createQueue("exampleQueue");
-
-         int nMessages = 1000;
-
-         CountDownLatch latch = new CountDownLatch(nMessages);
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-         messageConsumer.setMessageListener(new LocalListener(latch));
-
-         connection.start();
-
-         MessageProducer producer = session.createProducer(queue);
-
-         for (int i = 0; i < 1000; i++) {
-            TextMessage message = session.createTextMessage("This is a text message " + i);
-
-            System.out.println("Sent message: " + message.getText());
-
-            producer.send(message);
-         }
-
-         if (!latch.await(5, TimeUnit.SECONDS)) {
-            throw new RuntimeException("listener didn't receive all the messages");
-         }
-
-         System.out.println("Finished ok!");
-
-      } finally {
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-
-   private static class LocalListener implements MessageListener {
-
-      CountDownLatch latch;
-
-      LocalListener(CountDownLatch latch) {
-         this.latch = latch;
-      }
-
-      @Override
-      public void onMessage(Message message) {
-         latch.countDown();
-         try {
-            System.out.println("Received " + ((TextMessage) message).getText());
-         } catch (Exception e) {
-            e.printStackTrace();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/openwire/message-recovery/pom.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/openwire/message-recovery/pom.xml b/examples/protocols/openwire/message-recovery/pom.xml
index 62bf8e4..2481834 100644
--- a/examples/protocols/openwire/message-recovery/pom.xml
+++ b/examples/protocols/openwire/message-recovery/pom.xml
@@ -29,7 +29,7 @@ under the License.
 
    <artifactId>message-recovery</artifactId>
    <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Queue Example for openwire</name>
+   <name>ActiveMQ Artemis OpenWire JMS Message Recovery Example</name>
 
    <properties>
       <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
@@ -79,7 +79,7 @@ under the License.
                      <goal>runClient</goal>
                   </goals>
                   <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.QueueExample</clientClass>
+                     <clientClass>org.apache.activemq.artemis.jms.example.MessageRecoveryExample</clientClass>
                      <args>
                         <param>${basedir}/target/server0</param>
                      </args>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/openwire/message-recovery/readme.md
----------------------------------------------------------------------
diff --git a/examples/protocols/openwire/message-recovery/readme.md b/examples/protocols/openwire/message-recovery/readme.md
index a276fa2..0df251c 100644
--- a/examples/protocols/openwire/message-recovery/readme.md
+++ b/examples/protocols/openwire/message-recovery/readme.md
@@ -1,5 +1,5 @@
-# JMS Queue Message Listener for OpenWire
+# OpenWire JMS Message Recovery Example
 
 This example will start and stop the broker within the example.
 
-This example shows how to use send messages to a queue, and having these messages recovered from the journal.
\ No newline at end of file
+This example shows how to use send messages to a queue and having these messages recovered from the journal when the broker is restarted.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/openwire/message-recovery/src/main/java/org/apache/activemq/artemis/jms/example/MessageRecoveryExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/openwire/message-recovery/src/main/java/org/apache/activemq/artemis/jms/example/MessageRecoveryExample.java b/examples/protocols/openwire/message-recovery/src/main/java/org/apache/activemq/artemis/jms/example/MessageRecoveryExample.java
new file mode 100644
index 0000000..75b01fb
--- /dev/null
+++ b/examples/protocols/openwire/message-recovery/src/main/java/org/apache/activemq/artemis/jms/example/MessageRecoveryExample.java
@@ -0,0 +1,112 @@
+/*
+ * 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.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.util.ServerUtil;
+
+public class MessageRecoveryExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection = null;
+      Process server0 = null;
+      try {
+         server0 = ServerUtil.startServer(args[0], MessageRecoveryExample.class.getSimpleName() + "0", 0, 5000);
+
+         ConnectionFactory cf = new ActiveMQConnectionFactory();
+
+         connection = cf.createConnection();
+
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         Queue queue = session.createQueue("exampleQueue");
+
+         MessageProducer producer = session.createProducer(queue);
+
+         int nMessages = 1000;
+
+         for (int i = 0; i < nMessages; i++) {
+            TextMessage message = session.createTextMessage("This is a text message " + i);
+
+            System.out.println("Sent message: " + message.getText());
+
+            producer.send(message);
+         }
+
+         connection.close();
+
+         ServerUtil.killServer(server0);
+
+         server0 = ServerUtil.startServer(args[0], MessageRecoveryExample.class.getSimpleName() + "0", 0, 5000);
+
+         ServerUtil.waitForServerToStart(0, 5000);
+
+         connection = cf.createConnection();
+
+         session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         CountDownLatch latch = new CountDownLatch(nMessages);
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+         messageConsumer.setMessageListener(new LocalListener(latch));
+
+         connection.start();
+
+         if (!latch.await(5, TimeUnit.SECONDS)) {
+            throw new RuntimeException("listener didn't receive all the messages");
+         }
+
+         System.out.println("Finished ok!");
+      } finally {
+         if (connection != null) {
+            connection.close();
+         }
+
+         ServerUtil.killServer(server0);
+      }
+   }
+
+   private static class LocalListener implements MessageListener {
+
+      CountDownLatch latch;
+
+      LocalListener(CountDownLatch latch) {
+         this.latch = latch;
+      }
+
+      @Override
+      public void onMessage(Message message) {
+         latch.countDown();
+         try {
+            System.out.println("Received " + ((TextMessage) message).getText());
+         } catch (Exception e) {
+            e.printStackTrace();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/openwire/message-recovery/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/openwire/message-recovery/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java b/examples/protocols/openwire/message-recovery/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
deleted file mode 100644
index 4ecbb50..0000000
--- a/examples/protocols/openwire/message-recovery/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
+++ /dev/null
@@ -1,115 +0,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.
- */
-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.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.artemis.util.ServerUtil;
-
-/**
- * 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;
-      Process server0 = null;
-      try {
-         server0 = ServerUtil.startServer(args[0], QueueExample.class.getSimpleName() + "0", 0, 5000);
-
-         ConnectionFactory cf = new ActiveMQConnectionFactory();
-
-         connection = cf.createConnection();
-
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         Queue queue = session.createQueue("exampleQueue");
-
-         MessageProducer producer = session.createProducer(queue);
-
-         int nMessages = 1000;
-
-         for (int i = 0; i < nMessages; i++) {
-            TextMessage message = session.createTextMessage("This is a text message " + i);
-
-            System.out.println("Sent message: " + message.getText());
-
-            producer.send(message);
-         }
-
-         connection.close();
-
-         ServerUtil.killServer(server0);
-
-         server0 = ServerUtil.startServer(args[0], QueueExample.class.getSimpleName() + "0", 0, 5000);
-
-         ServerUtil.waitForServerToStart(0, 5000);
-
-         connection = cf.createConnection();
-
-         session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         CountDownLatch latch = new CountDownLatch(nMessages);
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-         messageConsumer.setMessageListener(new LocalListener(latch));
-
-         connection.start();
-
-         if (!latch.await(5, TimeUnit.SECONDS)) {
-            throw new RuntimeException("listener didn't receive all the messages");
-         }
-
-         System.out.println("Finished ok!");
-      } finally {
-         if (connection != null) {
-            connection.close();
-         }
-
-         ServerUtil.killServer(server0);
-      }
-   }
-
-   private static class LocalListener implements MessageListener {
-
-      CountDownLatch latch;
-
-      LocalListener(CountDownLatch latch) {
-         this.latch = latch;
-      }
-
-      @Override
-      public void onMessage(Message message) {
-         latch.countDown();
-         try {
-            System.out.println("Received " + ((TextMessage) message).getText());
-         } catch (Exception e) {
-            e.printStackTrace();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/openwire/queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/openwire/queue/pom.xml b/examples/protocols/openwire/queue/pom.xml
index facd574..becdc5f 100644
--- a/examples/protocols/openwire/queue/pom.xml
+++ b/examples/protocols/openwire/queue/pom.xml
@@ -29,7 +29,7 @@ under the License.
 
    <artifactId>queue-openwire</artifactId>
    <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Queue Example for openwire</name>
+   <name>ActiveMQ Artemis OpenWire JMS Queue Example</name>
 
    <properties>
       <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/openwire/queue/readme.md
----------------------------------------------------------------------
diff --git a/examples/protocols/openwire/queue/readme.md b/examples/protocols/openwire/queue/readme.md
index 4d77c34..7f4f0b9 100644
--- a/examples/protocols/openwire/queue/readme.md
+++ b/examples/protocols/openwire/queue/readme.md
@@ -1,13 +1,9 @@
-# JMS Queue Example for OpenWire
+# OpenWire JMS Queue Example
 
 To run the example, simply type **mvn verify** from this directory, or **mvn -PnoServer verify** if you want to start and create the broker manually.
 
-This example shows you how to send and receive a message to a JMS Queue using ActiveMQ Artemis.
+This example shows you how to send and receive a message to a JMS queue using ActiveMQ Artemis.
 
 This example does exactly the same as the "queue" example however using the OpenWire client.
 
-Queues are a standard part of JMS, please consult the JMS 1.1 specification for full details.
-
-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.
-
-Notice this example is using pretty much a default stock configuration
\ No newline at end of file
+Notice this example is using the default configuration.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/stomp/stomp-dual-authentication/pom.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-dual-authentication/pom.xml b/examples/protocols/stomp/stomp-dual-authentication/pom.xml
index b9f3883..ffcc34e 100644
--- a/examples/protocols/stomp/stomp-dual-authentication/pom.xml
+++ b/examples/protocols/stomp/stomp-dual-authentication/pom.xml
@@ -80,13 +80,10 @@ under the License.
                      <goal>runClient</goal>
                   </goals>
                   <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.StompDualAuthenticationExample</clientClass>
                      <args>
-                        <arg>${project.basedir}/target/server0/etc/client-side-keystore.jks</arg>
-                        <arg>secureexample</arg>
-                        <arg>${project.basedir}/target/server0/etc/client-side-truststore.jks</arg>
-                        <arg>secureexample</arg>
-                        </args>
+                        <arg>${project.build.outputDirectory}/activemq/server0/</arg>
+                     </args>
+                     <clientClass>org.apache.activemq.artemis.jms.example.StompDualAuthenticationExample</clientClass>
                   </configuration>
                </execution>
                <execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/stomp/stomp-dual-authentication/src/main/java/org/apache/activemq/artemis/jms/example/StompDualAuthenticationExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-dual-authentication/src/main/java/org/apache/activemq/artemis/jms/example/StompDualAuthenticationExample.java b/examples/protocols/stomp/stomp-dual-authentication/src/main/java/org/apache/activemq/artemis/jms/example/StompDualAuthenticationExample.java
index 75d015c..dd5259d 100644
--- a/examples/protocols/stomp/stomp-dual-authentication/src/main/java/org/apache/activemq/artemis/jms/example/StompDualAuthenticationExample.java
+++ b/examples/protocols/stomp/stomp-dual-authentication/src/main/java/org/apache/activemq/artemis/jms/example/StompDualAuthenticationExample.java
@@ -42,17 +42,18 @@ public class StompDualAuthenticationExample {
    private static final String END_OF_FRAME = "\u0000";
 
    public static void main(final String[] args) throws Exception {
-      // set up SSL keystores for Stomp connection
-      System.setProperty("javax.net.ssl.keyStore", args[0]);
-      System.setProperty("javax.net.ssl.keyStorePassword", args[1]);
-      System.setProperty("javax.net.ssl.trustStore", args[2]);
-      System.setProperty("javax.net.ssl.trustStorePassword", args[3]);
 
       Connection connection = null;
       InitialContext initialContext = null;
       Security.addProvider(new Provider());
 
       try {
+         // set up SSL keystores for Stomp connection
+         System.setProperty("javax.net.ssl.trustStore", args[0] + "client-side-truststore.jks");
+         System.setProperty("javax.net.ssl.trustStorePassword", "secureexample");
+         System.setProperty("javax.net.ssl.keyStore", args[0] + "client-side-keystore.jks");
+         System.setProperty("javax.net.ssl.keyStorePassword", "secureexample");
+
          // Step 1. Create an SSL socket to connect to the broker
          SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
          SSLSocket socket = (SSLSocket) sslsocketfactory.createSocket("localhost", 5500);
@@ -114,6 +115,11 @@ public class StompDualAuthenticationExample {
          if (connection != null) {
             connection.close();
          }
+
+         System.clearProperty("javax.net.ssl.trustStore");
+         System.clearProperty("javax.net.ssl.trustStorePassword");
+         System.clearProperty("javax.net.ssl.keyStore");
+         System.clearProperty("javax.net.ssl.keyStorePassword");
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml b/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml
index cf0bb4c..1bba774 100644
--- a/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml
+++ b/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml
@@ -31,7 +31,7 @@ under the License.
       <!-- Acceptors -->
       <acceptors>
          <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-         <acceptor name="netty-ssl-acceptor">tcp://localhost:5500?sslEnabled=true;needClientAuth=true;keyStorePath=${data.dir}/../etc/server-side-keystore.jks;keyStorePassword=secureexample;trustStorePath=${data.dir}/../etc/server-side-truststore.jks;trustStorePassword=secureexample</acceptor>
+         <acceptor name="netty-ssl-acceptor">tcp://localhost:5500?sslEnabled=true;needClientAuth=true;keyStorePath=server-side-keystore.jks;keyStorePassword=secureexample;trustStorePath=server-side-truststore.jks;trustStorePassword=secureexample</acceptor>
       </acceptors>
 
       <!-- Other config -->
@@ -47,7 +47,7 @@ under the License.
       <addresses>
          <address name="exampleQueue">
             <anycast>
-               <queue name="jms.queue.exampleQueue"/>
+               <queue name="exampleQueue"/>
             </anycast>
          </address>
       </addresses>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/stomp/stomp-jms/pom.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-jms/pom.xml b/examples/protocols/stomp/stomp-jms/pom.xml
index a1541e9..2b38bc1 100644
--- a/examples/protocols/stomp/stomp-jms/pom.xml
+++ b/examples/protocols/stomp/stomp-jms/pom.xml
@@ -29,7 +29,7 @@ under the License.
 
    <artifactId>stomp-jms</artifactId>
    <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Stomp JMS Example</name>
+   <name>ActiveMQ Artemis Stomp JMS Example</name>
 
    <properties>
       <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/stomp/stomp-jms/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-jms/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java b/examples/protocols/stomp/stomp-jms/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
index 838a7e4..020b14c 100644
--- a/examples/protocols/stomp/stomp-jms/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
+++ b/examples/protocols/stomp/stomp-jms/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
@@ -43,7 +43,7 @@ public class StompExample {
 
       connection.start();
 
-      System.out.println("Waiting 20 seconds");
+      System.out.println("Waiting 10 seconds");
       Thread.sleep(10000); // increase this and it will fail
       System.out.println("waited");
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/stomp/stomp-jms/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-jms/src/main/resources/activemq/server0/broker.xml b/examples/protocols/stomp/stomp-jms/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..7bb1f3c
--- /dev/null
+++ b/examples/protocols/stomp/stomp-jms/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+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-configuration.xsd">
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>./data/messaging/bindings</bindings-directory>
+
+      <journal-directory>./data/messaging/journal</journal-directory>
+
+      <large-messages-directory>./data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>./data/messaging/paging</paging-directory>
+
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616?anycastPrefix=/queue/</acceptor>
+      </acceptors>
+
+      <security-settings>
+         <security-setting match="#">
+            <permission roles="guest" type="consume"/>
+            <permission roles="guest" type="send"/>
+            <permission roles="guest" type="createAddress"/>
+            <permission roles="guest" type="createDurableQueue"/>
+         </security-setting>
+      </security-settings>
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/stomp/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java b/examples/protocols/stomp/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
index 9515ae9..e2eebfd 100644
--- a/examples/protocols/stomp/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
+++ b/examples/protocols/stomp/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
@@ -46,8 +46,6 @@ public class StompExample {
 
          // Step 2. Send a CONNECT frame to connect to the server
          String connectFrame = "CONNECT\n" +
-            "login: guest\n" +
-            "passcode: guest\n" +
             "request-id: 1\n" +
             "\n" +
             END_OF_FRAME;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/stomp/stomp/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp/src/main/resources/activemq/server0/broker.xml b/examples/protocols/stomp/stomp/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..8a33c10
--- /dev/null
+++ b/examples/protocols/stomp/stomp/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+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-configuration.xsd">
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>./data/messaging/bindings</bindings-directory>
+
+      <journal-directory>./data/messaging/journal</journal-directory>
+
+      <large-messages-directory>./data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>./data/messaging/paging</paging-directory>
+
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616?protocols=CORE</acceptor>
+         <acceptor name="stomp-acceptor">tcp://localhost:61613?protocols=STOMP</acceptor>
+      </acceptors>
+
+      <security-settings>
+         <security-setting match="#">
+            <permission type="send" roles="guest"/>
+            <permission type="consume" roles="guest"/>
+            <permission type="createAddress" roles="guest"/>
+            <permission type="createDurableQueue" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+      <address-settings>
+         <address-setting match="#">
+            <default-address-routing-type>ANYCAST</default-address-routing-type>
+            <default-queue-routing-type>ANYCAST</default-queue-routing-type>
+         </address-setting>
+      </address-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/stomp/stomp1.1/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp1.1/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java b/examples/protocols/stomp/stomp1.1/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
index c14b861..d07c4ef 100644
--- a/examples/protocols/stomp/stomp1.1/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
+++ b/examples/protocols/stomp/stomp1.1/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
@@ -48,8 +48,6 @@ public class StompExample {
          String connectFrame = "CONNECT\n" +
             "accept-version:1.1\n" +
             "host:localhost\n" +
-            "login:guest\n" +
-            "passcode:guest\n" +
             "request-id:1\n" +
             "\n" +
             END_OF_FRAME;
@@ -63,6 +61,7 @@ public class StompExample {
          String text = "Hello World from Stomp 1.1 !";
          String message = "SEND\n" +
             "destination:exampleQueue\n" +
+            "destination-type:ANYCAST\n" +
             "\n" +
             text +
             END_OF_FRAME;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/afd7d8b3/examples/protocols/stomp/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java b/examples/protocols/stomp/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
index 3a8e37a..2effdc7 100644
--- a/examples/protocols/stomp/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
+++ b/examples/protocols/stomp/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
@@ -48,8 +48,6 @@ public class StompExample {
          String connectFrame = "CONNECT\n" +
             "accept-version:1.2\n" +
             "host:localhost\n" +
-            "login:guest\n" +
-            "passcode:guest\n" +
             "request-id:1\n" +
             "\n" +
             END_OF_FRAME;
@@ -63,6 +61,7 @@ public class StompExample {
          String text = "Hello World from Stomp 1.2 !";
          String message = "SEND\n" +
             "destination:exampleQueue\n" +
+            "destination-type:ANYCAST\n" +
             "\n" +
             text +
             END_OF_FRAME;