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 2015/08/13 06:13:19 UTC

[01/48] activemq-artemis git commit: renaming broker-features -> features on examples

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 800cc461c -> 6b17d966c


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml b/examples/features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..1095761
--- /dev/null
+++ b/examples/features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,77 @@
+<?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>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- We need to create a core queue for the JMS queue explicitly because the connector will be deployed
+       before the JMS queue is deployed, so the first time, it otherwise won't find the queue -->
+      <queues>
+         <queue name="jms.queue.exampleQueue">
+            <address>jms.queue.exampleQueue</address>
+         </queue>
+      </queues>
+
+      <connector-services>
+         <connector-service name="aerogear-connector">
+            <factory-class>org.apache.activemq.artemis.integration.aerogear.AeroGearConnectorServiceFactory</factory-class>
+            <param key="endpoint" value="${endpoint}"/>
+            <param key="queue" value="jms.queue.exampleQueue"/>
+            <param key="application-id" value="${applicationid}"/>
+            <param key="master-secret" value="${mastersecret}"/>
+         </connector-service>
+      </connector-services>
+
+      <!-- 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-settings>
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/sub-modules/aerogear/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/aerogear/src/main/resources/jndi.properties b/examples/features/sub-modules/aerogear/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/sub-modules/aerogear/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/6b17d966/examples/features/sub-modules/artemis-ra-rar/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/artemis-ra-rar/pom.xml b/examples/features/sub-modules/artemis-ra-rar/pom.xml
new file mode 100644
index 0000000..cae1386
--- /dev/null
+++ b/examples/features/sub-modules/artemis-ra-rar/pom.xml
@@ -0,0 +1,101 @@
+<?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.modules</groupId>
+      <artifactId>broker-modules</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>artemis-rar</artifactId>
+   <packaging>rar</packaging>
+   <name>ActiveMQ Artemis JMS RA</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>
+         <exclusions>
+            <exclusion>
+               <groupId>org.apache.activemq</groupId>
+               <artifactId>artemis-core-client</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.apache.activemq</groupId>
+               <artifactId>artemis-jms-client</artifactId>
+            </exclusion>
+            <exclusion>
+              <groupId>org.apache.geronimo.specs</groupId>
+              <artifactId>geronimo-jms_2.0_spec</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.apache.geronimo.specs</groupId>
+               <artifactId>geronimo-ejb_3.0_spec</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-ra</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-core-client</artifactId>
+         <version>${project.version}</version>
+         <exclusions>
+            <exclusion>
+               <groupId>org.apache.activemq</groupId>
+               <artifactId>artemis-core-client</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>io.netty</groupId>
+         <artifactId>netty-all</artifactId>
+      </dependency>
+   </dependencies>
+
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-rar-plugin</artifactId>
+            <configuration>
+               <raXmlFile>src/main/resources/ra.xml</raXmlFile>
+            </configuration>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/sub-modules/artemis-ra-rar/src/main/resources/ra.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/artemis-ra-rar/src/main/resources/ra.xml b/examples/features/sub-modules/artemis-ra-rar/src/main/resources/ra.xml
new file mode 100644
index 0000000..db571a3
--- /dev/null
+++ b/examples/features/sub-modules/artemis-ra-rar/src/main/resources/ra.xml
@@ -0,0 +1,308 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id: ra.xml 76819 2008-08-08 11:04:20Z jesper.pedersen $ -->
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+           http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+           version="1.5">
+
+   <description>ActiveMQ Artemis 2.0 Resource Adapter</description>
+   <display-name>ActiveMQ Artemis 2.0 Resource Adapter</display-name>
+
+   <vendor-name>Apache Software Foundation</vendor-name>
+   <eis-type>JMS 1.1 Server</eis-type>
+   <resourceadapter-version>1.0</resourceadapter-version>
+
+   <license>
+      <description>
+         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.
+      </description>
+      <license-required>true</license-required>
+   </license>
+
+   <resourceadapter>
+      <resourceadapter-class>org.apache.activemq.artemis.ra.ActiveMQResourceAdapter</resourceadapter-class>
+      <config-property>
+         <description>
+            The transport type. Multiple connectors can be configured by using a comma separated list,
+            i.e. org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory,org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory.
+         </description>
+         <config-property-name>ConnectorClassName</config-property-name>
+         <config-property-type>java.lang.String</config-property-type>
+         <config-property-value>org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory</config-property-value>
+      </config-property>
+      <config-property>
+         <description>The transport configuration. These values must be in the form of key=val;key=val;,
+            if multiple connectors are used then each set must be separated by a comma i.e. host=host1;port=61616,host=host2;port=61617.
+            Each set of params maps to the connector classname specified.
+         </description>
+         <config-property-name>ConnectionParameters</config-property-name>
+         <config-property-type>java.lang.String</config-property-type>
+         <config-property-value>server-id=0</config-property-value>
+      </config-property>
+      <!--
+      <config-property>
+        <description>Does we support HA</description>
+        <config-property-name>HA</config-property-name>
+        <config-property-type>java.lang.Boolean</config-property-type>
+        <config-property-value>false</config-property-value>
+      </config-property>
+      <config-property>
+        <description>The method to use for locating the transactionmanager</description>
+        <config-property-name>TransactionManagerLocatorMethod</config-property-name>
+        <config-property-type>java.lang.String</config-property-type>
+        <config-property-value>getTm</config-property-value>
+      </config-property>
+      <config-property>
+        <description>Use A local Transaction instead of XA?</description>
+        <config-property-name>UseLocalTx</config-property-name>
+        <config-property-type>java.lang.Boolean</config-property-type>
+        <config-property-value>false</config-property-value>
+      </config-property>
+      <config-property>
+        <description>The user name used to login to the JMS server</description>
+        <config-property-name>UserName</config-property-name>
+        <config-property-type>java.lang.String</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The password used to login to the JMS server</description>
+        <config-property-name>Password</config-property-name>
+        <config-property-type>java.lang.String</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The jndi params to use to look up the jms resources if local jndi is not to be used</description>
+        <config-property-name>JndiParams</config-property-name>
+        <config-property-type>java.lang.String</config-property-type>
+        <config-property-value>java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory;java.naming.provider.url=jnp://localhost:1199;java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces</config-property-value>
+      </config-property>
+      <config-property>
+        <description>The jGroups File name</description>
+        <config-property-name>JgroupsFile</config-property-name>
+        <config-property-type>java.lang.String</config-property-type>
+        <config-property-value>jgroups.xml</config-property-value>
+      </config-property>
+      <config-property>
+        <description>The name of the channel used on this configuration</description>
+        <config-property-name>JgroupsChannelName</config-property-name>
+        <config-property-type>java.lang.Integer</config-property-type>
+        <config-property-value>my-channel</config-property-value>
+      </config-property>
+      <config-property>
+        <description>The discovery group address</description>
+        <config-property-name>DiscoveryAddress</config-property-name>
+        <config-property-type>java.lang.String</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The discovery group port</description>
+        <config-property-name>DiscoveryPort</config-property-name>
+        <config-property-type>java.lang.Integer</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The discovery refresh timeout</description>
+        <config-property-name>DiscoveryRefreshTimeout</config-property-name>
+        <config-property-type>java.lang.Long</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The discovery initial wait timeout</description>
+        <config-property-name>DiscoveryInitialWaitTimeout</config-property-name>
+        <config-property-type>java.lang.Long</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The load balancing policy class name</description>
+        <config-property-name>LoadBalancingPolicyClassName</config-property-name>
+        <config-property-type>java.lang.String</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The client failure check period</description>
+        <config-property-name>ClientFailureCheckPeriod</config-property-name>
+        <config-property-type>java.lang.Long</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The connection TTL</description>
+        <config-property-name>ConnectionTTL</config-property-name>
+        <config-property-type>java.lang.Long</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The call timeout</description>
+        <config-property-name>CallTimeout</config-property-name>
+        <config-property-type>java.lang.Long</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The dups ok batch size</description>
+        <config-property-name>DupsOKBatchSize</config-property-name>
+        <config-property-type>java.lang.Integer</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The transaction batch size</description>
+        <config-property-name>TransactionBatchSize</config-property-name>
+        <config-property-type>java.lang.Integer</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The consumer window size</description>
+        <config-property-name>ConsumerWindowSize</config-property-name>
+        <config-property-type>java.lang.Integer</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The consumer max rate</description>
+        <config-property-name>ConsumerMaxRate</config-property-name>
+        <config-property-type>java.lang.Integer</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The confirmation window size</description>
+        <config-property-name>ConfirmationWindowSize</config-property-name>
+        <config-property-type>java.lang.Integer</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The producer max rate</description>
+        <config-property-name>ProducerMaxRate</config-property-name>
+        <config-property-type>java.lang.Integer</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The min large message size</description>
+        <config-property-name>MinLargeMessageSize</config-property-name>
+        <config-property-type>java.lang.Integer</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The block on acknowledge</description>
+        <config-property-name>BlockOnAcknowledge</config-property-name>
+        <config-property-type>java.lang.Boolean</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The block on non durable send</description>
+        <config-property-name>BlockOnNonDurableSend</config-property-name>
+        <config-property-type>java.lang.Boolean</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The block on durable send</description>
+        <config-property-name>BlockOnDurableSend</config-property-name>
+        <config-property-type>java.lang.Boolean</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The auto group</description>
+        <config-property-name>AutoGroup</config-property-name>
+        <config-property-type>java.lang.Boolean</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The max connections</description>
+        <config-property-type>java.lang.Integer</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The pre acknowledge</description>
+        <config-property-name>PreAcknowledge</config-property-name>
+        <config-property-type>java.lang.Boolean</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The retry interval</description>
+        <config-property-name>RetryInterval</config-property-name>
+        <config-property-type>java.lang.Long</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The retry interval multiplier</description>
+        <config-property-name>RetryIntervalMultiplier</config-property-name>
+        <config-property-type>java.lang.Double</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The client id</description>
+        <config-property-name>ClientID</config-property-name>
+        <config-property-type>java.lang.String</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>Whether the password is cleartext or encrypted, default false</description>
+        <config-property-name>UseMaskedPassword</config-property-name>
+        <config-property-type>java.lang.Boolean</config-property-type>
+        <config-property-value></config-property-value>
+      </config-property>
+      <config-property>
+        <description>The class definition (full qualified name and its properties) used to encrypt the password</description>
+        <config-property-name>PasswordCodec</config-property-name>
+        <config-property-type>java.lang.String</config-property-type>
+        <config-property-value>org.apache.activemq.artemis.utils.DefaultSensitiveStringCodec;key=clusterpassword;algorithm=something</config-property-value>
+      </config-property>-->
+
+      <outbound-resourceadapter>
+         <connection-definition>
+            <managedconnectionfactory-class>org.apache.activemq.artemis.ra.ActiveMQRAManagedConnectionFactory</managedconnectionfactory-class>
+
+            <config-property>
+               <description>The default session type</description>
+               <config-property-name>SessionDefaultType</config-property-name>
+               <config-property-type>java.lang.String</config-property-type>
+               <config-property-value>javax.jms.Queue</config-property-value>
+            </config-property>
+            <config-property>
+               <description>Try to obtain a lock within specified number of seconds; less than or equal to 0 disable this functionality</description>
+               <config-property-name>UseTryLock</config-property-name>
+               <config-property-type>java.lang.Integer</config-property-type>
+               <config-property-value>0</config-property-value>
+            </config-property>
+
+            <connectionfactory-interface>org.apache.activemq.artemis.ra.ActiveMQRAConnectionFactory</connectionfactory-interface>
+            <connectionfactory-impl-class>org.apache.activemq.artemis.ra.ActiveMQRAConnectionFactoryImpl</connectionfactory-impl-class>
+            <connection-interface>javax.jms.Session</connection-interface>
+            <connection-impl-class>org.apache.activemq.artemis.ra.ActiveMQRASession</connection-impl-class>
+         </connection-definition>
+         <transaction-support>XATransaction</transaction-support>
+         <authentication-mechanism>
+            <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
+            <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
+         </authentication-mechanism>
+         <reauthentication-support>false</reauthentication-support>
+      </outbound-resourceadapter>
+
+      <inbound-resourceadapter>
+         <messageadapter>
+            <messagelistener>
+               <messagelistener-type>javax.jms.MessageListener</messagelistener-type>
+               <activationspec>
+                  <activationspec-class>org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec</activationspec-class>
+                  <required-config-property>
+                      <config-property-name>destination</config-property-name>
+                  </required-config-property>
+               </activationspec>
+            </messagelistener>
+         </messageadapter>
+      </inbound-resourceadapter>
+
+   </resourceadapter>
+</connector>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/sub-modules/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/pom.xml b/examples/features/sub-modules/pom.xml
new file mode 100644
index 0000000..aeeae3c
--- /dev/null
+++ b/examples/features/sub-modules/pom.xml
@@ -0,0 +1,58 @@
+<?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.clustered</groupId>
+      <artifactId>broker-features</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <groupId>org.apache.activemq.examples.modules</groupId>
+   <artifactId>broker-modules</artifactId>
+   <packaging>pom</packaging>
+   <name>ActiveMQ Artemis Modules Examples</name>
+
+   <!-- Properties -->
+   <properties>
+      <!--
+      Explicitly declaring the source encoding eliminates the following
+      message: [WARNING] Using platform encoding (UTF-8 actually) to copy
+      filtered resources, i.e. build is platform dependent!
+      -->
+      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+      <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
+   </properties>
+
+   <profiles>
+      <!-- The modules examples need to be executed manually,
+           for that reason we won't provide an examples profile here to execute all of them at once -->
+      <profile>
+         <id>release</id>
+         <modules>
+            <module>aerogear</module>
+            <module>artemis-ra-rar</module>
+            <module>vertx</module>
+         </modules>
+      </profile>
+   </profiles>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/sub-modules/vertx/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/vertx/pom.xml b/examples/features/sub-modules/vertx/pom.xml
new file mode 100644
index 0000000..e38a299
--- /dev/null
+++ b/examples/features/sub-modules/vertx/pom.xml
@@ -0,0 +1,145 @@
+<?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.modules</groupId>
+      <artifactId>broker-modules</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>artemis-vertx-example</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis Vert.x Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+      <vertx.version>2.1.2</vertx.version>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-core-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-commons</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>io.netty</groupId>
+         <artifactId>netty-all</artifactId>
+         <version>${netty.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.geronimo.specs</groupId>
+         <artifactId>geronimo-jms_2.0_spec</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>io.vertx</groupId>
+         <artifactId>vertx-core</artifactId>
+         <version>${vertx.version}</version>
+         <scope>provided</scope>
+      </dependency>
+      <dependency>
+         <groupId>io.vertx</groupId>
+         <artifactId>vertx-platform</artifactId>
+         <version>${vertx.version}</version>
+         <scope>provided</scope>
+      </dependency>
+      <dependency>
+         <groupId>io.vertx</groupId>
+         <artifactId>vertx-hazelcast</artifactId>
+         <version>${vertx.version}</version>
+         <scope>provided</scope>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-vertx-integration</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+
+   </dependencies>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <libList>
+                        <arg>org.apache.activemq.examples.modules:artemis-vertx-example:${project.version}</arg>
+                     </libList>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.core.example.VertxConnectorExample</clientClass>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.modules</groupId>
+                  <artifactId>artemis-vertx-example</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/sub-modules/vertx/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/vertx/readme.html b/examples/features/sub-modules/vertx/readme.html
new file mode 100644
index 0000000..e8f053a
--- /dev/null
+++ b/examples/features/sub-modules/vertx/readme.html
@@ -0,0 +1,103 @@
+<!--
+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 Vert.x Connector Service 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>Vert.x Connector Service Example</h1>
+
+     <p>This example shows you how to configure ActiveMQ Artemis to use the Vert.x Connector Service.</p>
+
+     <p>ActiveMQ Artemis supports 2 types of Vert.x connector, incoming and outgoing.
+     Incoming connector consumes from Vert.x event bus and forwards to a configurable address.
+     Outgoing connector consumes from a configurable address and forwards to a configurable Vert.x event bus.
+     </p>
+
+     <p>In this example, an incoming connector and an outgoing connector are configured. A simple java Verticle
+     is deployed. The verticle registers a message handler on the outgoing connector's address ("outgoing.vertx.address").
+     A String message is sent to Vert.x event bus on the incoming connector's address("incoming.vertx.address").
+     The message then will be forwarded to a ActiveMQ Artemis queue by the incoming connector. The outgoing connector listens to
+     the ActiveMQ Artemis queue and forwards the message from ActiveMQ Artemis to Vert.x event bus on the outgoing connector's address.
+     The verticle finally receives the message from it's event bus.</p>
+
+     <p>For more information on Vert.x concept please visit the <a href="http://vertx.io/">Vertx site</a></p>
+
+     <h2>Example step-by-step</h2>
+     <p><i>To run the server, simply type <code>mvn verify</code>
+         from this directory.</p>
+
+     <ol>
+        <li>First we need to create a Vert.x PlatformManager</li>
+        <pre class="prettyprint">
+           <code>platformManager = PlatformLocator.factory.createPlatformManager(PORT, HOST);</code>
+        </pre>
+
+        <li>We deploy a Verticle using the platformManager</li>
+        <pre class="prettyprint">
+           <code>String verticle = "org.apache.activemq.artemis.core.example.ExampleVerticle";
+           platformManager.deployVerticle(verticle, null, new URL[0], 1, null,
+                  new Handler<AsyncResult<String>>(){
+
+                     @Override
+                     public void handle(AsyncResult<String> result)
+                     {
+                        if (!result.succeeded())
+                        {
+                           throw new RuntimeException("failed to deploy verticle", result.cause());
+                        }
+                        latch0.countDown();
+                     }
+
+           });</code>
+        </pre>
+
+        <li>We register a message handler with the event bus in the Verticle to listen on the outgoing connector's address.</li>
+        <pre class="prettyprint">
+           <code>EventBus eventBus = vertx.eventBus();
+           eventBus.registerHandler(VertxConnectorExample.OUTGOING,
+                      new Handler<Message<?>>() {
+                         @Override
+                         public void handle(Message<?> startMsg)
+                         {
+                            Object body = startMsg.body();
+                            System.out.println("Verticle receives a message: " + body);
+                            VertxConnectorExample.result.set(VertxConnectorExample.MSG.equals(body));
+                            latch0.countDown();
+                         }
+                      });
+           </code>
+        </pre>
+
+        <li>We send a message to incoming connector's address via event bus</li>
+        <pre class="prettyprint">
+           <code>
+              EventBus bus = platformManager.vertx().eventBus();
+              bus.send(INCOMING, MSG);
+           </code>
+        </pre>
+
+        <li>The message will eventually arrives at the Verticle's message handler.</li>
+     </ol>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/ExampleVerticle.java
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/ExampleVerticle.java b/examples/features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/ExampleVerticle.java
new file mode 100644
index 0000000..ac6ccdc
--- /dev/null
+++ b/examples/features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/ExampleVerticle.java
@@ -0,0 +1,54 @@
+/*
+ * 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.core.example;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import org.vertx.java.core.Handler;
+import org.vertx.java.core.eventbus.EventBus;
+import org.vertx.java.core.eventbus.Message;
+import org.vertx.java.platform.Verticle;
+
+public class ExampleVerticle extends Verticle {
+
+   @Override
+   public void start() {
+      EventBus eventBus = vertx.eventBus();
+
+      final CountDownLatch latch0 = new CountDownLatch(1);
+
+      // Register a handler on the outgoing connector's address
+      eventBus.registerHandler(VertxConnectorExample.OUTGOING, new Handler<Message<?>>() {
+         @Override
+         public void handle(Message<?> startMsg) {
+            Object body = startMsg.body();
+            System.out.println("Verticle receives a message: " + body);
+            VertxConnectorExample.result.set(VertxConnectorExample.MSG.equals(body));
+            latch0.countDown();
+            //Tell the example to finish.
+            VertxConnectorExample.latch.countDown();
+         }
+      });
+
+      try {
+         latch0.await(5000, TimeUnit.MILLISECONDS);
+      }
+      catch (InterruptedException e) {
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/VertxConnectorExample.java
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/VertxConnectorExample.java b/examples/features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/VertxConnectorExample.java
new file mode 100644
index 0000000..e7f6d62
--- /dev/null
+++ b/examples/features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/VertxConnectorExample.java
@@ -0,0 +1,105 @@
+/*
+ * 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.core.example;
+
+import java.net.URL;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.vertx.java.core.AsyncResult;
+import org.vertx.java.core.Handler;
+import org.vertx.java.core.eventbus.EventBus;
+import org.vertx.java.platform.PlatformLocator;
+import org.vertx.java.platform.PlatformManager;
+import org.vertx.java.spi.cluster.impl.hazelcast.HazelcastClusterManagerFactory;
+
+/**
+ * A simple example of using Vert.x connector service.
+ */
+public class VertxConnectorExample {
+
+   public static final String INCOMING = "incoming.vertx.address";
+   public static final String OUTGOING = "outgoing.vertx.address";
+   public static final String MSG = "Welcome to Vertx world!";
+
+   public static final CountDownLatch latch = new CountDownLatch(1);
+   public static final AtomicBoolean result = new AtomicBoolean(false);
+
+   private static final String HOST = "127.0.0.1";
+   private static final int PORT = 0;
+
+   public static void main(final String[] args) throws Exception {
+      System.setProperty("vertx.clusterManagerFactory", HazelcastClusterManagerFactory.class.getName());
+      PlatformManager platformManager = null;
+
+      try {
+         // Step 1 Create a Vert.x PlatformManager
+         platformManager = PlatformLocator.factory.createPlatformManager(PORT, HOST);
+
+         final CountDownLatch latch0 = new CountDownLatch(1);
+
+         // Step 2 Deploy a Verticle to receive message
+         String verticle = "org.apache.activemq.artemis.core.example.ExampleVerticle";
+         platformManager.deployVerticle(verticle, null, new URL[0], 1, null, new Handler<AsyncResult<String>>() {
+
+            @Override
+            public void handle(AsyncResult<String> result) {
+               if (!result.succeeded()) {
+                  throw new RuntimeException("failed to deploy verticle", result.cause());
+               }
+               latch0.countDown();
+            }
+
+         });
+
+         latch0.await();
+
+         // Step 3 Send a message to the incoming connector's address
+         EventBus bus = platformManager.vertx().eventBus();
+         bus.send(INCOMING, MSG);
+
+         // Step 4 Waiting for the Verticle to process the message
+         latch.await(10000, TimeUnit.MILLISECONDS);
+      }
+      finally {
+         if (platformManager != null) {
+            platformManager.undeployAll(null);
+            platformManager.stop();
+         }
+         reportResultAndExit();
+      }
+   }
+
+   private static void reportResultAndExit() {
+      if (!result.get()) {
+         System.err.println();
+         System.err.println("#####################");
+         System.err.println("###    FAILURE!   ###");
+         System.err.println("#####################");
+         System.exit(1);
+      }
+      else {
+         System.out.println();
+         System.out.println("#####################");
+         System.out.println("###    SUCCESS!   ###");
+         System.out.println("#####################");
+         System.exit(0);
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/sub-modules/vertx/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/vertx/src/main/resources/activemq/server0/broker.xml b/examples/features/sub-modules/vertx/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..9be6726
--- /dev/null
+++ b/examples/features/sub-modules/vertx/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,81 @@
+<?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">
+      <!--the queue used by the example-->
+      <queue name="exampleQueue"/>
+   </jms>
+   <core xmlns="urn:activemq:core">
+      <bindings-directory>target/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>target/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>target/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>target/server0/data/messaging/paging</paging-directory>
+      <!-- Connectors -->
+
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="queue.vertxQueue">
+            <permission type="consume" roles="guest"/>
+            <permission type="send" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+      <queues>
+         <queue name="queue.vertxQueue">
+            <address>queue.vertxQueue</address>
+         </queue>
+      </queues>
+
+      <connector-services>
+         <connector-service name="my-incoming-vertx">
+            <factory-class>org.apache.activemq.artemis.integration.vertx.VertxIncomingConnectorServiceFactory</factory-class>
+            <param key="queue" value="queue.vertxQueue"/>
+            <param key="host" value="localhost"/>
+            <param key="port" value="0"/>
+            <param key="vertx-address" value="incoming.vertx.address"/>
+         </connector-service>
+         <connector-service name="my-outgoing-vertx">
+            <factory-class>org.apache.activemq.artemis.integration.vertx.VertxOutgoingConnectorServiceFactory</factory-class>
+            <param key="queue" value="queue.vertxQueue"/>
+            <param key="host" value="localhost"/>
+            <param key="port" value="0"/>
+            <param key="vertx-address" value="outgoing.vertx.address"/>
+         </connector-service>
+      </connector-services>
+   </core>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index b3cd93e..e17ee02 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -93,8 +93,7 @@ under the License.
    </profiles>
 
    <modules>
-      <module>broker-features</module>
-      <module>perf</module>
+      <module>features</module>
       <module>protocols</module>
    </modules>
 


[44/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index d95a1cd..0000000
--- a/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?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">
-      <queue name="exampleQueue"/>
-
-      <topic name="exampleTopic"/>
-   </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:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>ON_DEMAND</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!-- Default JMS security -->
-         <security-setting match="jms.#">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server2/broker.xml b/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server2/broker.xml
deleted file mode 100644
index ef006fd..0000000
--- a/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server2/broker.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?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">
-      <queue name="exampleQueue"/>
-
-      <topic name="exampleTopic"/>
-   </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:61618</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>ON_DEMAND</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!-- Default JMS security -->
-         <security-setting match="jms.#">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server3/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server3/broker.xml b/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server3/broker.xml
deleted file mode 100644
index a780ace..0000000
--- a/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server3/broker.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?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">
-      <queue name="exampleQueue"/>
-
-      <topic name="exampleTopic"/>
-   </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:61619</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61619</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>ON_DEMAND</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!-- Default JMS security -->
-         <security-setting match="jms.#">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server4/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server4/broker.xml b/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server4/broker.xml
deleted file mode 100644
index 20b622e..0000000
--- a/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server4/broker.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?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">
-      <queue name="exampleQueue"/>
-
-      <topic name="exampleTopic"/>
-   </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:61620</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61620</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>ON_DEMAND</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!-- Default JMS security -->
-         <security-setting match="jms.#">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server5/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server5/broker.xml b/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server5/broker.xml
deleted file mode 100644
index 033af43..0000000
--- a/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server5/broker.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?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">
-      <queue name="exampleQueue"/>
-
-      <topic name="exampleTopic"/>
-   </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:61621</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61621</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>ON_DEMAND</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!-- Default JMS security -->
-         <security-setting match="jms.#">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/application-layer-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/application-layer-failover/pom.xml b/examples/broker-features/ha/application-layer-failover/pom.xml
deleted file mode 100644
index c0d9b84..0000000
--- a/examples/broker-features/ha/application-layer-failover/pom.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>application-layer-failover</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Application Layer Failover Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server0</instance>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server1</instance>
-                     <portOffset>1</portOffset>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ApplicationLayerFailoverExample</clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                        <param>${basedir}/target/server1</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>application-layer-failover</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/application-layer-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/application-layer-failover/readme.html b/examples/broker-features/ha/application-layer-failover/readme.html
deleted file mode 100644
index b60a66d..0000000
--- a/examples/broker-features/ha/application-layer-failover/readme.html
+++ /dev/null
@@ -1,169 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Application-Layer Failover 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>Application-Layer Failover Example</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory. This example will always spawn and stop multiple servers.</pre>
-
-     <p>ActiveMQ Artemis implements fully transparent <b>automatic</b> failover of connections from a live node to a backup node which requires
-     no special coding. This is described in a different example and requires server replication.</p>
-     <p>However, ActiveMQ Artemis also supports <b>Application-Layer</b> failover which is useful in the case where replication is not enabled.</p>
-     <p>With Application-Layer failover, it's up to the application to register a JMS ExceptionListener with ActiveMQ Artemis.
-         This listener will then be called by ActiveMQ Artemis in the event that connection failure is detected.</p>
-     <p>User code in the ExceptionListener can then recreate any JMS Connection, Session, etc on another node and the application
-     can continue.</p>
-     <p>Application-Layer failover is an alternative approach to High Availabilty (HA).</p>
-     <p>Application-Layer failover differs from automatic failover in that some client side coding is required in order
-     to implement this. Also, with Application-Layer failover, since the old Session object dies and a new is created, any uncommitted
-     work in the old Session will be lost, and any unacknowledged messages might be redelivered.</p>
-     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
-     section of the user manual.</p>
-
-     <h2>Example step-by-step</h2>
-     <p>In this example, the live server is server 1, which will failover onto server 0.</p>
-     <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
-     on server 0, the new  server. With Application-Layer failover the node that is failed over onto, does not need to
-     be specially configured as a backup server, it can be any node.</p>
-
-     <ol>
-        <li> We create our JMS Connection, Session, MessageProducer and MessageConsumer on server 1</li>
-        <pre class="prettyprint">
-           <code>createJMSObjects(1);</code>
-        </pre>
-
-        <li>We set a JMS ExceptionListener on the connection. On failure this will be called and the connection,
-         session, etc. will be manually recreated on the backup node.</li>
-        <pre class="prettyprint">
-           <code>connection.setExceptionListener(new ExampleListener());</code>
-        </pre>
-
-        <li>We send some messages to server 1, the live server.</li>
-        <pre class="prettyprint">
-           <code>
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++)
-         {
-            TextMessage message = session.createTextMessage("This is text message " + i);
-
-            producer.send(message);
-
-            System.out.println("Sent message: " + message.getText());
-         }
-           </code>
-        </pre>
-
-        <li>We consume those messages on server 1.</li>
-        <pre class="prettyprint">
-          <code>
-          for (int i = 0; i < numMessages; i++)
-         {
-            TextMessage message0 = (TextMessage)consumer.receive(5000);
-
-            System.out.println("Got message: " + message0.getText());
-         }
-          </code>
-        </pre>
-
-        <li>We now cause server 1, the live server to crash. After a little while the connection's
-            ExceptionListener will register the failure and reconnection will occur.</li>
-        <pre class="prettyprint">
-           <code>killServer(1);</code>
-        </pre>
-
-        <li>The connection's ExceptionListener gets called, and we lookup the JMS objects and
-        recreate the connection, session, etc on the other node 0.</li>
-        <pre class="prettyprint">
-           <code>
-   private class ExampleListener implements ExceptionListener
-   {
-      public void onException(JMSException exception)
-      {
-         try
-         {
-            // Close the old resources
-
-            closeResources();
-
-            // Create new JMS objects on the backup server
-
-            createJMSObjects(0);
-
-            failoverLatch.countDown();
-         }
-         catch (Exception e)
-         {
-            System.err.println("Failed to handle failover");
-
-            e.printStackTrace();
-         }
-      }
-   }
-           </code>
-        </pre>
-
-        <li>We are now connected to the other node. We now send some more messages.</li>
-        <pre class="prettyprint">
-           <code>
-   for (int i = numMessages; i < numMessages * 2; i++)
-         {
-            TextMessage message = session.createTextMessage("This is text message " + i);
-
-            producer.send(message);
-
-            System.out.println("Sent message: " + message.getText());
-         }
-           </code>
-        </pre>
-
-        <li>And consume them.</li>
-        <pre class="prettyprint">
-           <code>
-   for (int i = 0; i < numMessages; i++)
-         {
-            TextMessage message0 = (TextMessage)consumer.receive(5000);
-
-            System.out.println("Got message: " + message0.getText());
-         }
-           </code>
-        </pre>
-
-
-        <li>And finally (no pun intended), <b>always</b> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-	finally
-	{
-	   closeResources();
-	}
-           </code>
-        </pre>
-
-     </ol>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java b/examples/broker-features/ha/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java
deleted file mode 100644
index 2d0dc0c..0000000
--- a/examples/broker-features/ha/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java
+++ /dev/null
@@ -1,221 +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.ExceptionListener;
-import javax.jms.JMSException;
-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 javax.naming.NamingException;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-import org.apache.activemq.artemis.util.ServerUtil;
-
-/**
- * A simple example that demonstrates application-layer failover of the JMS connection from one node to another
- * when the live server crashes
- */
-public class ApplicationLayerFailoverExample {
-
-   private static InitialContext initialContext;
-
-   private static Connection connection;
-
-   private static Session session;
-
-   private static MessageConsumer consumer;
-
-   private static MessageProducer producer;
-
-   private static final CountDownLatch failoverLatch = new CountDownLatch(1);
-
-   private static Process server0;
-
-   private static Process server1;
-
-   public static void main(final String[] args) throws Exception {
-      try {
-         server0 = ServerUtil.startServer(args[0], ApplicationLayerFailoverExample.class.getSimpleName() + "0", 0, 5000);
-         server1 = ServerUtil.startServer(args[1], ApplicationLayerFailoverExample.class.getSimpleName() + "1", 1, 5000);
-
-         // Step 1. We create our JMS Connection, Session, MessageProducer and MessageConsumer on server 1.
-         createJMSObjects(0);
-
-         // Step 2. We set a JMS ExceptionListener on the connection. On failure this will be called and the connection,
-         // session, etc. will be then recreated on the backup node.
-         connection.setExceptionListener(new ExampleListener());
-
-         System.out.println("The initial JMS objects have been created, and the ExceptionListener set");
-
-         // Step 3. We send some messages to server 1, the live server
-
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session.createTextMessage("This is text message " + i);
-
-            producer.send(message);
-
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 4. We consume those messages on server 1.
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message0 = (TextMessage) consumer.receive(5000);
-
-            System.out.println("Got message: " + message0.getText());
-         }
-
-         // Step 5. We now cause server 1, the live server to crash. After a little while the connection's
-         // ExceptionListener will register the failure and reconnection will occur.
-
-         System.out.println("Killing the server");
-
-         ServerUtil.killServer(server0);
-
-         // Step 6. Wait for the client side to register the failure and reconnect
-
-         boolean ok = failoverLatch.await(5000, TimeUnit.MILLISECONDS);
-
-         System.out.println("Reconnection has occurred. Now sending more messages.");
-
-         // Step 8. We now send some more messages
-
-         for (int i = numMessages; i < numMessages * 2; i++) {
-            TextMessage message = session.createTextMessage("This is text message " + i);
-
-            producer.send(message);
-
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 9. And consume them.
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message0 = (TextMessage) consumer.receive(5000);
-
-            System.out.println("Got message: " + message0.getText());
-         }
-      }
-      catch (Throwable t) {
-         t.printStackTrace();
-      }
-      finally {
-         // Step 14. Be sure to close our resources!
-         closeResources();
-         ServerUtil.killServer(server0);
-         ServerUtil.killServer(server1);
-      }
-   }
-
-   private static void createJMSObjects(final int server) throws Exception {
-      // Step 1. Instantiate a JMS Connection Factory object from JNDI on server 1
-      ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://127.0.0.1:" + (61616 + server));
-
-      // Step 2. We create a JMS Connection connection
-      connection = connectionFactory.createConnection();
-
-      // Step 3. We start the connection to ensure delivery occurs
-      connection.start();
-
-      // Step 4. We create a JMS Session
-      session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-      // Step 5. Look-up the JMS Queue object from JNDI
-      Queue queue = session.createQueue("exampleQueue");
-
-      // Step 6. We create a JMS MessageConsumer object
-      consumer = session.createConsumer(queue);
-
-      // Step 7. We create a JMS MessageProducer object
-      producer = session.createProducer(queue);
-   }
-
-   private static void closeResources() {
-      if (initialContext != null) {
-         try {
-            initialContext.close();
-         }
-         catch (NamingException e) {
-            e.printStackTrace();
-         }
-      }
-
-      if (connection != null) {
-         try {
-            connection.close();
-         }
-         catch (JMSException e) {
-            e.printStackTrace();
-         }
-      }
-   }
-
-   private static class ExampleListener implements ExceptionListener {
-
-      public void onException(final JMSException exception) {
-         try {
-            connection.close();
-         }
-         catch (JMSException e) {
-            //ignore
-         }
-         for (int i = 0; i < 10; i++) {
-            try {
-               // Step 7. The ExceptionListener gets called and we recreate the JMS objects on the new node
-
-               System.out.println("Connection failure has been detected on a the client.");
-
-               // Close the old resources
-
-               // closeResources();
-
-               System.out.println("The old resources have been closed.");
-
-               // Create new JMS objects on the backup server
-
-               createJMSObjects(1);
-
-               System.out.println("The new resources have been created.");
-
-               failoverLatch.countDown();
-
-               return;
-            }
-            catch (Exception e) {
-               System.out.println("Failed to handle failover, trying again.");
-               try {
-                  Thread.sleep(500);
-               }
-               catch (InterruptedException e1) {
-                  //ignored
-               }
-            }
-         }
-         System.out.println("tried 10 times to reconnect, giving up");
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/client-side-failoverlistener/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/client-side-failoverlistener/pom.xml b/examples/broker-features/ha/client-side-failoverlistener/pom.xml
deleted file mode 100644
index 03101ac..0000000
--- a/examples/broker-features/ha/client-side-failoverlistener/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>client-side-fileoverlistener</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Client Side Failover listener Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server0</instance>
-                     <dataFolder>../shared</dataFolder>
-                     <sharedStore>true</sharedStore>
-                     <slave>false</slave>
-                     <failoverOnShutdown>true</failoverOnShutdown>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server1</instance>
-                     <dataFolder>../shared</dataFolder>
-                     <sharedStore>true</sharedStore>
-                     <slave>true</slave>
-                     <portOffset>1</portOffset>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ClientSideFailoverListerExample</clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                        <param>${basedir}/target/server1</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>client-side-fileoverlistener</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/client-side-failoverlistener/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/client-side-failoverlistener/readme.html b/examples/broker-features/ha/client-side-failoverlistener/readme.html
deleted file mode 100644
index 3fe1f4d..0000000
--- a/examples/broker-features/ha/client-side-failoverlistener/readme.html
+++ /dev/null
@@ -1,37 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Client Side Failover Listener 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>Client Side Kickoff Example</h1>
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory. This example will always spawn and stop multiple servers.</pre>
-
-     <p>This example demonstrates how you can listen on failover event on the client side.</p>
-
-     <p>In this example there are two nodes running in a cluster, both server will be running for start,
-        but after a while the first server will crash. This will trigger a fail-over event.</p>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java b/examples/broker-features/ha/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java
deleted file mode 100644
index 4dcfd87..0000000
--- a/examples/broker-features/ha/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java
+++ /dev/null
@@ -1,129 +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 org.apache.activemq.artemis.api.core.client.FailoverEventListener;
-import org.apache.activemq.artemis.api.core.client.FailoverEventType;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnection;
-import org.apache.activemq.artemis.util.ServerUtil;
-
-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;
-
-/**
- * This example demonstrates how you can listen on failover event on the client side
- * <p/>
- * In this example there are two nodes running in a cluster, both server will be running for start,
- * but after a while the first server will crash. This will trigger a fail-over event
- */
-public class ClientSideFailoverListerExample {
-
-   private static Process server0;
-
-   private static Process server1;
-
-   public static void main(final String[] args) throws Exception {
-      InitialContext initialContext = null;
-
-      Connection connectionA = null;
-
-      try {
-         server0 = ServerUtil.startServer(args[0], ClientSideFailoverListerExample.class.getSimpleName() + "0", 0, 5000);
-         server1 = ServerUtil.startServer(args[1], ClientSideFailoverListerExample.class.getSimpleName() + "1", 1, 0);
-
-         // Step 1. Get an initial context for looking up JNDI from server 0
-         initialContext = new InitialContext();
-
-         // Step 2. Look-up the JMS Queue object from JNDI
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-
-         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 4. We create 1 JMS connections from the same connection factory.
-         // Wait a little while to make sure broadcasts from all nodes have reached the client
-         Thread.sleep(5000);
-         connectionA = connectionFactory.createConnection();
-         ((ActiveMQConnection) connectionA).setFailoverListener(new FailoverListenerImpl());
-
-         // Step 5. We create JMS Sessions
-         Session sessionA = connectionA.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 6. We create JMS MessageProducer objects on the sessions
-         MessageProducer producerA = sessionA.createProducer(queue);
-
-         // Step 7. We send some messages on each producer
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage messageA = sessionA.createTextMessage("A:This is text message " + i);
-            producerA.send(messageA);
-            System.out.println("Sent message: " + messageA.getText());
-
-         }
-
-         // Step 8. We start the connection to consume messages
-         connectionA.start();
-
-         // Step 9. We consume messages from the session A, one at a time.
-         // We reached message no 5 the first server will crash
-         consume(sessionA, queue, numMessages, "A");
-      }
-      finally {
-         // Step 10. Be sure to close our resources!
-
-         if (connectionA != null) {
-            connectionA.close();
-         }
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-
-         ServerUtil.killServer(server0);
-         ServerUtil.killServer(server1);
-      }
-   }
-
-   private static void consume(Session session, Queue queue, int numMessages, String node) throws Exception {
-      MessageConsumer consumer = session.createConsumer(queue);
-
-      for (int i = 0; i < numMessages; i++) {
-         TextMessage message = (TextMessage) consumer.receive(2000);
-         System.out.println("Got message: " + message.getText() + " from node " + node);
-         if (i == 5) {
-            ServerUtil.killServer(server0);
-         }
-      }
-
-      System.out.println("receive other message from node " + node + ": " + consumer.receive(2000));
-
-   }
-
-   private static class FailoverListenerImpl implements FailoverEventListener {
-
-      public void failoverEvent(FailoverEventType eventType) {
-         System.out.println("Failover event triggered :" + eventType.toString());
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/client-side-failoverlistener/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/client-side-failoverlistener/src/main/resources/jndi.properties b/examples/broker-features/ha/client-side-failoverlistener/src/main/resources/jndi.properties
deleted file mode 100644
index 7f7a19f..0000000
--- a/examples/broker-features/ha/client-side-failoverlistener/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/ha/colocated-failover-scale-down/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/colocated-failover-scale-down/pom.xml b/examples/broker-features/ha/colocated-failover-scale-down/pom.xml
deleted file mode 100644
index 9213d18..0000000
--- a/examples/broker-features/ha/colocated-failover-scale-down/pom.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>colocated-failover-scale-down</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Colocated Failover Recover Only Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ColocatedFailoverScaleDownExample
-                     </clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                        <param>${basedir}/target/server1</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>colocated-failover-scale-down</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/colocated-failover-scale-down/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/colocated-failover-scale-down/readme.html b/examples/broker-features/ha/colocated-failover-scale-down/readme.html
deleted file mode 100644
index 8be5030..0000000
--- a/examples/broker-features/ha/colocated-failover-scale-down/readme.html
+++ /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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Colocated Failover Scale Down 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 Colocated Failover Recover Only Example</h1>
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory. This example will always spawn and stop multiple servers.</pre>
-
-
-     <p>This example demonstrates how you can colocate live and backup servers in the same VM. We do this by creating an
-         HA Policy that is colocated. colocated means that backup servers can be created and maintained by live servers on behalf
-         of other requesting live servers. In this example we create a colocated shared store server that will scale down.
-         That is it will not become live but scale down the journal to the colocated live server.
-     <p>This example starts 2 live servers each will request the other to create a backup.</p>
-     <p>The first live server will be killed and the backup in the second will recover the journal and recreate its state
-         in the live server it shares its VM with.</p>
-     <p>The following shows how to configure the backup, the slave is configured <b>&lt;scale-down/></b> which means
-         that the backup server will not fully start on fail over, instead it will just recover the journal and write it
-     to its parent live server.</p>
-     <pre class="prettyprint">
-     <code>&lt;ha-policy>
-         &lt;shared-store>
-             &lt;colocated>
-                 &lt;backup-port-offset>100&lt;/backup-port-offset>
-                 &lt;backup-request-retries>-1&lt;/backup-request-retries>
-                 &lt;backup-request-retry-interval>2000&lt;/backup-request-retry-interval>
-                 &lt;max-backups>1&lt;/max-backups>
-                 &lt;request-backup>true&lt;/request-backup>
-                 &lt;master/>
-                 &lt;slave>
-                     &lt;scale-down/>
-                 &lt;/slave>
-             &lt;/colocated>
-         &lt;/shared-store>
-     &lt;/ha-policy>
-     </code>
-     </pre>
-     <p>Notice that we dont need to specify a scale down connector as it will use most appropriate
-     from the list of available connectors which in  this case is the first INVM connector</p>
-     <p> One other thing to notice is that the cluster connection has its reconnect attempts set to 5, this is so it will
-         disconnect instead of trying to reconnect to a backup that doesn't exist.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java b/examples/broker-features/ha/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java
deleted file mode 100644
index c3a87ec..0000000
--- a/examples/broker-features/ha/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java
+++ /dev/null
@@ -1,140 +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 org.apache.activemq.artemis.util.ServerUtil;
-
-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;
-import java.util.Hashtable;
-
-/**
- * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
- * nodes of the cluster.
- */
-public class ColocatedFailoverScaleDownExample {
-
-   private static Process server0;
-
-   private static Process server1;
-
-   public static void main(final String[] args) throws Exception {
-      final int numMessages = 30;
-
-      Connection connection = null;
-      Connection connection1 = null;
-
-      InitialContext initialContext = null;
-      InitialContext initialContext1 = null;
-
-      try {
-         server0 = ServerUtil.startServer(args[0], ColocatedFailoverScaleDownExample.class.getSimpleName() + "0", 0, 5000);
-         server1 = ServerUtil.startServer(args[1], ColocatedFailoverScaleDownExample.class.getSimpleName() + "1", 1, 5000);
-
-         // Step 1. Get an initial context for looking up JNDI for both servers
-         Hashtable<String, Object> properties = new Hashtable<String, Object>();
-         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
-         initialContext1 = new InitialContext(properties);
-
-         properties = new Hashtable<String, Object>();
-         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
-         properties.put("queue.queue/exampleQueue", "exampleQueue");
-         initialContext = new InitialContext(properties);
-
-         // Step 2. Look up the JMS resources from JNDI
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-         ConnectionFactory connectionFactory1 = (ConnectionFactory) initialContext1.lookup("ConnectionFactory");
-
-         // Step 3. Create a JMS Connections
-         connection = connectionFactory.createConnection();
-         connection1 = connectionFactory1.createConnection();
-
-         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
-         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-         Session session1 = connection1.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
-         // Step 5. Create a JMS MessageProducers
-         MessageProducer producer = session.createProducer(queue);
-         MessageProducer producer1 = session1.createProducer(queue);
-
-         // Step 6. Send some messages to both servers
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session.createTextMessage("This is text message " + i);
-            producer.send(message);
-            System.out.println("Sent message: " + message.getText());
-            message = session1.createTextMessage("This is another text message " + i);
-            producer1.send(message);
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 7. Crash server #0, the live server, and wait a little while to make sure
-         // it has really crashed
-         ServerUtil.killServer(server0);
-         System.out.println("Waiting for scale-down to complete...");
-         Thread.sleep(10000);
-
-         // Step 8. start the connection ready to receive messages
-         connection1.start();
-
-         // Step 9.create a consumer
-         MessageConsumer consumer = session1.createConsumer(queue);
-
-         // Step 10. Receive and acknowledge all of the sent messages, notice that they will be out of order, this is
-         // because they were initially round robined to both nodes then when the server failed were reloaded into the
-         // live server.
-         TextMessage message0 = null;
-         for (int i = 0; i < numMessages * 2; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            if (message0 == null) {
-               throw new IllegalStateException("Message not received!");
-            }
-            System.out.println("Got message: " + message0.getText());
-         }
-         message0.acknowledge();
-      }
-      finally {
-         // Step 11. Be sure to close our resources!
-
-         if (connection != null) {
-            connection.close();
-         }
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection1 != null) {
-            connection1.close();
-         }
-
-         if (initialContext1 != null) {
-            initialContext1.close();
-         }
-
-         ServerUtil.killServer(server0);
-         ServerUtil.killServer(server1);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/ha/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 60201ca..0000000
--- a/examples/broker-features/ha/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,129 +0,0 @@
-<?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.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="invm-connector">vm://0</connector>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="invm-acceptor">vm://0</acceptor>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <!-- since the backup servers scale down we need a sensible setting here so the bridge will stop -->
-            <reconnect-attempts>5</reconnect-attempts>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- a colocated server that will allow shared store backups to be requested, the default for this template is to scale down-->
-      <ha-policy>
-         <shared-store>
-            <colocated>
-               <backup-port-offset>100</backup-port-offset>
-               <backup-request-retries>-1</backup-request-retries>
-               <backup-request-retry-interval>2000</backup-request-retry-interval>
-               <max-backups>1</max-backups>
-               <request-backup>true</request-backup>
-               <master>
-                  <failover-on-shutdown>true</failover-on-shutdown>
-               </master>
-               <slave>
-                  <scale-down/>
-               </slave>
-            </colocated>
-         </shared-store>
-      </ha-policy>
-
-      <!-- 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.#">
-            <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">
-            <permission type="manage" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/ha/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 7892fc1..0000000
--- a/examples/broker-features/ha/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-<?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.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="invm-connector">vm://0</connector>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="invm-acceptor">vm://0</acceptor>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <!-- since the backup servers scale down we need a sensible setting here so the bridge will stop -->
-            <reconnect-attempts>5</reconnect-attempts>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- a colocated server that will allow shared store backups to be requested, the default for this template is to scale down-->
-      <ha-policy>
-         <shared-store>
-            <colocated>
-               <backup-port-offset>100</backup-port-offset>
-               <backup-request-retries>-1</backup-request-retries>
-               <backup-request-retry-interval>2000</backup-request-retry-interval>
-               <max-backups>1</max-backups>
-               <request-backup>true</request-backup>
-               <master/>
-               <slave>
-                  <scale-down/>
-               </slave>
-            </colocated>
-         </shared-store>
-      </ha-policy>
-
-      <!-- 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.#">
-            <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">
-            <permission type="manage" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/colocated-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/colocated-failover/pom.xml b/examples/broker-features/ha/colocated-failover/pom.xml
deleted file mode 100644
index d15a948..0000000
--- a/examples/broker-features/ha/colocated-failover/pom.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>colocated-failover</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Colocated Failover Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ColocatedFailoverExample</clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                        <param>${basedir}/target/server1</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>colocated-failover</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-</project>


[28/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/security/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/security/readme.html b/examples/broker-features/standard/security/readme.html
deleted file mode 100644
index d25dd42..0000000
--- a/examples/broker-features/standard/security/readme.html
+++ /dev/null
@@ -1,326 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Security 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 Security 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 how to configure and use security using ActiveMQ Artemis.</p>
-
-     <p>With security properly configured, ActiveMQ Artemis can restrict client access to its resources, including
-     connection creation, message sending/receiving, etc. This is done by configuring users and roles as well as permissions in
-     the configuration files. </p>
-
-     <p>ActiveMQ Artemis supports wild-card security configuration. This feature makes security configuration very
-     flexible and enables fine-grained control over permissions in an efficient way.</p>
-
-     <p>For a full description of how to configure security with ActiveMQ Artemis, please consult the user
-     manual.</p>
-
-     <p>This example demonstrates how to configure users/roles, how to configure topics with proper permissions using wild-card
-     expressions, and how they take effects in a simple program. </p>
-
-     <p>First we need to configure users with roles. Users and Roles are configured in <code>activemq-users.xml</code>. This example has four users
-     configured as below </p>
-
-     <pre class="prettyprint">
-     <code>
-		   &lt;user name=&quot;bill&quot; password=&quot;activemq&quot;&gt;
-		      &lt;role name=&quot;user&quot;/&gt;
-		   &lt;/user&gt;
-
-		   &lt;user name=&quot;andrew&quot; password=&quot;activemq1&quot;&gt;
-		      &lt;role name=&quot;europe-user&quot;/&gt;
-		      &lt;role name=&quot;user&quot;/&gt;
-		   &lt;/user&gt;
-
-		   &lt;user name=&quot;frank&quot; password=&quot;activemq2&quot;&gt;
-		      &lt;role name=&quot;us-user&quot;/&gt;
-		      &lt;role name=&quot;news-user&quot;/&gt;
-		      &lt;role name=&quot;user&quot;/&gt;
-		   &lt;/user&gt;
-
-		   &lt;user name=&quot;sam&quot; password=&quot;activemq3&quot;&gt;
-		      &lt;role name=&quot;news-user&quot;/&gt;
-		      &lt;role name=&quot;user&quot;/&gt;
-		   &lt;/user&gt;
-     </code>
-     </pre>
-
-     <p>
-     Each user has three properties available: user name, password, and roles it belongs to. It should be noted that
-     a user can belong to more than one role. In the above configuration, all users belong to role 'user'. User 'andrew' also
-     belongs to role 'europe-user', user 'frank' also belongs to 'us-user' and 'news-user' and user 'sam' also belongs to 'news-user'.
-     </p>
-     <p>
-     User name and password consists of a valid account that can be used to establish connections to a ActiveMQ Artemis server, while
-     roles are used in controlling the access privileges against ActiveMQ Artemis topics and queues. You can achieve this control by
-     configuring proper permissions in <code>broker.xml</code>, like the following
-     </p>
-     <pre class="prettyprint"><code>
-      &lt;security-settings&gt;
-         &lt;!-- any user can have full control of generic topics --&gt;
-		   &lt;security-setting match=&quot;jms.topic.#&quot;&gt;
-		      &lt;permission type=&quot;createDurableQueue&quot; roles=&quot;user&quot;/&gt;
-		      &lt;permission type=&quot;deleteDurableQueue&quot; roles=&quot;user&quot;/&gt;
-		      &lt;permission type=&quot;createNonDurableQueue&quot; roles=&quot;user&quot;/&gt;
-		      &lt;permission type=&quot;deleteNonDurableQueue&quot; roles=&quot;user&quot;/&gt;
-		      &lt;permission type=&quot;send&quot; roles=&quot;user&quot;/&gt;
-		      &lt;permission type=&quot;consume&quot; roles=&quot;user&quot;/&gt;
-		   &lt;/security-setting&gt;
-
-		   &lt;security-setting match=&quot;jms.topic.news.europe.#&quot;&gt;
-		      &lt;permission type=&quot;createDurableQueue&quot; roles=&quot;user&quot;/&gt;
-		      &lt;permission type=&quot;deleteDurableQueue&quot; roles=&quot;user&quot;/&gt;
-		      &lt;permission type=&quot;createNonDurableQueue&quot; roles=&quot;user&quot;/&gt;
-		      &lt;permission type=&quot;deleteNonDurableQueue&quot; roles=&quot;user&quot;/&gt;
-		      &lt;permission type=&quot;send&quot; roles=&quot;europe-user&quot;/&gt;
-		      &lt;permission type=&quot;consume&quot; roles=&quot;news-user&quot;/&gt;
-		   &lt;/security-setting&gt;
-
-		   &lt;security-setting match=&quot;jms.topic.news.us.#&quot;&gt;
-		      &lt;permission type=&quot;createDurableQueue&quot; roles=&quot;user&quot;/&gt;
-		      &lt;permission type=&quot;deleteDurableQueue&quot; roles=&quot;user&quot;/&gt;
-		      &lt;permission type=&quot;createNonDurableQueue&quot; roles=&quot;user&quot;/&gt;
-		      &lt;permission type=&quot;deleteNonDurableQueue&quot; roles=&quot;user&quot;/&gt;
-		      &lt;permission type=&quot;send&quot; roles=&quot;us-user&quot;/&gt;
-		      &lt;permission type=&quot;consume&quot; roles=&quot;news-user&quot;/&gt;
-		   &lt;/security-setting&gt;
-     &lt;/security-settings&gt;
-     </code></pre>
-
-     <p>Permissions can be defined on any group of queues, by using a wildcard. You can easily specify
-     wildcards to apply certain permissions to a set of matching queues and topics. In the above configuration
-     we have created four sets of permissions, each set matches against a special group of targets, indicated by wild-card match attributes.</p>
-
-     <p>You can provide a very broad permission control as a default and then add more strict control
-     over specific addresses. By the above we define the following access rules:</p>
-
-         <li>Only role 'us-user' can create/delete and pulish messages to topics whose names match wild-card pattern 'news.us.#'.</li>
-         <li>Only role 'europe-user' can create/delete and publish messages to topics whose names match wild-card pattern 'news.europe.#'.</li>
-         <li>Only role 'news-user' can subscribe messages to topics whose names match wild-card pattern 'news.us.#' and 'news.europe.#'.</li>
-         <li>For any other topics that don't match any of the above wild-card patterns, permissions are granted to users of role 'user'.</li>
-
-     <p>To illustrate the effect of permissions, three topics are deployed. Topic 'genericTopic' matches 'jms.topic.#' wild-card, topic 'news.europe.europeTopic' matches
-     jms.topic.news.europe.#' wild-cards, and topic 'news.us.usTopic' matches 'jms.topic.news.us.#'.</p>
-
-     <p>With ActiveMQ Artemis, the security manager is also configurable. You can use JAASSecurityManager or JBossASSecurityManager based on you need. Please
-     check out the activemq-beans.xml for how to do. In this example we just use the basic ActiveMQSecurityManagerImpl which reads users/roles/passwords from the xml
-     file <code>activemq-users.xml</code>.
-
-
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>
-           InitialContext initialContext = getContext(0);
-           </code>
-        </pre>
-
-        <li>We perform lookup on the topics</li>
-        <pre class="prettyprint">
-           <code>
-           Topic genericTopic = (Topic) initialContext.lookup("/topic/genericTopic");
-           Topic europeTopic = (Topic) initialContext.lookup("/topic/europeTopic");
-           Topic usTopic = (Topic) initialContext.lookup("/topic/usTopic");
-           </code>
-        </pre>
-
-        <li>We perform a lookup on the Connection Factory</li>
-        <pre class="prettyprint">
-           <code>
-           ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>We try to create a JMS Connection without user/password. It will fail.</li>
-        <pre class="prettyprint">
-           <code>
-           try
-           {
-              cf.createConnection();
-              result = false;
-           }
-           catch (JMSSecurityException e)
-           {
-              System.out.println("Default user cannot get a connection. Details: " + e.getMessage());
-           }
-           </code>
-        </pre>
-
-        <li>Bill tries to make a connection using wrong password</li>
-        <pre class="prettyprint">
-           <code>
-           billConnection = null;
-           try
-           {
-              billConnection = createConnection("bill", "activemq1", cf);
-              result = false;
-           }
-           catch (JMSException e)
-           {
-              System.out.println("User bill failed to connect. Details: " + e.getMessage());
-           }
-           </code>
-        </pre>
-
-        <li>Bill makes a good connection.</li>
-        <pre class="prettyprint">
-          <code>
-           billConnection = createConnection("bill", "activemq", cf);
-           billConnection.start();
-          </code>
-       </pre>
-
-        <li>Andrew makes a good connection</li>
-         <pre class="prettyprint">
-           <code>
-           andrewConnection = createConnection("andrew", "activemq1", cf);
-           andrewConnection.start();
-           </code>
-         </pre>
-
-        <li>Frank makes a good connection</li>
-        <pre class="prettyprint">
-           <code>
-           frankConnection = createConnection("frank", "activemq2", cf);
-           frankConnection.start();
-           </code>
-        </pre>
-
-        <li>Sam makes a good connection</li>
-        <pre class="prettyprint">
-           <code>
-           samConnection = createConnection("sam", "activemq3", cf);
-           samConnection.start();
-           </code>
-        </pre>
-
-        <li>We check every user can publish/subscribe genericTopics</li>
-        <pre class="prettyprint">
-           <code>
-           checkUserSendAndReceive(genericTopic, billConnection, "bill");
-           checkUserSendAndReceive(genericTopic, andrewConnection, "andrew");
-           checkUserSendAndReceive(genericTopic, frankConnection, "frank");
-           checkUserSendAndReceive(genericTopic, samConnection, "sam");
-           </code>
-        </pre>
-
-        <li>We check permissions on news.europe.europeTopic for bill: can't send and can't receive</li>
-        <pre class="prettyprint">
-           <code>
-           checkUserNoSendNoReceive(europeTopic, billConnection, "bill", andrewConnection, frankConnection);
-           </code>
-        </pre>
-
-        <li>We check permissions on news.europe.europeTopic for andrew: can send but can't receive</li>
-        <pre class="prettyprint">
-           <code>
-           checkUserSendNoReceive(europeTopic, andrewConnection, "andrew", frankConnection);
-           </code>
-        </pre>
-
-        <li>We check permissions on news.europe.europeTopic for frank: can't send but can receive</li>
-        <pre class="prettyprint">
-           <code>
-           checkUserReceiveNoSend(europeTopic, frankConnection, "frank", andrewConnection);
-           </code>
-        </pre>
-
-        <li>We check permissions on news.europe.europeTopic for sam: can't send but can receive</li>
-        <pre class="prettyprint">
-           <code>
-           checkUserReceiveNoSend(europeTopic, samConnection, "sam", andrewConnection);
-           </code>
-        </pre>
-
-        <li>We check permissions on news.us.usTopic for bill: can't send and can't receive</li>
-        <pre class="prettyprint">
-           <code>
-           checkUserNoSendNoReceive(usTopic, billConnection, "bill");
-           </code>
-        </pre>
-
-        <li>We check permissions on news.us.usTopic for andrew: can't send and can't receive</li>
-        <pre class="prettyprint">
-           <code>
-           checkUserNoSendNoReceive(usTopic, andrewConnection, "andrew");
-           </code>
-        </pre>
-
-        <li>We check permissions on news.us.usTopic for frank: can both send and receive</li>
-        <pre class="prettyprint">
-           <code>
-           checkUserSendAndReceive(usTopic, frankConnection, "frank");
-           </code>
-        </pre>
-
-        <li>We check permissions on news.us.usTopic for sam: can't send but can receive</li>
-        <pre class="prettyprint">
-           <code>
-           checkUserReceiveNoSend(usTopic, samConnection, "sam", frankConnection);
-           </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 (billConnection != null)
-              {
-                 billConnection.close();
-              }
-              if (andrewConnection != null)
-              {
-                 andrewConnection.close();
-              }
-              if (frankConnection != null)
-              {
-                 frankConnection.close();
-              }
-              if (samConnection != null)
-              {
-                 samConnection.close();
-              }
-
-              // Also the initialContext
-              if (initialContext != null)
-              {
-                 initialContext.close();
-              }
-           }
-           </code>
-        </pre>
-     </ol>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/security/src/main/java/org/apache/activemq/artemis/jms/example/SecurityExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/security/src/main/java/org/apache/activemq/artemis/jms/example/SecurityExample.java b/examples/broker-features/standard/security/src/main/java/org/apache/activemq/artemis/jms/example/SecurityExample.java
deleted file mode 100644
index 88fd1da..0000000
--- a/examples/broker-features/standard/security/src/main/java/org/apache/activemq/artemis/jms/example/SecurityExample.java
+++ /dev/null
@@ -1,282 +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.JMSException;
-import javax.jms.JMSSecurityException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.naming.InitialContext;
-
-public class SecurityExample {
-
-   public static void main(final String[] args) throws Exception {
-      boolean result = true;
-      Connection failConnection = null;
-      Connection billConnection = null;
-      Connection andrewConnection = null;
-      Connection frankConnection = null;
-      Connection samConnection = null;
-
-      InitialContext initialContext = null;
-      try {
-         // /Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
-
-         // Step 2. perform lookup on the topics
-         Topic genericTopic = (Topic) initialContext.lookup("topic/genericTopic");
-         Topic europeTopic = (Topic) initialContext.lookup("topic/europeTopic");
-         Topic usTopic = (Topic) initialContext.lookup("topic/usTopic");
-
-         // Step 3. perform a lookup on the Connection Factory
-         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 4. Try to create a JMS Connection without user/password. It will fail.
-         try {
-            failConnection = cf.createConnection();
-            result = false;
-         }
-         catch (JMSSecurityException e) {
-            System.out.println("Default user cannot get a connection. Details: " + e.getMessage());
-         }
-
-         // Step 5. bill tries to make a connection using wrong password
-         billConnection = null;
-         try {
-            billConnection = createConnection("bill", "activemq1", cf);
-            result = false;
-         }
-         catch (JMSException e) {
-            System.out.println("User bill failed to connect. Details: " + e.getMessage());
-         }
-
-         // Step 6. bill makes a good connection.
-         billConnection = createConnection("bill", "activemq", cf);
-         billConnection.start();
-
-         // Step 7. andrew makes a good connection.
-         andrewConnection = createConnection("andrew", "activemq1", cf);
-         andrewConnection.start();
-
-         // Step 8. frank makes a good connection.
-         frankConnection = createConnection("frank", "activemq2", cf);
-         frankConnection.start();
-
-         // Step 9. sam makes a good connection.
-         samConnection = createConnection("sam", "activemq3", cf);
-         samConnection.start();
-
-         // Step 10. Check every user can publish/subscribe genericTopics.
-         System.out.println("------------------------Checking permissions on " + genericTopic + "----------------");
-         checkUserSendAndReceive(genericTopic, billConnection, "bill");
-         checkUserSendAndReceive(genericTopic, andrewConnection, "andrew");
-         checkUserSendAndReceive(genericTopic, frankConnection, "frank");
-         checkUserSendAndReceive(genericTopic, samConnection, "sam");
-         System.out.println("-------------------------------------------------------------------------------------");
-
-         System.out.println("------------------------Checking permissions on " + europeTopic + "----------------");
-
-         // Step 11. Check permissions on news.europe.europeTopic for bill: can't send and can't receive
-         checkUserNoSendNoReceive(europeTopic, billConnection, "bill");
-
-         // Step 12. Check permissions on news.europe.europeTopic for andrew: can send but can't receive
-         checkUserSendNoReceive(europeTopic, andrewConnection, "andrew", frankConnection);
-
-         // Step 13. Check permissions on news.europe.europeTopic for frank: can't send but can receive
-         checkUserReceiveNoSend(europeTopic, frankConnection, "frank", andrewConnection);
-
-         // Step 14. Check permissions on news.europe.europeTopic for sam: can't send but can receive
-         checkUserReceiveNoSend(europeTopic, samConnection, "sam", andrewConnection);
-         System.out.println("-------------------------------------------------------------------------------------");
-
-         System.out.println("------------------------Checking permissions on " + usTopic + "----------------");
-
-         // Step 15. Check permissions on news.us.usTopic for bill: can't send and can't receive
-         checkUserNoSendNoReceive(usTopic, billConnection, "bill");
-
-         // Step 16. Check permissions on news.us.usTopic for andrew: can't send and can't receive
-         checkUserNoSendNoReceive(usTopic, andrewConnection, "andrew");
-
-         // Step 17. Check permissions on news.us.usTopic for frank: can both send and receive
-         checkUserSendAndReceive(usTopic, frankConnection, "frank");
-
-         // Step 18. Check permissions on news.us.usTopic for sam: can't send but can receive
-         checkUserReceiveNoSend(usTopic, samConnection, "sam", frankConnection);
-         System.out.println("-------------------------------------------------------------------------------------");
-      }
-      finally {
-         // Step 19. Be sure to close our JMS resources!
-         if (failConnection != null) {
-            failConnection.close();
-         }
-         if (billConnection != null) {
-            billConnection.close();
-         }
-         if (andrewConnection != null) {
-            andrewConnection.close();
-         }
-         if (frankConnection != null) {
-            frankConnection.close();
-         }
-         if (samConnection != null) {
-            samConnection.close();
-         }
-
-         // Also the initialContext
-         if (initialContext != null) {
-            initialContext.close();
-         }
-      }
-   }
-
-   // Check the user can receive message but cannot send message.
-   private static void checkUserReceiveNoSend(final Topic topic,
-                                              final Connection connection,
-                                              final String user,
-                                              final Connection sendingConn) throws JMSException {
-      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      MessageProducer producer = session.createProducer(topic);
-      MessageConsumer consumer = session.createConsumer(topic);
-      TextMessage msg = session.createTextMessage("hello-world-1");
-
-      try {
-         producer.send(msg);
-         throw new IllegalStateException("Security setting is broken! User " + user +
-                                            " can send message [" +
-                                            msg.getText() +
-                                            "] to topic " +
-                                            topic);
-      }
-      catch (JMSException e) {
-         System.out.println("User " + user + " cannot send message [" + msg.getText() + "] to topic: " + topic);
-      }
-
-      // Now send a good message
-      Session session1 = sendingConn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      producer = session1.createProducer(topic);
-      producer.send(msg);
-
-      TextMessage receivedMsg = (TextMessage) consumer.receive(2000);
-
-      if (receivedMsg != null) {
-         System.out.println("User " + user + " can receive message [" + receivedMsg.getText() + "] from topic " + topic);
-      }
-      else {
-         throw new IllegalStateException("Security setting is broken! User " + user + " cannot receive message from topic " + topic);
-      }
-
-      session1.close();
-      session.close();
-   }
-
-   // Check the user can send message but cannot receive message
-   private static void checkUserSendNoReceive(final Topic topic,
-                                              final Connection connection,
-                                              final String user,
-                                              final Connection receivingConn) throws JMSException {
-      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      MessageProducer producer = session.createProducer(topic);
-      try {
-         session.createConsumer(topic);
-      }
-      catch (JMSException e) {
-         System.out.println("User " + user + " cannot receive any message from topic " + topic);
-      }
-
-      Session session1 = receivingConn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      MessageConsumer goodConsumer = session1.createConsumer(topic);
-
-      TextMessage msg = session.createTextMessage("hello-world-2");
-      producer.send(msg);
-
-      TextMessage receivedMsg = (TextMessage) goodConsumer.receive(2000);
-      if (receivedMsg != null) {
-         System.out.println("User " + user + " can send message [" + receivedMsg.getText() + "] to topic " + topic);
-      }
-      else {
-         throw new IllegalStateException("Security setting is broken! User " + user +
-                                            " cannot send message [" +
-                                            msg.getText() +
-                                            "] to topic " +
-                                            topic);
-      }
-
-      session.close();
-      session1.close();
-   }
-
-   // Check the user has neither send nor receive permission on topic
-   private static void checkUserNoSendNoReceive(final Topic topic,
-                                                final Connection connection,
-                                                final String user) throws JMSException {
-      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      MessageProducer producer = session.createProducer(topic);
-
-      try {
-         session.createConsumer(topic);
-      }
-      catch (JMSException e) {
-         System.out.println("User " + user + " cannot create consumer on topic " + topic);
-      }
-
-      TextMessage msg = session.createTextMessage("hello-world-3");
-      try {
-         producer.send(msg);
-         throw new IllegalStateException("Security setting is broken! User " + user +
-                                            " can send message [" +
-                                            msg.getText() +
-                                            "] to topic " +
-                                            topic);
-      }
-      catch (JMSException e) {
-         System.out.println("User " + user + " cannot send message [" + msg.getText() + "] to topic: " + topic);
-      }
-
-      session.close();
-   }
-
-   // Check the user connection has both send and receive permissions on the topic
-   private static void checkUserSendAndReceive(final Topic topic,
-                                               final Connection connection,
-                                               final String user) throws JMSException {
-      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      TextMessage msg = session.createTextMessage("hello-world-4");
-      MessageProducer producer = session.createProducer(topic);
-      MessageConsumer consumer = session.createConsumer(topic);
-      producer.send(msg);
-      TextMessage receivedMsg = (TextMessage) consumer.receive(5000);
-      if (receivedMsg != null) {
-         System.out.println("User " + user + " can send message: [" + msg.getText() + "] to topic: " + topic);
-         System.out.println("User " + user + " can receive message: [" + msg.getText() + "] from topic: " + topic);
-      }
-      else {
-         throw new IllegalStateException("Error! User " + user + " cannot receive the message! ");
-      }
-      session.close();
-   }
-
-   private static Connection createConnection(final String username,
-                                              final String password,
-                                              final ConnectionFactory cf) throws JMSException {
-      return cf.createConnection(username, password);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/security/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/security/src/main/resources/activemq/server0/artemis-roles.properties b/examples/broker-features/standard/security/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 09b3f5d..0000000
--- a/examples/broker-features/standard/security/src/main/resources/activemq/server0/artemis-roles.properties
+++ /dev/null
@@ -1,20 +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.
-## ---------------------------------------------------------------------------
-bill=user
-andrew=europe-user,user
-frank=us-user,news-user,user
-sam=news-user,user
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/security/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/security/src/main/resources/activemq/server0/artemis-users.properties b/examples/broker-features/standard/security/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 0a206c6..0000000
--- a/examples/broker-features/standard/security/src/main/resources/activemq/server0/artemis-users.properties
+++ /dev/null
@@ -1,20 +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.
-## ---------------------------------------------------------------------------
-bill=activemq
-andrew=activemq1
-frank=activemq2
-sam=activemq3
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/security/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/security/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/security/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 6a8b82b..0000000
--- a/examples/broker-features/standard/security/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?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">
-      <topic name="genericTopic"/>
-
-      <topic name="news.europe.europeTopic"/>
-
-      <topic name="news.us.usTopic"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!-- any user can have full control of generic topics -->
-         <security-setting match="jms.topic.#">
-            <permission type="createDurableQueue" roles="user"/>
-            <permission type="deleteDurableQueue" roles="user"/>
-            <permission type="createNonDurableQueue" roles="user"/>
-            <permission type="deleteNonDurableQueue" roles="user"/>
-            <permission type="send" roles="user"/>
-            <permission type="consume" roles="user"/>
-         </security-setting>
-
-         <security-setting match="jms.topic.news.europe.#">
-            <permission type="createDurableQueue" roles="user"/>
-            <permission type="deleteDurableQueue" roles="user"/>
-            <permission type="createNonDurableQueue" roles="user"/>
-            <permission type="deleteNonDurableQueue" roles="user"/>
-            <permission type="send" roles="europe-user"/>
-            <permission type="consume" roles="news-user"/>
-         </security-setting>
-
-         <security-setting match="jms.topic.news.us.#">
-            <permission type="createDurableQueue" roles="user"/>
-            <permission type="deleteDurableQueue" roles="user"/>
-            <permission type="createNonDurableQueue" roles="user"/>
-            <permission type="deleteNonDurableQueue" roles="user"/>
-            <permission type="send" roles="us-user"/>
-            <permission type="consume" roles="news-user"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/security/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/security/src/main/resources/jndi.properties b/examples/broker-features/standard/security/src/main/resources/jndi.properties
deleted file mode 100644
index 0a3b640..0000000
--- a/examples/broker-features/standard/security/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,22 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-topic.topic/genericTopic=genericTopic
-topic.topic/europeTopic=news.europe.europeTopic
-topic.topic/usTopic=news.us.usTopic

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/send-acknowledgements/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/send-acknowledgements/pom.xml b/examples/broker-features/standard/send-acknowledgements/pom.xml
deleted file mode 100644
index 8295cdc..0000000
--- a/examples/broker-features/standard/send-acknowledgements/pom.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-<?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>send-acknowledgements</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Send Acknowledgements 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>
-               </execution>
-               <execution>
-                  <id>start</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <spawn>true</spawn>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.SendAcknowledgementsExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.broker</groupId>
-                  <artifactId>send-acknowledgements</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/send-acknowledgements/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/send-acknowledgements/readme.html b/examples/broker-features/standard/send-acknowledgements/readme.html
deleted file mode 100644
index fcc37fc..0000000
--- a/examples/broker-features/standard/send-acknowledgements/readme.html
+++ /dev/null
@@ -1,140 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Asynchronous Send Acknowledgements 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>Asynchronous Send Acknowledgements 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>Asynchronous Send Acknowledgements are an advanced feature of ActiveMQ Artemis which allow you to
-     receive acknowledgements that messages were successfully received at the server in a separate thread to the sending thread<p/>
-     <p>In this example we create a normal JMS session, then set a SendAcknowledgementHandler on the JMS
-     session's underlying core session. We send many messages to the server without blocking and asynchronously
-     receive send acknowledgements via the SendAcknowledgementHandler.
-
-     <p>For more information on Asynchronous Send Acknowledgements please see the user manual</p>
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>Define a SendAcknowledgementHandler which will receive asynchronous acknowledgements</li>
-        <pre class="prettyprint">
-           <code>
-         class MySendAcknowledgementsHandler implements SendAcknowledgementHandler
-         {
-            int count = 0;
-
-            public void sendAcknowledged(final Message message)
-            {
-               System.out.println("Received send acknowledgement for message " + count++);
-            }
-         }
-           </code>
-        </pre>
-
-        <li>Create a JMS session</li>
-        <pre class="prettyprint">
-          <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-       </pre>
-
-        <li>Set the handler on the underlying core session</li>
-        <pre class="prettyprint">
-           <code>
-         ClientSession coreSession = ((ActiveMQSession)session).getCoreSession();
-
-         coreSession.setSendAcknowledgementHandler(new MySendAcknowledgementsHandler());
-
-           </code>
-        </pre>
-
-        <li>Create a JMS Message Producer</li>
-        <pre class="prettyprint">
-           <code>
-         MessageProducer producer = session.createProducer(queue);
-
-         producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-           </code>
-        </pre>
-
-        <li>Send 5000 messages, the handler will get called asynchronously some time later after the messages are sent.</li>
-          <pre class="prettyprint">
-           <code>
-         final int numMessages = 5000;
-
-         for (int i = 0; i < numMessages; i++)
-         {
-            javax.jms.Message jmsMessage = session.createMessage();
-
-            producer.send(jmsMessage);
-
-            System.out.println("Sent message " + i);
-         }
-           </code>
-        </pre>
-
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/send-acknowledgements/src/main/java/org/apache/activemq/artemis/jms/example/SendAcknowledgementsExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/send-acknowledgements/src/main/java/org/apache/activemq/artemis/jms/example/SendAcknowledgementsExample.java b/examples/broker-features/standard/send-acknowledgements/src/main/java/org/apache/activemq/artemis/jms/example/SendAcknowledgementsExample.java
deleted file mode 100644
index 578d198..0000000
--- a/examples/broker-features/standard/send-acknowledgements/src/main/java/org/apache/activemq/artemis/jms/example/SendAcknowledgementsExample.java
+++ /dev/null
@@ -1,104 +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.DeliveryMode;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.naming.InitialContext;
-
-import org.apache.activemq.artemis.api.core.Message;
-import org.apache.activemq.artemis.api.core.client.ClientSession;
-import org.apache.activemq.artemis.api.core.client.SendAcknowledgementHandler;
-import org.apache.activemq.artemis.jms.client.ActiveMQSession;
-
-/**
- * Asynchronous Send Acknowledgements are an advanced feature of ActiveMQ Artemis which allow you to
- * receive acknowledgements that messages were successfully received at the server in a separate stream
- * to the stream of messages being sent to the server.
- * For more information please see the readme.html file
- */
-public class SendAcknowledgementsExample {
-
-   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. Define a SendAcknowledgementHandler which will receive asynchronous acknowledgements
-         class MySendAcknowledgementsHandler implements SendAcknowledgementHandler {
-
-            int count = 0;
-
-            public void sendAcknowledged(final Message message) {
-               System.out.println("Received send acknowledgement for message " + count++);
-            }
-         }
-
-         // Step 6. Create a JMS Session
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 7. Set the handler on the underlying core session
-
-         ClientSession coreSession = ((ActiveMQSession) session).getCoreSession();
-
-         coreSession.setSendAcknowledgementHandler(new MySendAcknowledgementsHandler());
-
-         // Step 6. Create a JMS Message Producer
-         MessageProducer producer = session.createProducer(queue);
-
-         producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-
-         // Step 7. Send 5000 messages, the handler will get called asynchronously some time later after the messages
-         // are sent.
-
-         final int numMessages = 5000;
-
-         for (int i = 0; i < numMessages; i++) {
-            javax.jms.Message jmsMessage = session.createMessage();
-
-            producer.send(jmsMessage);
-
-            System.out.println("Sent message " + i);
-         }
-      }
-      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/6b17d966/examples/broker-features/standard/send-acknowledgements/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/send-acknowledgements/src/main/resources/jndi.properties b/examples/broker-features/standard/send-acknowledgements/src/main/resources/jndi.properties
deleted file mode 100644
index 8421f25..0000000
--- a/examples/broker-features/standard/send-acknowledgements/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616?confirmationWindowSize=1048576
-queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/spring-integration/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/spring-integration/pom.xml b/examples/broker-features/standard/spring-integration/pom.xml
deleted file mode 100644
index 238a550..0000000
--- a/examples/broker-features/standard/spring-integration/pom.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?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>spring-integration</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Spring Integration Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-spring-integration</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
-      <dependency>
-         <groupId>org.springframework</groupId>
-         <artifactId>spring-context</artifactId>
-      </dependency>
-   </dependencies>
-
-   <build>
-      <plugins>
-         <plugin>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-maven-plugin</artifactId>
-            <executions>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.SpringExample</clientClass>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.broker</groupId>
-                  <artifactId>spring-integration</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/spring-integration/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/spring-integration/readme.html b/examples/broker-features/standard/spring-integration/readme.html
deleted file mode 100644
index a3855d0..0000000
--- a/examples/broker-features/standard/spring-integration/readme.html
+++ /dev/null
@@ -1,36 +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.
--->
-
-<html>
-   <head>
-      <title>ActiveMQ Artemis Spring 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>ActiveMQ Artemis Spring Example</h1>
-
-      <p>This examples shows how to setup and run an embedded JMS server within a Spring ApplicationContext using ActiveMQ Artemis along with ActiveMQ Artemis configuration files.</p>
-
-      <h2>Example step-by-step</h2>
-      <p><i><b>YOU MUST DOWNLOAD THE SPRING LIBRARIES TO RUN THIS EXAMPLE!!!</b>  You must also modify the build.xml file to include the spring jars.  You'll see the placeholder that is already there.</i></p>
-      <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-   </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/ExampleListener.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/ExampleListener.java b/examples/broker-features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/ExampleListener.java
deleted file mode 100644
index 3d4e063..0000000
--- a/examples/broker-features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/ExampleListener.java
+++ /dev/null
@@ -1,37 +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.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.TextMessage;
-
-public class ExampleListener implements MessageListener {
-
-   protected static String lastMessage = null;
-
-   public void onMessage(Message message) {
-      try {
-         lastMessage = ((TextMessage) message).getText();
-      }
-      catch (JMSException e) {
-         throw new RuntimeException(e);
-      }
-      System.out.println("MESSAGE RECEIVED: " + lastMessage);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/MessageSender.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/MessageSender.java b/examples/broker-features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/MessageSender.java
deleted file mode 100644
index 594c69b..0000000
--- a/examples/broker-features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/MessageSender.java
+++ /dev/null
@@ -1,71 +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.Destination;
-import javax.jms.JMSException;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-public class MessageSender {
-
-   private ConnectionFactory connectionFactory;
-   private Destination destination;
-
-   public ConnectionFactory getConnectionFactory() {
-      return connectionFactory;
-   }
-
-   public void setConnectionFactory(ConnectionFactory connectionFactory) {
-      this.connectionFactory = connectionFactory;
-   }
-
-   public Destination getDestination() {
-      return destination;
-   }
-
-   public void setDestination(Destination destination) {
-      this.destination = destination;
-   }
-
-   public void send(String msg) {
-      Connection conn = null;
-      try {
-         conn = connectionFactory.createConnection();
-         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageProducer producer = session.createProducer(destination);
-         TextMessage message = session.createTextMessage(msg);
-         producer.send(message);
-      }
-      catch (Exception ex) {
-         ex.printStackTrace();
-      }
-      finally {
-         if (conn != null) {
-            try {
-               conn.close();
-            }
-            catch (JMSException e) {
-               e.printStackTrace();
-            }
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/SpringExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/SpringExample.java b/examples/broker-features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/SpringExample.java
deleted file mode 100644
index cf3ec49..0000000
--- a/examples/broker-features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/SpringExample.java
+++ /dev/null
@@ -1,32 +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 org.springframework.context.support.ClassPathXmlApplicationContext;
-
-public class SpringExample {
-
-   public static void main(String[] args) throws Exception {
-      System.out.println("Creating bean factory...");
-      ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"spring-jms-beans.xml"});
-      MessageSender sender = (MessageSender) context.getBean("MessageSender");
-      System.out.println("Sending message...");
-      sender.send("Hello world");
-      Thread.sleep(100);
-      context.destroy();
-   }
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/spring-integration/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/spring-integration/src/main/resources/broker.xml b/examples/broker-features/standard/spring-integration/src/main/resources/broker.xml
deleted file mode 100644
index 2970329..0000000
--- a/examples/broker-features/standard/spring-integration/src/main/resources/broker.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?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">
-
-      <persistence-enabled>false</persistence-enabled>
-
-      <acceptors>
-         <acceptor name="in-vm">vm://0</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="#">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/spring-integration/src/main/resources/spring-jms-beans.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/spring-integration/src/main/resources/spring-jms-beans.xml b/examples/broker-features/standard/spring-integration/src/main/resources/spring-jms-beans.xml
deleted file mode 100644
index a67de73..0000000
--- a/examples/broker-features/standard/spring-integration/src/main/resources/spring-jms-beans.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-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.
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
-
-   <bean id="securityManager" class="org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl">
-      <constructor-arg>
-         <bean class="org.apache.activemq.artemis.core.config.impl.SecurityConfiguration">
-            <constructor-arg name="users">
-               <map>
-                  <entry key="guest" value="guest"/>
-               </map>
-            </constructor-arg>
-            <constructor-arg name="roles">
-               <map>
-                  <entry key="guest">
-                     <list>
-                        <value>guest</value>
-                     </list>
-                  </entry>
-               </map>
-            </constructor-arg>
-            <property name="DefaultUser" value="guest"/>
-         </bean>
-      </constructor-arg>
-   </bean>
-
-   <bean id="EmbeddedJms" class="org.apache.activemq.artemis.integration.spring.SpringJmsBootstrap" init-method="start"
-         destroy-method="stop">
-       <property name="SecurityManager" ref="securityManager"/>
-   </bean>
-
-   <bean id="connectionFactory" class="org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory">
-      <constructor-arg value="false"/>
-      <constructor-arg>
-         <bean class="org.apache.activemq.artemis.api.core.TransportConfiguration">
-            <constructor-arg value="org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory"/>
-         </bean>
-      </constructor-arg>
-   </bean>
-
-   <bean id="exampleQueue" class="org.apache.activemq.artemis.jms.client.ActiveMQQueue">
-      <constructor-arg index="0" value="exampleQueue"/>
-   </bean>
-
-   <bean id="listener" class="org.apache.activemq.artemis.jms.example.ExampleListener"/>
-
-   <bean id="MessageSender" class="org.apache.activemq.artemis.jms.example.MessageSender">
-      <property name="connectionFactory" ref="connectionFactory"/>
-      <property name="destination" ref="exampleQueue"/>
-   </bean>
-
-   <bean id="listenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
-      <property name="connectionFactory" ref="connectionFactory"/>
-      <property name="destination" ref="exampleQueue"/>
-      <property name="messageListener" ref="listener"/>
-   </bean>
-</beans>
-

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/ssl-enabled/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/ssl-enabled/pom.xml b/examples/broker-features/standard/ssl-enabled/pom.xml
deleted file mode 100644
index 7a76435..0000000
--- a/examples/broker-features/standard/ssl-enabled/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>ssl-enabled</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS SSL Enabled 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>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <testURI>tcp://localhost:5500?sslEnabled=true&amp;trustStorePath=activemq/server0/activemq.example.truststore&amp;trustStorePassword=activemqexample</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.SSLExample</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>ssl-enabled</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/ssl-enabled/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/ssl-enabled/readme.html b/examples/broker-features/standard/ssl-enabled/readme.html
deleted file mode 100644
index bb5e724..0000000
--- a/examples/broker-features/standard/ssl-enabled/readme.html
+++ /dev/null
@@ -1,56 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS SSL 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 SSL 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 configure SSL with ActiveMQ Artemis to send and receive message. </p>
-
-     <p>Using SSL can make your messaging applications interact with ActiveMQ Artemis securely. An application can
-     be secured transparently without extra coding effort. To secure your messaging application with SSL, you need to configure connector and acceptor as follows:</p>
-
-     <p>
-        <pre class="prettyprint">
-           <code>
-      &lt;!-- Connector --&gt;
-
-      &lt;connector name=&quot;netty-ssl-connector&quot;&gt;tcp://localhost:5500?sslEnabled=true;keyStorePath=activemq/server0/activemq.example.keystore;keyStorePassword=activemqexample&lt;/connector&gt;
-
-      &lt;!-- Acceptor --&gt;
-
-      &lt;acceptor name=&quot;netty-ssl-acceptor&quot;&gt;tcp://localhost:5500?sslEnabled=true;keyStorePath=activemq/server0/activemq.example.keystore;keyStorePassword=activemqexample&lt;/acceptor&gt;
-
-           </code>
-        </pre>
-     </p>
-
-     <p>In the configuration, the activemq.example.keystore is the key store file holding the server's certificate. The activemq.example.truststore
-     is the file holding the certificates which the client trusts (i.e. the server's certificate exported from activemq.example.keystore). They are pre-generated for illustration purpose<a id="fnr1" href="readme.html#fn1"><sup>1</sup></a>.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/ssl-enabled/src/main/java/org/apache/activemq/artemis/jms/example/SSLExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/ssl-enabled/src/main/java/org/apache/activemq/artemis/jms/example/SSLExample.java b/examples/broker-features/standard/ssl-enabled/src/main/java/org/apache/activemq/artemis/jms/example/SSLExample.java
deleted file mode 100644
index 27bf739..0000000
--- a/examples/broker-features/standard/ssl-enabled/src/main/java/org/apache/activemq/artemis/jms/example/SSLExample.java
+++ /dev/null
@@ -1,86 +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.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 uses SSL secure transport.
- */
-public class SSLExample {
-
-   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());
-
-         initialContext.close();
-      }
-      finally {
-         // Step 12. Be sure to close our JMS resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}


[18/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-failback/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/replicated-failback/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..da5a656
--- /dev/null
+++ b/examples/features/ha/replicated-failback/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,102 @@
+<?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>
+
+      <cluster-user>exampleUser</cluster-user>
+
+      <cluster-password>secret</cluster-password>
+
+      <ha-policy>
+         <replication>
+            <slave>
+               <allow-failback>true</allow-failback>
+            </slave>
+         </replication>
+      </ha-policy>
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-live-connector">tcp://localhost:61616</connector>
+         <connector name="netty-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <broadcast-groups>
+         <broadcast-group name="bg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>1000</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="dg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>5000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <discovery-group-ref discovery-group-name="dg-group1"/>
+         </cluster-connection>
+      </cluster-connections>
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-failback/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback/src/main/resources/jndi.properties b/examples/features/ha/replicated-failback/src/main/resources/jndi.properties
new file mode 100644
index 0000000..7f7a19f
--- /dev/null
+++ b/examples/features/ha/replicated-failback/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/6b17d966/examples/features/ha/replicated-multiple-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-multiple-failover/pom.xml b/examples/features/ha/replicated-multiple-failover/pom.xml
new file mode 100644
index 0000000..23dcfd7
--- /dev/null
+++ b/examples/features/ha/replicated-multiple-failover/pom.xml
@@ -0,0 +1,118 @@
+<?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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>replicated-multiple-failover</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Replicated Multiple Failover Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server2</instance>
+                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedMultipleFailoverExample
+                     </clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                        <param>${basedir}/target/server2</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>replicated-multiple-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-multiple-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-multiple-failover/readme.html b/examples/features/ha/replicated-multiple-failover/readme.html
new file mode 100644
index 0000000..da37085
--- /dev/null
+++ b/examples/features/ha/replicated-multiple-failover/readme.html
@@ -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.
+-->
+
+<html>
+  <head>
+    <title>ActiveMQ Artemis JMS Multiple Failover using Replication 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 Multiple Failover using Replication Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
+
+
+     <p>This example demonstrates three servers coupled as a live-backup-backup group for high availability (HA) using replication, and a client
+     connection failing over from live to backup when the live server is crashed and then to the second backup once the new live fails.</p>
+
+     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
+     section of the user manual.</p>
+
+     <h2>Example step-by-step</h2>
+     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
+     <p>In this example, the live server is server 1, and the backup server is server 0</p>
+     <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
+     seamlessly on server 0, the backup server.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedMultipleFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedMultipleFailoverExample.java b/examples/features/ha/replicated-multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedMultipleFailoverExample.java
new file mode 100644
index 0000000..491d792
--- /dev/null
+++ b/examples/features/ha/replicated-multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedMultipleFailoverExample.java
@@ -0,0 +1,149 @@
+/*
+ * 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 org.apache.activemq.artemis.util.ServerUtil;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+public class ReplicatedMultipleFailoverExample {
+
+   private static Process server0;
+
+   private static Process server1;
+
+   private static Process server2;
+
+   public static void main(final String[] args) throws Exception {
+      final int numMessages = 30;
+
+      Connection connection = null;
+
+      InitialContext initialContext = null;
+
+      try {
+         server0 = ServerUtil.startServer(args[0], ReplicatedMultipleFailoverExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], ReplicatedMultipleFailoverExample.class.getSimpleName() + "1", 1, 5000);
+         server2 = ServerUtil.startServer(args[2], ReplicatedMultipleFailoverExample.class.getSimpleName() + "2", 2, 5000);
+
+         Process[] processes = new Process[]{server0, server1, server2};
+
+         // Step 1. Get an initial context for looking up JNDI from the server #1
+         initialContext = new InitialContext();
+
+         // Step 2. Look up the JMS resources from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 3. Create a JMS Connection
+         connection = connectionFactory.createConnection();
+
+         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
+         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+         // Step 5. Start the connection to ensure delivery occurs
+         connection.start();
+
+         // Step 6. Create a JMS MessageProducer and a MessageConsumer
+         MessageProducer producer = session.createProducer(queue);
+         MessageConsumer consumer = session.createConsumer(queue);
+
+         // Step 7. Send some messages to server #1, the live server
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session.createTextMessage("This is text message " + i);
+            producer.send(message);
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 8. Receive and acknowledge a third of the sent messages
+         TextMessage message0 = null;
+         for (int i = 0; i < numMessages / 3; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+         message0.acknowledge();
+
+         // Step 9. Receive the rest third of the sent messages but *do not* acknowledge them yet
+         for (int i = numMessages / 3; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+
+         // Step 10. Crash server #0, the live server, and wait a little while to make sure
+         // it has really crashed
+         ServerUtil.killServer(server0);
+         Thread.sleep(5000);
+
+         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
+         // backup server has occurred
+         try {
+            message0.acknowledge();
+         }
+         catch (JMSException e) {
+            System.err.println("Got exception while acknowledging message: " + e.getMessage());
+         }
+
+         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
+         for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
+         }
+         message0.acknowledge();
+
+         ServerUtil.killServer(processes[ServerUtil.getServer(connection)]);
+
+         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
+         // backup server has occurred
+         try {
+            message0.acknowledge();
+         }
+         catch (JMSException e) {
+            System.err.println("Got exception while acknowledging message: " + e.getMessage());
+         }
+
+         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
+         for (int i = (numMessages / 3) * 2; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
+         }
+         message0.acknowledge();
+      }
+      finally {
+         // Step 13. Be sure to close our resources!
+
+         if (connection != null) {
+            connection.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
+         ServerUtil.killServer(server2);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..43f1693
--- /dev/null
+++ b/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,95 @@
+<?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>
+
+      <ha-policy>
+         <replication>
+            <master/>
+         </replication>
+      </ha-policy>
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <broadcast-groups>
+         <broadcast-group name="bg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>1000</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="dg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>60000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <discovery-group-ref discovery-group-name="dg-group1"/>
+         </cluster-connection>
+      </cluster-connections>
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..7f17fb8
--- /dev/null
+++ b/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,95 @@
+<?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>
+
+      <ha-policy>
+         <replication>
+            <slave/>
+         </replication>
+      </ha-policy>
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <broadcast-groups>
+         <broadcast-group name="bg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>1000</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="dg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>60000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <discovery-group-ref discovery-group-name="dg-group1"/>
+         </cluster-connection>
+      </cluster-connections>
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml b/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml
new file mode 100644
index 0000000..c5f06cc
--- /dev/null
+++ b/examples/features/ha/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml
@@ -0,0 +1,95 @@
+<?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>
+
+      <ha-policy>
+         <replication>
+            <slave/>
+         </replication>
+      </ha-policy>
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61618</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
+      </acceptors>
+
+      <broadcast-groups>
+         <broadcast-group name="bg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>1000</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="dg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>60000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <discovery-group-ref discovery-group-name="dg-group1"/>
+         </cluster-connection>
+      </cluster-connections>
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-multiple-failover/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-multiple-failover/src/main/resources/jndi.properties b/examples/features/ha/replicated-multiple-failover/src/main/resources/jndi.properties
new file mode 100644
index 0000000..7f7a19f
--- /dev/null
+++ b/examples/features/ha/replicated-multiple-failover/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/6b17d966/examples/features/ha/replicated-transaction-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-transaction-failover/pom.xml b/examples/features/ha/replicated-transaction-failover/pom.xml
new file mode 100644
index 0000000..4c1839e
--- /dev/null
+++ b/examples/features/ha/replicated-transaction-failover/pom.xml
@@ -0,0 +1,104 @@
+<?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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>replicated-transaction-failover</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Replicated Transaction Failover Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedTransactionFailoverExample
+                     </clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>replicated-transaction-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-transaction-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-transaction-failover/readme.html b/examples/features/ha/replicated-transaction-failover/readme.html
new file mode 100644
index 0000000..4206588
--- /dev/null
+++ b/examples/features/ha/replicated-transaction-failover/readme.html
@@ -0,0 +1,148 @@
+<!--
+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 Failover With Transaction using Replication 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 Failover With Transaction using Replication Example</h1>
+
+     <p>This example demonstrates two servers coupled as a live-backup pair for high availability (HA) using replication, and a client
+     connection failing over from live to backup when the live server is crashed.</p>
+     <p>Failover behavior differs whether the JMS session is transacter or not.</p>
+     <p>When a <em>transacted</em> JMS session is used, once-and-only once delivery is guaranteed.</p>
+     <ul>
+        <li>if the failover occurs while there is an in-flight transaction, the transaction will be flagged as <em>rollback only</em>. In that case, the JMS client
+           will need to retry the transaction work.</li>
+        <li>if the failover occurs while there is <em>no</em> in-flight transaction, the failover will be transparent to the user.</li>
+     </ul>
+     <p>ActiveMQ Artemis also provides an example for <a href="../non-transactional-failover/readme.html">non-transaction failover</a>.</p>
+     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
+     section of the user manual.</p>
+
+     <h2>Example step-by-step</h2>
+     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
+     <p>In this example, the live server is server 1, and the backup server is server 0</p>
+     <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
+     seamlessly on server 0, the backup server.</p>
+
+     <ol>
+        <li>Get an initial context for looking up JNDI from server #1.</li>
+        <pre class="prettyprint">
+           initialContext = getContext(1);
+        </pre>
+
+        <li>Look up the JMS resources from JNDI on server #1.</li>
+        <pre class="prettyprint">
+           Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
+           ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
+        </pre>
+
+        <li>Create a JMS Connection</li>
+        <pre class="prettyprint">
+           connection = connectionFactory.createConnection();
+        </pre>
+
+        <li>Create a JMS <em>transacted</em> Session</li>
+        <pre class="prettyprint">
+           Session session = connection.createSession(true, 0);
+        </pre>
+
+        <li>Start the connection to ensure delivery occurs</li>
+        <pre class="prettyprint">
+           connection.start();
+        </pre>
+
+        <li>Create a JMS MessageProducer</li>
+        <pre class="prettyprint">
+           MessageProducer producer = session.createProducer(queue);
+        </pre>
+
+        <li>Create a JMS MessageConsumer</li>
+        <pre class="prettyprint">
+           MessageConsumer consumer = session.createConsumer(queue);
+        </pre>
+
+        <li>Send half of the messages, kill the live server and send the remaining messages</li>
+        <pre class="prettyprint">
+           sendMessages(session, producer, numMessages, true);
+        </pre>
+
+        <p>When server #1 crashes, the client automatically detects the failure and automatically
+            fails over from server #1 to server #0 (in your real program you wouldn't need to sleep).
+        </p>
+
+        <li>As failover occurred during transaction, the session has been marked for <em>rollback only</em> and commit will fail</li>
+        <pre class="prettyprint">
+           try
+           {
+              session.commit();
+           } catch (TransactionRolledBackException e)
+           {
+              System.err.println("transaction has been rolled back: " + e.getMessage());
+           }
+        </pre>
+
+        <li>We resend all the messages</li>
+        <pre class="prettyprint">
+           sendMessages(session, producer, numMessages, false);
+        </pre>
+
+        <li>We commit the session successfully: the messages will be all delivered to the activated backup server</li>
+        <pre class="prettyprint">
+           session.commit();
+        </pre>
+
+
+        <li>We are now transparently reconnected to server #0, the backup server.
+            We consume the messages sent before the crash of the live server, commit the session, and check there are no other message on the queue</li>
+        <pre class="prettyprint">
+        for (int i = 0; i &lt; numMessages; i++)
+        {
+           TextMessage message0 = (TextMessage)consumer.receive(5000);
+           System.out.println("Got message: " + message0.getText());
+        }
+        session.commit();
+        System.out.println("Other message on the server? " + consumer.receive(5000));
+        </pre>
+
+        <li>And finally, <strong>always</strong> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
+
+        <pre class="prettyprint">
+           finally
+           {
+              if (connection != null)
+              {
+                 connection.close();
+              }
+
+              if (initialContext != null)
+              {
+                 initialContext.close();
+              }
+           }
+        </pre>
+
+     </ol>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedTransactionFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedTransactionFailoverExample.java b/examples/features/ha/replicated-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedTransactionFailoverExample.java
new file mode 100644
index 0000000..e6887c7
--- /dev/null
+++ b/examples/features/ha/replicated-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedTransactionFailoverExample.java
@@ -0,0 +1,168 @@
+/*
+ * 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 org.apache.activemq.artemis.api.core.Message;
+import org.apache.activemq.artemis.util.ServerUtil;
+
+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.jms.TransactionRolledBackException;
+import javax.naming.InitialContext;
+
+/**
+ * A simple example that demonstrates failover of the JMS connection from one node to another
+ * when the live server crashes using a JMS <em>transacted</em> session and replication.
+ */
+public class ReplicatedTransactionFailoverExample {
+
+   private static Process server0;
+
+   private static Process server1;
+
+   // You need to guarantee uniqueIDs when using duplicate detection
+   // It needs to be unique even after a restart
+   // as these IDs are stored on the journal for control
+   // We recommend some sort of UUID, but for this example the Current Time as string would be enough
+   private static String uniqueID = Long.toString(System.currentTimeMillis());
+
+   public static void main(final String[] args) throws Exception {
+      final int numMessages = 10;
+
+      Connection connection = null;
+
+      InitialContext initialContext = null;
+
+      try {
+         server0 = ServerUtil.startServer(args[0], ReplicatedTransactionFailoverExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], ReplicatedTransactionFailoverExample.class.getSimpleName() + "1", 1, 5000);
+
+         // Step 1. Get an initial context for looking up JNDI from the server #1
+         initialContext = new InitialContext();
+
+         // Step 2. Look-up the JMS resources from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 3. We create a JMS Connection
+         connection = connectionFactory.createConnection();
+
+         // Step 4. We create a *transacted* JMS Session
+         Session session = connection.createSession(true, 0);
+
+         // Step 5. We start the connection to ensure delivery occurs
+         connection.start();
+
+         // Step 6. We create a JMS MessageProducer
+         MessageProducer producer = session.createProducer(queue);
+
+         // Step 7. We create a JMS MessageConsumer
+         MessageConsumer consumer = session.createConsumer(queue);
+
+         // Step 8. We send half of the messages, kill the live server and send the remaining messages
+         sendMessages(session, producer, numMessages, true);
+
+         // Step 9. As failover occurred during transaction, the session has been marked for rollback only
+         try {
+            session.commit();
+         }
+         catch (TransactionRolledBackException e) {
+            System.err.println("transaction has been rolled back: " + e.getMessage());
+         }
+
+         // Step 10. We resend all the messages
+         sendMessages(session, producer, numMessages, false);
+
+         // Step 11. We commit the session successfully: the messages will be all delivered to the activated backup
+         // server
+         session.commit();
+
+         // Step 12. We are now transparently reconnected to server #0, the backup server.
+         // We consume the messages sent before the crash of the live server and commit the session.
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message0 = (TextMessage) consumer.receive(5000);
+
+            if (message0 == null) {
+               throw new IllegalStateException("Example failed - message wasn't received");
+            }
+
+            System.out.println("Got message: " + message0.getText());
+         }
+
+         session.commit();
+
+         System.out.println("Other message on the server? " + consumer.receive(5000));
+      }
+      finally {
+         // Step 13. Be sure to close our resources!
+
+         if (connection != null) {
+            connection.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
+      }
+   }
+
+   private static void sendMessages(final Session session,
+                                    final MessageProducer producer,
+                                    final int numMessages,
+                                    final boolean killServer) throws Exception {
+      // We send half of messages
+      for (int i = 0; i < numMessages / 2; i++) {
+         TextMessage message = session.createTextMessage("This is text message " + i);
+
+         // We set the duplicate detection header - so the server will ignore the same message
+         // if sent again after failover
+
+         message.setStringProperty(Message.HDR_DUPLICATE_DETECTION_ID.toString(), uniqueID + i);
+
+         producer.send(message);
+
+         System.out.println("Sent message: " + message.getText());
+      }
+
+      if (killServer) {
+         ServerUtil.killServer(server0);
+      }
+
+      // We send the remaining half of messages
+      for (int i = numMessages / 2; i < numMessages; i++) {
+         TextMessage message = session.createTextMessage("This is text message " + i);
+
+         // We set the duplicate detection header - so the server will ignore the same message
+         // if sent again after failover
+
+         message.setStringProperty(Message.HDR_DUPLICATE_DETECTION_ID.toString(), uniqueID + i);
+
+         producer.send(message);
+
+         System.out.println("Sent message: " + message.getText());
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..f8b076a
--- /dev/null
+++ b/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,96 @@
+<?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>
+
+      <ha-policy>
+         <replication>
+            <master/>
+         </replication>
+      </ha-policy>
+
+      <!-- Connectors -->
+
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <broadcast-groups>
+         <broadcast-group name="bg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>1000</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="dg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>60000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <discovery-group-ref discovery-group-name="dg-group1"/>
+         </cluster-connection>
+      </cluster-connections>
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..f64af4e
--- /dev/null
+++ b/examples/features/ha/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,97 @@
+<?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>
+
+      <ha-policy>
+         <replication>
+            <slave/>
+         </replication>
+      </ha-policy>
+
+      <!-- Connectors -->
+
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <broadcast-groups>
+         <broadcast-group name="bg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>1000</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="dg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>60000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <discovery-group-ref discovery-group-name="dg-group1"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-transaction-failover/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-transaction-failover/src/main/resources/jndi.properties b/examples/features/ha/replicated-transaction-failover/src/main/resources/jndi.properties
new file mode 100644
index 0000000..7f7a19f
--- /dev/null
+++ b/examples/features/ha/replicated-transaction-failover/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/6b17d966/examples/features/ha/scale-down/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/scale-down/pom.xml b/examples/features/ha/scale-down/pom.xml
new file mode 100644
index 0000000..e722413
--- /dev/null
+++ b/examples/features/ha/scale-down/pom.xml
@@ -0,0 +1,105 @@
+<?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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>scale-down</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Scale Down Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ScaleDownExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>scale-down</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/scale-down/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/ha/scale-down/readme.html b/examples/features/ha/scale-down/readme.html
new file mode 100644
index 0000000..4786db3
--- /dev/null
+++ b/examples/features/ha/scale-down/readme.html
@@ -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.
+-->
+
+<html>
+  <head>
+    <title>ActiveMQ Artemis JMS Scale Down 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 Colocated Failover Shared Store Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
+
+
+     <p>This example demonstrates how you can configure a live server to scale down messages to another live server on shutdown.
+     <p>This example starts 2 live servers each one with a connector configured for the other live server.</p>
+     <p>The second live server is killed and its messages are scaled down to the first server on shutdown.</p>
+     <p>The following shows how to configure the live servers to scale down to one another.</p>
+     <pre class="prettyprint">
+     <code>
+     &lt;ha-policy>
+         &lt;live-only>
+             &lt;scale-down>
+                 &lt;connectors>
+                     &lt;connector-ref>server0-connector&lt;/connector-ref>
+                 &lt;/connectors>
+             &lt;/scale-down>
+         &lt;/live-only>
+     &lt;/ha-policy>
+     </code>
+     </pre>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java b/examples/features/ha/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java
new file mode 100644
index 0000000..3d81a38
--- /dev/null
+++ b/examples/features/ha/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java
@@ -0,0 +1,132 @@
+/*
+ * 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 org.apache.activemq.artemis.util.ServerUtil;
+
+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;
+import java.util.Hashtable;
+
+/**
+ * A simple example that demonstrates a colocated server
+ */
+public class ScaleDownExample {
+
+   private static Process server0;
+
+   private static Process server1;
+
+   public static void main(final String[] args) throws Exception {
+      final int numMessages = 30;
+
+      Connection connection = null;
+      Connection connection1 = null;
+
+      InitialContext initialContext = null;
+      InitialContext initialContext1 = null;
+
+      try {
+         server0 = ServerUtil.startServer(args[0], ScaleDownExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], ScaleDownExample.class.getSimpleName() + "1", 1, 5000);
+
+         // Step 1. Get an initial context for looking up JNDI for both servers
+         Hashtable<String, Object> properties = new Hashtable<String, Object>();
+         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("queue.queue/exampleQueue", "exampleQueue");
+         initialContext = new InitialContext(properties);
+
+         properties = new Hashtable<String, Object>();
+         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         initialContext1 = new InitialContext(properties);
+
+         // Step 2. Look up the JMS resources from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+         ConnectionFactory connectionFactory1 = (ConnectionFactory) initialContext1.lookup("ConnectionFactory");
+
+         // Step 3. Create a JMS Connections
+         connection = connectionFactory.createConnection();
+         connection1 = connectionFactory1.createConnection();
+
+         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 5. Create a JMS MessageProducers
+         MessageProducer producer = session.createProducer(queue);
+         MessageProducer producer1 = session1.createProducer(queue);
+
+         // Step 6. Send some messages to both servers
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session.createTextMessage("This is text message " + i);
+            producer.send(message);
+            System.out.println("Sent message: " + message.getText());
+            message = session1.createTextMessage("This is another text message " + i);
+            producer1.send(message);
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 7. Crash server #1
+         ServerUtil.killServer(server1);
+
+         // Step 8. start the connection ready to receive messages
+         connection.start();
+
+         // Step 9.create a consumer
+         MessageConsumer consumer = session.createConsumer(queue);
+
+         // Step 10. Receive and acknowledge all of the sent messages, the backup server that is colocated with server 1
+         // will have become live and is now handling messages for server 0.
+         TextMessage message0 = null;
+         for (int i = 0; i < numMessages * 2; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+         message0.acknowledge();
+      }
+      finally {
+         // Step 11. Be sure to close our resources!
+
+         if (connection != null) {
+            connection.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection1 != null) {
+            connection1.close();
+         }
+
+         if (initialContext1 != null) {
+            initialContext1.close();
+         }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/scale-down/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/scale-down/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/scale-down/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..559bb5a
--- /dev/null
+++ b/examples/features/ha/scale-down/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,117 @@
+<?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>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <reconnect-attempts>5</reconnect-attempts>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <ha-policy/>
+
+      <!-- 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">
+            <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"/>
+            <permission type="manage" roles="guest"/>
+         </security-setting>
+         <security-setting match="jms.queue.activemq.management.*">
+            <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"/>
+            <permission type="manage" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/scale-down/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/scale-down/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/scale-down/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..6211cd3
--- /dev/null
+++ b/examples/features/ha/scale-down/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,108 @@
+<?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:61617</connector>
+         <connector name="server0-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <reconnect-attempts>5</reconnect-attempts>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!--a live server that will scale down on server shutdown-->
+      <ha-policy>
+         <live-only>
+            <scale-down>
+               <connectors>
+                  <connector-ref>server0-connector</connector-ref>
+               </connectors>
+            </scale-down>
+         </live-only>
+      </ha-policy>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>


[41/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-transaction-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-transaction-failover/readme.html b/examples/broker-features/ha/replicated-transaction-failover/readme.html
deleted file mode 100644
index 4206588..0000000
--- a/examples/broker-features/ha/replicated-transaction-failover/readme.html
+++ /dev/null
@@ -1,148 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Failover With Transaction using Replication 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 Failover With Transaction using Replication Example</h1>
-
-     <p>This example demonstrates two servers coupled as a live-backup pair for high availability (HA) using replication, and a client
-     connection failing over from live to backup when the live server is crashed.</p>
-     <p>Failover behavior differs whether the JMS session is transacter or not.</p>
-     <p>When a <em>transacted</em> JMS session is used, once-and-only once delivery is guaranteed.</p>
-     <ul>
-        <li>if the failover occurs while there is an in-flight transaction, the transaction will be flagged as <em>rollback only</em>. In that case, the JMS client
-           will need to retry the transaction work.</li>
-        <li>if the failover occurs while there is <em>no</em> in-flight transaction, the failover will be transparent to the user.</li>
-     </ul>
-     <p>ActiveMQ Artemis also provides an example for <a href="../non-transactional-failover/readme.html">non-transaction failover</a>.</p>
-     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
-     section of the user manual.</p>
-
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-     <p>In this example, the live server is server 1, and the backup server is server 0</p>
-     <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
-     seamlessly on server 0, the backup server.</p>
-
-     <ol>
-        <li>Get an initial context for looking up JNDI from server #1.</li>
-        <pre class="prettyprint">
-           initialContext = getContext(1);
-        </pre>
-
-        <li>Look up the JMS resources from JNDI on server #1.</li>
-        <pre class="prettyprint">
-           Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-           ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-        </pre>
-
-        <li>Create a JMS Connection</li>
-        <pre class="prettyprint">
-           connection = connectionFactory.createConnection();
-        </pre>
-
-        <li>Create a JMS <em>transacted</em> Session</li>
-        <pre class="prettyprint">
-           Session session = connection.createSession(true, 0);
-        </pre>
-
-        <li>Start the connection to ensure delivery occurs</li>
-        <pre class="prettyprint">
-           connection.start();
-        </pre>
-
-        <li>Create a JMS MessageProducer</li>
-        <pre class="prettyprint">
-           MessageProducer producer = session.createProducer(queue);
-        </pre>
-
-        <li>Create a JMS MessageConsumer</li>
-        <pre class="prettyprint">
-           MessageConsumer consumer = session.createConsumer(queue);
-        </pre>
-
-        <li>Send half of the messages, kill the live server and send the remaining messages</li>
-        <pre class="prettyprint">
-           sendMessages(session, producer, numMessages, true);
-        </pre>
-
-        <p>When server #1 crashes, the client automatically detects the failure and automatically
-            fails over from server #1 to server #0 (in your real program you wouldn't need to sleep).
-        </p>
-
-        <li>As failover occurred during transaction, the session has been marked for <em>rollback only</em> and commit will fail</li>
-        <pre class="prettyprint">
-           try
-           {
-              session.commit();
-           } catch (TransactionRolledBackException e)
-           {
-              System.err.println("transaction has been rolled back: " + e.getMessage());
-           }
-        </pre>
-
-        <li>We resend all the messages</li>
-        <pre class="prettyprint">
-           sendMessages(session, producer, numMessages, false);
-        </pre>
-
-        <li>We commit the session successfully: the messages will be all delivered to the activated backup server</li>
-        <pre class="prettyprint">
-           session.commit();
-        </pre>
-
-
-        <li>We are now transparently reconnected to server #0, the backup server.
-            We consume the messages sent before the crash of the live server, commit the session, and check there are no other message on the queue</li>
-        <pre class="prettyprint">
-        for (int i = 0; i &lt; numMessages; i++)
-        {
-           TextMessage message0 = (TextMessage)consumer.receive(5000);
-           System.out.println("Got message: " + message0.getText());
-        }
-        session.commit();
-        System.out.println("Other message on the server? " + consumer.receive(5000));
-        </pre>
-
-        <li>And finally, <strong>always</strong> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           finally
-           {
-              if (connection != null)
-              {
-                 connection.close();
-              }
-
-              if (initialContext != null)
-              {
-                 initialContext.close();
-              }
-           }
-        </pre>
-
-     </ol>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedTransactionFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedTransactionFailoverExample.java b/examples/broker-features/ha/replicated-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedTransactionFailoverExample.java
deleted file mode 100644
index e6887c7..0000000
--- a/examples/broker-features/ha/replicated-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedTransactionFailoverExample.java
+++ /dev/null
@@ -1,168 +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 org.apache.activemq.artemis.api.core.Message;
-import org.apache.activemq.artemis.util.ServerUtil;
-
-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.jms.TransactionRolledBackException;
-import javax.naming.InitialContext;
-
-/**
- * A simple example that demonstrates failover of the JMS connection from one node to another
- * when the live server crashes using a JMS <em>transacted</em> session and replication.
- */
-public class ReplicatedTransactionFailoverExample {
-
-   private static Process server0;
-
-   private static Process server1;
-
-   // You need to guarantee uniqueIDs when using duplicate detection
-   // It needs to be unique even after a restart
-   // as these IDs are stored on the journal for control
-   // We recommend some sort of UUID, but for this example the Current Time as string would be enough
-   private static String uniqueID = Long.toString(System.currentTimeMillis());
-
-   public static void main(final String[] args) throws Exception {
-      final int numMessages = 10;
-
-      Connection connection = null;
-
-      InitialContext initialContext = null;
-
-      try {
-         server0 = ServerUtil.startServer(args[0], ReplicatedTransactionFailoverExample.class.getSimpleName() + "0", 0, 5000);
-         server1 = ServerUtil.startServer(args[1], ReplicatedTransactionFailoverExample.class.getSimpleName() + "1", 1, 5000);
-
-         // Step 1. Get an initial context for looking up JNDI from the server #1
-         initialContext = new InitialContext();
-
-         // Step 2. Look-up the JMS resources from JNDI
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 3. We create a JMS Connection
-         connection = connectionFactory.createConnection();
-
-         // Step 4. We create a *transacted* JMS Session
-         Session session = connection.createSession(true, 0);
-
-         // Step 5. We start the connection to ensure delivery occurs
-         connection.start();
-
-         // Step 6. We create a JMS MessageProducer
-         MessageProducer producer = session.createProducer(queue);
-
-         // Step 7. We create a JMS MessageConsumer
-         MessageConsumer consumer = session.createConsumer(queue);
-
-         // Step 8. We send half of the messages, kill the live server and send the remaining messages
-         sendMessages(session, producer, numMessages, true);
-
-         // Step 9. As failover occurred during transaction, the session has been marked for rollback only
-         try {
-            session.commit();
-         }
-         catch (TransactionRolledBackException e) {
-            System.err.println("transaction has been rolled back: " + e.getMessage());
-         }
-
-         // Step 10. We resend all the messages
-         sendMessages(session, producer, numMessages, false);
-
-         // Step 11. We commit the session successfully: the messages will be all delivered to the activated backup
-         // server
-         session.commit();
-
-         // Step 12. We are now transparently reconnected to server #0, the backup server.
-         // We consume the messages sent before the crash of the live server and commit the session.
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message0 = (TextMessage) consumer.receive(5000);
-
-            if (message0 == null) {
-               throw new IllegalStateException("Example failed - message wasn't received");
-            }
-
-            System.out.println("Got message: " + message0.getText());
-         }
-
-         session.commit();
-
-         System.out.println("Other message on the server? " + consumer.receive(5000));
-      }
-      finally {
-         // Step 13. Be sure to close our resources!
-
-         if (connection != null) {
-            connection.close();
-         }
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-
-         ServerUtil.killServer(server0);
-         ServerUtil.killServer(server1);
-      }
-   }
-
-   private static void sendMessages(final Session session,
-                                    final MessageProducer producer,
-                                    final int numMessages,
-                                    final boolean killServer) throws Exception {
-      // We send half of messages
-      for (int i = 0; i < numMessages / 2; i++) {
-         TextMessage message = session.createTextMessage("This is text message " + i);
-
-         // We set the duplicate detection header - so the server will ignore the same message
-         // if sent again after failover
-
-         message.setStringProperty(Message.HDR_DUPLICATE_DETECTION_ID.toString(), uniqueID + i);
-
-         producer.send(message);
-
-         System.out.println("Sent message: " + message.getText());
-      }
-
-      if (killServer) {
-         ServerUtil.killServer(server0);
-      }
-
-      // We send the remaining half of messages
-      for (int i = numMessages / 2; i < numMessages; i++) {
-         TextMessage message = session.createTextMessage("This is text message " + i);
-
-         // We set the duplicate detection header - so the server will ignore the same message
-         // if sent again after failover
-
-         message.setStringProperty(Message.HDR_DUPLICATE_DETECTION_ID.toString(), uniqueID + i);
-
-         producer.send(message);
-
-         System.out.println("Sent message: " + message.getText());
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/ha/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index f8b076a..0000000
--- a/examples/broker-features/ha/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?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>
-
-      <ha-policy>
-         <replication>
-            <master/>
-         </replication>
-      </ha-policy>
-
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/ha/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index f64af4e..0000000
--- a/examples/broker-features/ha/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?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>
-
-      <ha-policy>
-         <replication>
-            <slave/>
-         </replication>
-      </ha-policy>
-
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-transaction-failover/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-transaction-failover/src/main/resources/jndi.properties b/examples/broker-features/ha/replicated-transaction-failover/src/main/resources/jndi.properties
deleted file mode 100644
index 7f7a19f..0000000
--- a/examples/broker-features/ha/replicated-transaction-failover/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/ha/scale-down/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/scale-down/pom.xml b/examples/broker-features/ha/scale-down/pom.xml
deleted file mode 100644
index e722413..0000000
--- a/examples/broker-features/ha/scale-down/pom.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>scale-down</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Scale Down Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ScaleDownExample</clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                        <param>${basedir}/target/server1</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>scale-down</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/scale-down/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/scale-down/readme.html b/examples/broker-features/ha/scale-down/readme.html
deleted file mode 100644
index 4786db3..0000000
--- a/examples/broker-features/ha/scale-down/readme.html
+++ /dev/null
@@ -1,51 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Scale Down 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 Colocated Failover Shared Store Example</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
-
-
-     <p>This example demonstrates how you can configure a live server to scale down messages to another live server on shutdown.
-     <p>This example starts 2 live servers each one with a connector configured for the other live server.</p>
-     <p>The second live server is killed and its messages are scaled down to the first server on shutdown.</p>
-     <p>The following shows how to configure the live servers to scale down to one another.</p>
-     <pre class="prettyprint">
-     <code>
-     &lt;ha-policy>
-         &lt;live-only>
-             &lt;scale-down>
-                 &lt;connectors>
-                     &lt;connector-ref>server0-connector&lt;/connector-ref>
-                 &lt;/connectors>
-             &lt;/scale-down>
-         &lt;/live-only>
-     &lt;/ha-policy>
-     </code>
-     </pre>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java b/examples/broker-features/ha/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java
deleted file mode 100644
index 3d81a38..0000000
--- a/examples/broker-features/ha/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java
+++ /dev/null
@@ -1,132 +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 org.apache.activemq.artemis.util.ServerUtil;
-
-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;
-import java.util.Hashtable;
-
-/**
- * A simple example that demonstrates a colocated server
- */
-public class ScaleDownExample {
-
-   private static Process server0;
-
-   private static Process server1;
-
-   public static void main(final String[] args) throws Exception {
-      final int numMessages = 30;
-
-      Connection connection = null;
-      Connection connection1 = null;
-
-      InitialContext initialContext = null;
-      InitialContext initialContext1 = null;
-
-      try {
-         server0 = ServerUtil.startServer(args[0], ScaleDownExample.class.getSimpleName() + "0", 0, 5000);
-         server1 = ServerUtil.startServer(args[1], ScaleDownExample.class.getSimpleName() + "1", 1, 5000);
-
-         // Step 1. Get an initial context for looking up JNDI for both servers
-         Hashtable<String, Object> properties = new Hashtable<String, Object>();
-         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
-         properties.put("queue.queue/exampleQueue", "exampleQueue");
-         initialContext = new InitialContext(properties);
-
-         properties = new Hashtable<String, Object>();
-         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
-         initialContext1 = new InitialContext(properties);
-
-         // Step 2. Look up the JMS resources from JNDI
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-         ConnectionFactory connectionFactory1 = (ConnectionFactory) initialContext1.lookup("ConnectionFactory");
-
-         // Step 3. Create a JMS Connections
-         connection = connectionFactory.createConnection();
-         connection1 = connectionFactory1.createConnection();
-
-         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 5. Create a JMS MessageProducers
-         MessageProducer producer = session.createProducer(queue);
-         MessageProducer producer1 = session1.createProducer(queue);
-
-         // Step 6. Send some messages to both servers
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session.createTextMessage("This is text message " + i);
-            producer.send(message);
-            System.out.println("Sent message: " + message.getText());
-            message = session1.createTextMessage("This is another text message " + i);
-            producer1.send(message);
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 7. Crash server #1
-         ServerUtil.killServer(server1);
-
-         // Step 8. start the connection ready to receive messages
-         connection.start();
-
-         // Step 9.create a consumer
-         MessageConsumer consumer = session.createConsumer(queue);
-
-         // Step 10. Receive and acknowledge all of the sent messages, the backup server that is colocated with server 1
-         // will have become live and is now handling messages for server 0.
-         TextMessage message0 = null;
-         for (int i = 0; i < numMessages * 2; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-         message0.acknowledge();
-      }
-      finally {
-         // Step 11. Be sure to close our resources!
-
-         if (connection != null) {
-            connection.close();
-         }
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection1 != null) {
-            connection1.close();
-         }
-
-         if (initialContext1 != null) {
-            initialContext1.close();
-         }
-
-         ServerUtil.killServer(server0);
-         ServerUtil.killServer(server1);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/scale-down/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/scale-down/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/ha/scale-down/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 559bb5a..0000000
--- a/examples/broker-features/ha/scale-down/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?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>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <reconnect-attempts>5</reconnect-attempts>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <ha-policy/>
-
-      <!-- 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">
-            <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"/>
-            <permission type="manage" roles="guest"/>
-         </security-setting>
-         <security-setting match="jms.queue.activemq.management.*">
-            <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"/>
-            <permission type="manage" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/scale-down/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/scale-down/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/ha/scale-down/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 6211cd3..0000000
--- a/examples/broker-features/ha/scale-down/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?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:61617</connector>
-         <connector name="server0-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <reconnect-attempts>5</reconnect-attempts>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!--a live server that will scale down on server shutdown-->
-      <ha-policy>
-         <live-only>
-            <scale-down>
-               <connectors>
-                  <connector-ref>server0-connector</connector-ref>
-               </connectors>
-            </scale-down>
-         </live-only>
-      </ha-policy>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/stop-server-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/stop-server-failover/pom.xml b/examples/broker-features/ha/stop-server-failover/pom.xml
deleted file mode 100644
index 7fb647c..0000000
--- a/examples/broker-features/ha/stop-server-failover/pom.xml
+++ /dev/null
@@ -1,160 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>stop-server-failover</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Stop Server Failover 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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server0</instance>
-                     <sharedStore>true</sharedStore>
-                     <slave>false</slave>
-                     <dataFolder>../data</dataFolder>
-                     <failoverOnShutdown>true</failoverOnShutdown>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server1</instance>
-                     <sharedStore>true</sharedStore>
-                     <slave>true</slave>
-                     <dataFolder>../data</dataFolder>
-                     <failoverOnShutdown>true</failoverOnShutdown>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server0</location>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server1</location>
-                     <testURI>tcp://localhost:61617</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server1</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.StopServerFailoverExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server1</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>stop-server-failover</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/stop-server-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/stop-server-failover/readme.html b/examples/broker-features/ha/stop-server-failover/readme.html
deleted file mode 100644
index 9486cd6..0000000
--- a/examples/broker-features/ha/stop-server-failover/readme.html
+++ /dev/null
@@ -1,44 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Failover Without Transactions 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 Failover Without Transactions 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 two servers coupled as a live-backup pair for high availability (HA), and a client
-     connection failing over from live to backup when the live server is crashed.</p>
-     <p>Failover behavior differs whether the JMS session is transacted or not.</p>
-     <p>When a <em>non-transacted</em> JMS session is used, once and only once delivery is not guaranteed
-        and it is possible some messages will be lost or delivered twice, depending when the failover to the backup server occurs.</p>
-     <p>It is up to the client to deal with such cases. To ensure once and only once delivery, the client must
-        use transacted JMS sessions (as shown in the example for <a href="../transaction-failover/readme.html">failover with transactions</a>).</p>
-     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
-     section of the user manual.</p>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/stop-server-failover/src/main/java/org/apache/activemq/artemis/jms/example/StopServerFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/stop-server-failover/src/main/java/org/apache/activemq/artemis/jms/example/StopServerFailoverExample.java b/examples/broker-features/ha/stop-server-failover/src/main/java/org/apache/activemq/artemis/jms/example/StopServerFailoverExample.java
deleted file mode 100644
index 38f06c0..0000000
--- a/examples/broker-features/ha/stop-server-failover/src/main/java/org/apache/activemq/artemis/jms/example/StopServerFailoverExample.java
+++ /dev/null
@@ -1,117 +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.JMSException;
-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 example that demonstrates failover of the JMS connection from one node to another
- * when the live server crashes using a JMS <em>non-transacted</em> session.
- */
-public class StopServerFailoverExample {
-
-   public static void main(final String[] args) throws Exception {
-      final int numMessages = 10;
-
-      Connection connection = null;
-
-      InitialContext initialContext = null;
-
-      try {
-         // Step 1. Get an initial context for looking up JNDI from the server #1
-         initialContext = new InitialContext();
-
-         // Step 2. Look up the JMS resources from JNDI
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 3. Create a JMS Connection
-         connection = connectionFactory.createConnection();
-
-         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
-         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
-         // Step 5. Start the connection to ensure delivery occurs
-         connection.start();
-
-         // Step 6. Create a JMS MessageProducer and a MessageConsumer
-         MessageProducer producer = session.createProducer(queue);
-         MessageConsumer consumer = session.createConsumer(queue);
-
-         // Step 7. Send some messages to server #1, the live server
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session.createTextMessage("This is text message " + i);
-            producer.send(message);
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 8. Receive and acknowledge half of the sent messages
-         TextMessage message0 = null;
-         for (int i = 0; i < numMessages / 2; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-         message0.acknowledge();
-
-         // Step 9. Receive the 2nd half of the sent messages but *do not* acknowledge them yet
-         for (int i = numMessages / 2; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-
-         // Step 10. Crash server #0, the live server, and wait a little while to make sure
-         // it has really crashed
-         System.out.println("Stop the live server by logging into JConsole and then press any key to continue...");
-         System.in.read();
-
-         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
-         // backup server has occurred
-         try {
-            message0.acknowledge();
-         }
-         catch (JMSException e) {
-            System.err.println("Got exception while acknowledging message: " + e.getMessage());
-         }
-
-         // Step 12. Consume again the 2nd half of the messages again. Note that they are not considered as redelivered.
-         for (int i = numMessages / 2; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-         }
-         message0.acknowledge();
-      }
-      finally {
-         // Step 13. Be sure to close our resources!
-
-         if (connection != null) {
-            connection.close();
-         }
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/stop-server-failover/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/stop-server-failover/src/main/resources/jndi.properties b/examples/broker-features/ha/stop-server-failover/src/main/resources/jndi.properties
deleted file mode 100644
index 7f7a19f..0000000
--- a/examples/broker-features/ha/stop-server-failover/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/ha/transaction-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/transaction-failover/pom.xml b/examples/broker-features/ha/transaction-failover/pom.xml
deleted file mode 100644
index 76a4a8e..0000000
--- a/examples/broker-features/ha/transaction-failover/pom.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>transaction-failover</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Transaction Failover Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
-   </dependencies>
-
-   <build>
-      <plugins>
-         <plugin>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-maven-plugin</artifactId>
-            <executions>
-               <execution>
-                  <id>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.TransactionFailoverExample</clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                        <param>${basedir}/target/server1</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>transaction-failover</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/transaction-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/transaction-failover/readme.html b/examples/broker-features/ha/transaction-failover/readme.html
deleted file mode 100644
index 15f119f..0000000
--- a/examples/broker-features/ha/transaction-failover/readme.html
+++ /dev/null
@@ -1,46 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Failover With Transaction 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 Failover With Transaction Example</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
-
-
-     <p>This example demonstrates two servers coupled as a live-backup pair for high availability (HA), and a client
-     connection failing over from live to backup when the live server is crashed.</p>
-     <p>Failover behavior differs whether the JMS session is transacter or not.</p>
-     <p>When a <em>transacted</em> JMS session is used, once-and-only once delivery is guaranteed.</p>
-     <ul>
-        <li>if the failover occurs while there is an in-flight transaction, the transaction will be flagged as <em>rollback only</em>. In that case, the JMS client
-           will need to retry the transaction work.</li>
-        <li>if the failover occurs while there is <em>no</em> in-flight transaction, the failover will be transparent to the user.</li>
-     </ul>
-     <p>ActiveMQ Artemis also provides an example for <a href="../non-transactional-failover/readme.html">non-transaction failover</a>.</p>
-     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
-     section of the user manual.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/TransactionFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/TransactionFailoverExample.java b/examples/broker-features/ha/transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/TransactionFailoverExample.java
deleted file mode 100644
index 58c514a..0000000
--- a/examples/broker-features/ha/transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/TransactionFailoverExample.java
+++ /dev/null
@@ -1,167 +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 org.apache.activemq.artemis.api.core.Message;
-import org.apache.activemq.artemis.util.ServerUtil;
-
-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.jms.TransactionRolledBackException;
-import javax.naming.InitialContext;
-
-/**
- * A simple example that demonstrates failover of the JMS connection from one node to another
- * when the live server crashes using a JMS <em>transacted</em> session.
- */
-public class TransactionFailoverExample {
-
-   // You need to guarantee uniqueIDs when using duplicate detection
-   // It needs to be unique even after a restart
-   // as these IDs are stored on the journal for control
-   // We recommend some sort of UUID, but for this example the Current Time as string would be enough
-   static String uniqueID = Long.toString(System.currentTimeMillis());
-
-   private static Process server0;
-
-   private static Process server1;
-
-   public static void main(final String[] args) throws Exception {
-      final int numMessages = 10;
-
-      Connection connection = null;
-
-      InitialContext initialContext = null;
-
-      try {
-         server0 = ServerUtil.startServer(args[0], TransactionFailoverExample.class.getSimpleName() + "0", 0, 5000);
-         server1 = ServerUtil.startServer(args[1], TransactionFailoverExample.class.getSimpleName() + "1", 1, 5000);
-
-         // Step 1. Get an initial context for looking up JNDI from the server #1
-         initialContext = new InitialContext();
-
-         // Step 2. Look-up the JMS resources from JNDI
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 3. We create a JMS Connection
-         connection = connectionFactory.createConnection();
-
-         // Step 4. We create a *transacted* JMS Session
-         Session session = connection.createSession(true, 0);
-
-         // Step 5. We start the connection to ensure delivery occurs
-         connection.start();
-
-         // Step 6. We create a JMS MessageProducer
-         MessageProducer producer = session.createProducer(queue);
-
-         // Step 7. We create a JMS MessageConsumer
-         MessageConsumer consumer = session.createConsumer(queue);
-
-         // Step 8. We send half of the messages, kill the live server and send the remaining messages
-         sendMessages(session, producer, numMessages, true);
-
-         // Step 9. As failover occurred during transaction, the session has been marked for rollback only
-         try {
-            session.commit();
-         }
-         catch (TransactionRolledBackException e) {
-            System.err.println("transaction has been rolled back: " + e.getMessage());
-         }
-
-         // Step 10. We resend all the messages
-         sendMessages(session, producer, numMessages, false);
-
-         // Step 11. We commit the session successfully: the messages will be all delivered to the activated backup
-         // server
-         session.commit();
-
-         // Step 12. We are now transparently reconnected to server #0, the backup server.
-         // We consume the messages sent before the crash of the live server and commit the session.
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message0 = (TextMessage) consumer.receive(5000);
-
-            if (message0 == null) {
-               throw new IllegalStateException("Example failed - message wasn't received");
-            }
-
-            System.out.println("Got message: " + message0.getText());
-         }
-
-         session.commit();
-
-         System.out.println("Other message on the server? " + consumer.receive(5000));
-      }
-      finally {
-         // Step 13. Be sure to close our resources!
-
-         if (connection != null) {
-            connection.close();
-         }
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-
-         ServerUtil.killServer(server0);
-         ServerUtil.killServer(server1);
-      }
-   }
-
-   private static void sendMessages(final Session session,
-                                    final MessageProducer producer,
-                                    final int numMessages,
-                                    final boolean killServer) throws Exception {
-
-      // We send half of messages
-      for (int i = 0; i < numMessages / 2; i++) {
-         TextMessage message = session.createTextMessage("This is text message " + i);
-
-         message.setStringProperty(Message.HDR_DUPLICATE_DETECTION_ID.toString(), uniqueID + i);
-
-         producer.send(message);
-
-         System.out.println("Sent message: " + message.getText());
-      }
-
-      if (killServer) {
-         Thread.sleep(5000);
-
-         ServerUtil.killServer(server0);
-      }
-
-      // We send the remaining half of messages
-      for (int i = numMessages / 2; i < numMessages; i++) {
-         TextMessage message = session.createTextMessage("This is text message " + i);
-
-         // We set the duplicate detection header - so the server will ignore the same message
-         // if sent again after failover
-
-         message.setStringProperty(Message.HDR_DUPLICATE_DETECTION_ID.toString(), uniqueID + i);
-
-         producer.send(message);
-
-         System.out.println("Sent message: " + message.getText());
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/transaction-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/transaction-failover/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/ha/transaction-failover/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 916fdf5..0000000
--- a/examples/broker-features/ha/transaction-failover/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?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>
-
-      <ha-policy>
-         <shared-store>
-            <master>
-               <failover-on-shutdown>true</failover-on-shutdown>
-            </master>
-         </shared-store>
-      </ha-policy>
-
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/transaction-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/transaction-failover/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/ha/transaction-failover/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 055f04a..0000000
--- a/examples/broker-features/ha/transaction-failover/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?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>
-
-      <ha-policy>
-         <shared-store>
-            <slave>
-               <failover-on-shutdown>true</failover-on-shutdown>
-            </slave>
-         </shared-store>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/transaction-failover/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/transaction-failover/src/main/resources/jndi.properties b/examples/broker-features/ha/transaction-failover/src/main/resources/jndi.properties
deleted file mode 100644
index 7f7a19f..0000000
--- a/examples/broker-features/ha/transaction-failover/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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


[36/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/interceptor/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/interceptor/readme.html b/examples/broker-features/standard/interceptor/readme.html
deleted file mode 100644
index 42b1e18..0000000
--- a/examples/broker-features/standard/interceptor/readme.html
+++ /dev/null
@@ -1,72 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Interceptor 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 Interceptor 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 implement and configure a simple incoming, server-side interceptor with ActiveMQ Artemis.</p>
-
-     <p>ActiveMQ Artemis allows an application to use an interceptor to hook into the messaging system. All that needs to do is to implement the
-     Interceptor interface, as defined below: </p>
-     <pre class="prettyprint">
-     <code>
-         public interface Interceptor
-         {
-            boolean intercept(Packet packet, RemotingConnection connection) throws ActiveMQException;
-         }
-     </code>
-     </pre>
-     <p>Once you have your own interceptor class, add it to the broker.xml, as follows:</p>
-     <pre class="prettyprint">
-     <code>
-        &lt;configuration&gt;
-        ...
-           &lt;remoting-incoming-interceptors&gt;
-              &lt;class-name&gt;org.apache.activemq.artemis.jms.example.SimpleInterceptor&lt;/class-name&gt;
-           &lt;/remoting-incoming-interceptors&gt;
-        ...
-        &lt;/configuration&gt;
-     </code>
-     </pre>
-
-     <p>With interceptor, you can handle various events in message processing. In this example, a simple interceptor, SimpleInterceptor, is implemented and configured.
-     When the example is running, the interceptor will print out each events that are passed in the interceptor. And it will add a string property to the message being
-     delivered. You can see that after the message is received, there will be a new string property appears in the received message.</p>
-
-     <p>With our interceptor we always return <code>true</code> from the <code>intercept</code> method. If we were
-     to return <code>false</code> that signifies that no more interceptors are to run or the target
-     is not to be called. Return <code>false</code> to abort processing of the packet.</p>
-  </body>
-</html>
-
-
-
-
-
-

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/InterceptorExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/InterceptorExample.java b/examples/broker-features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/InterceptorExample.java
deleted file mode 100644
index b78875f..0000000
--- a/examples/broker-features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/InterceptorExample.java
+++ /dev/null
@@ -1,88 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-/**
- * A simple JMS example that shows how to implement and use interceptors with ActiveMQ Artemis.
- */
-public class InterceptorExample {
-
-   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("Sending message [" + message.getText() +
-                               "] with String property: " +
-                               message.getStringProperty("newproperty"));
-
-         // 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() +
-                               "] with String property: " +
-                               messageReceived.getStringProperty("newproperty"));
-      }
-      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/6b17d966/examples/broker-features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/SimpleInterceptor.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/SimpleInterceptor.java b/examples/broker-features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/SimpleInterceptor.java
deleted file mode 100644
index 6836930..0000000
--- a/examples/broker-features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/SimpleInterceptor.java
+++ /dev/null
@@ -1,48 +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 org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.api.core.Interceptor;
-import org.apache.activemq.artemis.api.core.Message;
-import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.core.protocol.core.Packet;
-import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionSendMessage;
-import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
-
-/**
- * A simple Interceptor implementation
- */
-public class SimpleInterceptor implements Interceptor {
-
-   public boolean intercept(final Packet packet, final RemotingConnection connection) throws ActiveMQException {
-      System.out.println("SimpleInterceptor gets called!");
-      System.out.println("Packet: " + packet.getClass().getName());
-      System.out.println("RemotingConnection: " + connection.getRemoteAddress());
-
-      if (packet instanceof SessionSendMessage) {
-         SessionSendMessage realPacket = (SessionSendMessage) packet;
-         Message msg = realPacket.getMessage();
-         msg.putStringProperty(new SimpleString("newproperty"), new SimpleString("Hello from interceptor!"));
-      }
-      // We return true which means "call next interceptor" (if there is one) or target.
-      // If we returned false, it means "abort call" - no more interceptors would be called and neither would
-      // the target
-      return true;
-   }
-
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/interceptor/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/interceptor/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/interceptor/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index fc82158..0000000
--- a/examples/broker-features/standard/interceptor/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?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.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-
-
-      <remoting-incoming-interceptors>
-         <class-name>org.apache.activemq.artemis.jms.example.SimpleInterceptor</class-name>
-      </remoting-incoming-interceptors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/interceptor/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/interceptor/src/main/resources/jndi.properties b/examples/broker-features/standard/interceptor/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/interceptor/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/jms-auto-closeable/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-auto-closeable/pom.xml b/examples/broker-features/standard/jms-auto-closeable/pom.xml
deleted file mode 100644
index 844d859..0000000
--- a/examples/broker-features/standard/jms-auto-closeable/pom.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-<?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>auto-closeable</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Auto Closable 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>
-               </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.JMSAutoCloseableExample</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>auto-closeable</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-auto-closeable/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-auto-closeable/readme.html b/examples/broker-features/standard/jms-auto-closeable/readme.html
deleted file mode 100644
index 80dc410..0000000
--- a/examples/broker-features/standard/jms-auto-closeable/readme.html
+++ /dev/null
@@ -1,96 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Auto Closable 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 Auto Closable 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 JMS resources, such as connections, sessions and consumers, in JMS 2 can be automatically closed on error.</p>
-     <p>In this instance we auto close a connection after a subsequent call to a JMS producer send fails</p>
-
-     <h2>Example step-by-step</h2>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS context but we do it inside the try-with-resources statement like so:</li>
-        <pre class="prettyprint">
-           <code>
-            try
-            (
-               JMSContext jmsContext = cf.createContext()
-            )
-           </code>
-        </pre>
-
-        <li>Inside the following try block we first create the producer</li>
-        <pre class="prettyprint">
-           <code>JMSProducer jmsProducer = jmsContext.createProducer();</code>
-        </pre>
-
-        <li>We then try to send a message. It is this call that throws an exception as the producer doesn't have the privileges
-        to send a message</li>
-        <pre class="prettyprint">
-          <code>jmsProducer.send(queue, "this message will fail security!");</code>
-       </pre>
-
-        <li>We catch the exception from the send message and can do what we want, however the JMSContext will have been closed
-        prior to entering the catch block.</li>
-        <pre class="prettyprint">
-           <code>System.out.println("expected exception from jmsProducer.send: " + e.getMessage());</code>
-        </pre>
-
-        <li>And finally, we close the Initial Context, note we no longer have to worry about clearing up the JMSContext.</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                 initialContext.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java b/examples/broker-features/standard/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java
deleted file mode 100644
index d53a373..0000000
--- a/examples/broker-features/standard/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java
+++ /dev/null
@@ -1,51 +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.JMSContext;
-import javax.jms.JMSProducer;
-import javax.jms.Queue;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * A simple JMS example that shows how AutoCloseable is used by JMS 2 resources.
- */
-public class JMSAutoCloseableExample {
-
-   public static void main(final String[] args) throws Exception {
-      // Step 2. Perfom a lookup on the queue
-      Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-      // Step 4.Create a JMS Context using the try-with-resources statement
-      try
-         (
-            // Even though ConnectionFactory is not closeable it would be nice to close an ActiveMQConnectionFactory
-            ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
-            JMSContext jmsContext = cf.createContext()
-         ) {
-         // Step 5. create a jms producer
-         JMSProducer jmsProducer = jmsContext.createProducer();
-
-         // Step 6. Try sending a message, we don't have the appropriate privileges to do this so this will throw an exception
-         jmsProducer.send(queue, "A Message from JMS2!");
-
-         System.out.println("Received:" + jmsContext.createConsumer(queue).receiveBody(String.class));
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-auto-closeable/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-auto-closeable/src/main/resources/jndi.properties b/examples/broker-features/standard/jms-auto-closeable/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/jms-auto-closeable/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/jms-bridge/jms-bridge.png
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-bridge/jms-bridge.png b/examples/broker-features/standard/jms-bridge/jms-bridge.png
deleted file mode 100644
index d671bf3..0000000
Binary files a/examples/broker-features/standard/jms-bridge/jms-bridge.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-bridge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-bridge/pom.xml b/examples/broker-features/standard/jms-bridge/pom.xml
deleted file mode 100644
index 35a5363..0000000
--- a/examples/broker-features/standard/jms-bridge/pom.xml
+++ /dev/null
@@ -1,159 +0,0 @@
-<?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>bridge</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Bridge Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-jms-server</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server0</location>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server1</location>
-                     <testURI>tcp://localhost:61617</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server1</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.JMSBridgeExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server1</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.broker</groupId>
-                  <artifactId>bridge</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-bridge/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-bridge/readme.html b/examples/broker-features/standard/jms-bridge/readme.html
deleted file mode 100644
index 1ee0ff6..0000000
--- a/examples/broker-features/standard/jms-bridge/readme.html
+++ /dev/null
@@ -1,246 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Bridge 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 Bridge 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 create a JMS Bridge between two ActiveMQ Artemis servers.</p>
-     <img src="jms-bridge.png"  />
-     <p>The example will use two ActiveMQ Artemis servers:</p>
-     <ul>
-        <li>Server #0 &ndash; the <em>Source</em> server. It will be configured with a JMS Topic bound to JNDI under <code>source/topic</code>
-        <li>Server #1 &ndash; the <em>Target</em> server. It will be configured with a JMS Queue bound to JNDI under <code>target/queue</code><br />
-     </ul>
-     <p>Both ActiveMQ Artemis server will run their own JNDI server used by the JMS Bridge and the JMS Client to lookup JMS
-        resources (ConnectionFactory and Destination).</p>
-     <p>The JMS Bridge will be started in the example code and be configured to bridge messages from the <em>source</em> destination
-     (the topic hosted on server #0) and the <em>target</em> destination (the queue hosted on server #1)</p>
-     <p>The client will check the bridge works by:</p>
-     <ol>
-        <li>sending a message to the <em>source</em> topic</li>
-        <li>receive a message from the <em>target</em> queue</li>
-        <li>check that both messages correspond to the same content.</li>
-     </ol>
-     <h3>JMS Bridge Configuration</h3>
-     <p>The JMS Bridge is a <abbr title="Plain Old Java Object">POJO</abbr> that we configure with both source and target
-        JNDI configurations. In the actual example we are programatically creating the Bridge, however the following section
-        describes how you would do this if you wanted to deploy with an actual ActiveMQ Artemis server via the activemq-beans.xml.
-
-     <h4>Configuring the Bridge with the JBoss Microcontainer</h4>
-     <p>
-        in which we inject JNDI configurations
-        so that it looks up its source and target JMS resources.
-        The JMS Bridge is defined a bean and setup by JBoss Microntainer in the same VM than Server #1, the target server.</p>
-
-      </p>The JMS Bridge sample configuration can be found in <code>resources/activemq-beans.xml</code>, firstly we define the
-     Bridge itself:</p>
-      <pre class="prettyprint">
-         &lt;!-- The JMS Bridge -->
-         &lt;bean name="JMSBridge" class="org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl">
-         ...
-         &lt;/bean>
-      </pre>
-      <p>the <code>JMSBridgeImpl</code> constructor is used to inject all the properties required to run the JMS Bridge.</p>
-      <p>Its first four arguments defines how the bridge will lookup:</p>
-      <ol>
-         <li>its <em>source</em> JMS ConnectionFactory</li>
-         <li>its <em>source</em> JMS Destination</li>
-         <li>its <em>target</em> JMS ConnectionFactory</li>
-         <li>its <em>target</em> JMS Destination</li>
-     </ol>
-     <p>Using other POJOs, the JMS Bridge is configured to retrieve:</p>
-     <ul>
-        <li>its <em>source</em> JMS ConnectionFactory by looking up <code>/source/ConnectionFactory</code> using
-           the <code>SourceJNDI</code> configuration</li>
-        <li>its <em>source</em> JMS Destination by looking up <code>/source/topic</code> using
-           the <code>SourceJNDI</code> configuration</li>
-        <li>its <em>target</em> JMS ConnectionFactory by looking up <code>/target/ConnectionFactory</code> using
-           the <code>TargetJNDI</code> configuration</li>
-           <li>its <em>target</em> JMS ConnectionFactory by looking up <code>/target/queue</code> using
-        the <code>TargetJNDI</code> configuration</li>
-     </ul>
-     <p>In turn, <code>SourceJNDI</code> and <code>TargetJNDI</code> are POJOs defining how to connect to JNDI server.
-        SourceJNDI URL must point to your source server, while LocalJNDI must point to your target server:</p>
-   <pre class="prettyprint">
-      &lt;bean name="SourceJNDI" class="java.util.Hashtable">
-         ...
-                &lt;entry>
-                   &lt;key>java.naming.provider.url&lt;/key>
-                   &lt;!-- **************************************** -->
-                   &lt;!-- Replace with the *source* server address -->
-                   &lt;!-- **************************************** -->
-                   &lt;value>jnp://192.168.0.10:1099&lt;/value>
-         ...
-       &lt;/bean>
-       &lt;bean name="TargetJNDI" class="java.util.Hashtable">
-         ...
-                &lt;ntry>
-                   &lt;key>java.naming.provider.url&lt;/key>
-                   &lt;!-- **************************************** -->
-                   &lt;!-- Replace with the *target* server address -->
-                   &lt;!-- **************************************** -->
-                   &lt;value>jnp://1192.168.0.11:1099&lt;/value>
-                &lt;/entry>
-         ...
-       &lt;/bean>
-      </pre>
-     <h2>Example step-by-step</h2>
-     <p>To run the example after having setup both ActiveMQ Artemis servers and the JMS bridge:</p>
-     <ol>
-        <li>To run the example simply run <code>mvn verify -Pexample</code></li>
-     </ol>
-      <p>Let's look at the Client code (in <code>JMSBridgeExample</code> class):</p>
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS resources</li>
-        <pre class="prettyprint">
-           InitialContext sourceContext = createContext(sourceServer);
-           InitialContext targetContext = createContext(targetServer);
-        </pre>
-        <li>We then create a JMS Bridge and start it, Note, for certain quality of service modes such as
-            ONCE_AND_ONCE_ONLY and AT_LEAST_ONCE a Transaction Manager is required to ensure Messages are delivered
-            accordingly.  A Transaction Manager can be either loaded via implementation of TransactionManagerLocator intefer
-            and loaded via standard a ServiceLoader or by explicitly setting an instance of a Transaction Manager on the
-            bridge using setTranscationManager(TransactionManager tm) method.  In this example we'll be using the DUPLICATES_OK
-            quality of service so there is no need for a Transaction Manager.
-        <pre class="prettyprint">
-            JMSBridge jmsBridge = new JMSBridgeImpl(
-               new JNDIConnectionFactoryFactory(sourceJndiParams, "source/ConnectionFactory"),
-               new JNDIConnectionFactoryFactory(targetJndiParams, "target/ConnectionFactory"),
-               new JNDIDestinationFactory(sourceJndiParams, "source/topic"),
-               new JNDIDestinationFactory(targetJndiParams, "target/queue"),
-               null,
-               null,
-               null,
-               null,
-               null,
-               5000,
-               10,
-               QualityOfServiceMode.DUPLICATES_OK,
-               1,
-               -1,
-               null,
-               null,
-               true);
-            ....
-        jmsBridge.start();
-        </pre>
-        <li>We look up the JMS resources from the Source server</li>
-        <pre class="prettyprint">
-           ConnectionFactory sourceConnectionFactory = (ConnectionFactory)sourceContext.lookup("source/ConnectionFactory");
-           Topic sourceTopic = (Topic)sourceContext.lookup("source/topic");
-        </pre>
-
-        <li>We create JMS objects to send a message to the source destination</li>
-        <pre class="prettyprint">
-           sourceConnection = sourceConnectionFactory.createConnection();
-           Session sourceSession = sourceConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           MessageProducer sourceProducer = sourceSession.createProducer(sourceTopic);
-        </pre>
-
-        <li>We send a message to the source destination</li>
-        <pre class="prettyprint">
-           TextMessage message = sourceSession.createTextMessage("this is a text message sent at " + System.currentTimeMillis());
-           sourceProducer.send(message);
-        </pre>
-
-        <li>We close the connection to the source server</li>
-        <pre class="prettyprint">
-           sourceConnection.close();
-        </pre>
-
-        <p>At this point, the JMS Bridge will consume the message from the source topic and
-           sends it to the target queue.
-           The client will check the bridge works by consuming a message from the target queue.</p>
-
-        <li>We look up the JMS resources from the target server</li>
-        <pre class="prettyprint">
-           ConnectionFactory targetConnectionFactory = (ConnectionFactory)targetContext.lookup("target/ConnectionFactory");
-           Queue targetQueue = (Queue)targetContext.lookup("target/queue");
-        </pre>
-
-        <li>We create JMS objects to receive a message from the target destination</li>
-        <pre class="prettyprint">
-           targetConnection = targetConnectionFactory.createConnection();
-           Session targetSession = targetConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           MessageConsumer targetConsumer = targetSession.createConsumer(targetQueue);
-       </pre>
-
-        <li>We start the target connection to start receiving messages
-        <pre class="prettyprint">
-           targetConnection.start();
-        </pre>
-
-        <li>We receive the message and print it. Its content is the same than the message
-           the client sent to the source topic</li>
-        <pre class="prettyprint">
-           TextMessage messageReceived = (TextMessage)targetConsumer.receive(5000);
-        </pre>
-
-        <li>We display the message ID and its "bridged" message ID</li>
-        <pre class="prettyprint">
-           System.out.format("Message ID         : %s\n", messageReceived.getJMSMessageID());
-           System.out.format("Bridged Message ID : %s\n", messageReceived.getStringProperty("AMQ_BRIDGE_MSG_ID_LIST"));
-        </pre>
-
-        <p>Note that the message received from the target queue is <em>not the same message</em> sent to the source topic
-           (their message IDs are different) but they have the <em>same content</em>.
-
-        <li>And finally, we stop the Bridge and <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 (jmsBridge != null)
-              {
-                jmsBridge.stop();
-              }
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
-
-     <h2>More information</h2>
-
-     <ul>
-        <li>User Manual's <a href="../../../docs/user-manual/en/html_single/appserver-integration.html#jms-bridge">JMS Bridge chapter</a></li>
-        <li>The <a href="../../javaee/jms-bridge/readme.html">Java EE JMS Bridge example</a> shows how to configure a JMS Bridge
-           inside JBoss Application Server to bridge destinations from the same server.</a>
-     </p>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java b/examples/broker-features/standard/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java
deleted file mode 100644
index 8a65cd5..0000000
--- a/examples/broker-features/standard/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java
+++ /dev/null
@@ -1,136 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.naming.InitialContext;
-import java.util.Hashtable;
-
-import org.apache.activemq.artemis.jms.bridge.JMSBridge;
-import org.apache.activemq.artemis.jms.bridge.QualityOfServiceMode;
-import org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl;
-import org.apache.activemq.artemis.jms.bridge.impl.JNDIConnectionFactoryFactory;
-import org.apache.activemq.artemis.jms.bridge.impl.JNDIDestinationFactory;
-
-/**
- * An example which sends a message to a source topic and consume from a target queue.
- * The source and target destinations are located on 2 different ActiveMQ Artemis server.
- * The source and target queues are bridged by a JMS Bridge configured and running on the "target" server.
- */
-public class JMSBridgeExample {
-
-   public static void main(final String[] args) throws Exception {
-      String sourceServer = "tcp://localhost:61616";
-      String targetServer = "tcp://localhost:61617";
-
-      System.out.println("client will publish messages to " + sourceServer +
-                            " and receives message from " +
-                            targetServer);
-
-      // Step 1. Create JNDI contexts for source and target servers
-      InitialContext sourceContext = JMSBridgeExample.createContext(sourceServer);
-      InitialContext targetContext = JMSBridgeExample.createContext(targetServer);
-
-      Hashtable<String, String> sourceJndiParams = createJndiParams(sourceServer);
-      Hashtable<String, String> targetJndiParams = createJndiParams(targetServer);
-      // Step 2. Create and start a JMS Bridge
-      // Note, the Bridge needs a transaction manager, in this instance we will use the JBoss TM
-      JMSBridge jmsBridge = new JMSBridgeImpl(new JNDIConnectionFactoryFactory(sourceJndiParams, "ConnectionFactory"), new JNDIConnectionFactoryFactory(targetJndiParams, "ConnectionFactory"), new JNDIDestinationFactory(sourceJndiParams, "source/topic"), new JNDIDestinationFactory(targetJndiParams, "target/queue"), null, null, null, null, null, 5000, 10, QualityOfServiceMode.DUPLICATES_OK, 1, -1, null, null, true);
-
-      Connection sourceConnection = null;
-      Connection targetConnection = null;
-      try {
-         jmsBridge.start();
-         // Step 3. Lookup the *source* JMS resources
-         ConnectionFactory sourceConnectionFactory = (ConnectionFactory) sourceContext.lookup("ConnectionFactory");
-         Topic sourceTopic = (Topic) sourceContext.lookup("source/topic");
-
-         // Step 4. Create a connection, a session and a message producer for the *source* topic
-         sourceConnection = sourceConnectionFactory.createConnection();
-         Session sourceSession = sourceConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageProducer sourceProducer = sourceSession.createProducer(sourceTopic);
-
-         // Step 5. Create and send a text message to the *source* queue
-         TextMessage message = sourceSession.createTextMessage("this is a text message sent at " + System.currentTimeMillis());
-         sourceProducer.send(message);
-         System.out.format("Sent message to %s: %s%n", ((Topic) message.getJMSDestination()).getTopicName(), message.getText());
-         System.out.format("Message ID : %s%n", message.getJMSMessageID());
-
-         // Step 6. Close the *source* connection
-         sourceConnection.close();
-
-         // Step 7. Lookup the *target* JMS resources
-         ConnectionFactory targetConnectionFactory = (ConnectionFactory) targetContext.lookup("ConnectionFactory");
-         Queue targetQueue = (Queue) targetContext.lookup("target/queue");
-
-         // Step 8. Create a connection, a session and a message consumer for the *target* queue
-         targetConnection = targetConnectionFactory.createConnection();
-         Session targetSession = targetConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageConsumer targetConsumer = targetSession.createConsumer(targetQueue);
-
-         // Step 9. Start the connection to receive messages from the *target* queue
-         targetConnection.start();
-
-         // Step 10. Receive a message from the *target* queue
-         TextMessage messageReceived = (TextMessage) targetConsumer.receive(5000);
-         System.out.format("%nReceived from %s: %s%n", ((Queue) messageReceived.getJMSDestination()).getQueueName(), messageReceived.getText());
-
-         // Step 11. Display the received message's ID and this "bridged" message ID
-         System.out.format("Message ID         : %s%n", messageReceived.getJMSMessageID());
-         System.out.format("Bridged Message ID : %s%n", messageReceived.getStringProperty("AMQ_BRIDGE_MSG_ID_LIST"));
-      }
-      finally {
-         // Step 12. Be sure to close the resources!
-         if (jmsBridge != null) {
-            jmsBridge.stop();
-         }
-         if (sourceContext != null) {
-            sourceContext.close();
-         }
-         if (targetContext != null) {
-            targetContext.close();
-         }
-         if (sourceConnection != null) {
-            sourceConnection.close();
-         }
-         if (targetConnection != null) {
-            targetConnection.close();
-         }
-      }
-   }
-
-   private static InitialContext createContext(final String server) throws Exception {
-      Hashtable<String, String> jndiProps = createJndiParams(server);
-      return new InitialContext(jndiProps);
-   }
-
-   private static Hashtable<String, String> createJndiParams(String server) {
-      Hashtable<String, String> jndiProps = new Hashtable<String, String>();
-      jndiProps.put("connectionFactory.ConnectionFactory", server);
-      jndiProps.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-      jndiProps.put("queue.target/queue", "target");
-      jndiProps.put("topic.source/topic", "topic");
-      return jndiProps;
-   }
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-bridge/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-bridge/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/jms-bridge/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index df456d7..0000000
--- a/examples/broker-features/standard/jms-bridge/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?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">
-      <topic name="topic"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-
-      <acceptors>
-         <acceptor name="netty">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <security-settings>
-         <security-setting match="jms.#">
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-         </security-setting>
-      </security-settings>
-   </core>
-</configuration>
-

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-bridge/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-bridge/src/main/resources/activemq/server1/artemis-roles.properties b/examples/broker-features/standard/jms-bridge/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/broker-features/standard/jms-bridge/src/main/resources/activemq/server1/artemis-roles.properties
+++ /dev/null
@@ -1,17 +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.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-bridge/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-bridge/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/standard/jms-bridge/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index e65720c..0000000
--- a/examples/broker-features/standard/jms-bridge/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?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">
-      <queue name="target"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-
-      <acceptors>
-         <acceptor name="netty">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <security-settings>
-         <security-setting match="jms.#">
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-         </security-setting>
-      </security-settings>
-   </core>
-</configuration>
-

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-completion-listener/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-completion-listener/pom.xml b/examples/broker-features/standard/jms-completion-listener/pom.xml
deleted file mode 100644
index 139432f..0000000
--- a/examples/broker-features/standard/jms-completion-listener/pom.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?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>completion-listener</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Completion Listener 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>${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.JMSCompletionListenerExample</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>completion-listener</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-completion-listener/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-completion-listener/readme.html b/examples/broker-features/standard/jms-completion-listener/readme.html
deleted file mode 100644
index 36be17a..0000000
--- a/examples/broker-features/standard/jms-completion-listener/readme.html
+++ /dev/null
@@ -1,112 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Completion Listener 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 Completion Listener 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 a message asynchronously to ActiveMQ Artemis and use a CompletionListener to be notified of
-     the Broker receiving it</p>
-
-     <h2>Example step-by-step</h2>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS context</li>
-        <pre class="prettyprint">
-           <code>jmsContext = cf.createContext();</code>
-        </pre>
-
-        <li>We create a JMS Producer.</li>
-        <pre class="prettyprint">
-           <code>JMSProducer producer = jmsContext.createProducer();</code>
-        </pre>
-
-        <li>We set a CompletionListener on the Producer</li>
-        <pre class="prettyprint">
-          <code>producer.setAsync(new CompletionListener()
-                {
-                   @Override
-                   public void onCompletion(Message message)
-                   {
-                      System.out.println("message acknowledged by ActiveMQ");
-                      latch.countDown();
-                   }
-
-                   @Override
-                   public void onException(Message message, Exception e)
-                   {
-                      e.printStackTrace();
-                   }
-                });</code>
-       </pre>
-
-        <li>We send a message</li>
-        <pre class="prettyprint">
-           <code>producer.send(queue, "this is a string");</code>
-        </pre>
-
-         <li> and then wait for the Completion Listener to be called</li>
-        <pre class="prettyprint">
-           <code>return latch.await(5, TimeUnit.SECONDS);</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 (jmsContext != null)
-              {
-                 jmsContext.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java b/examples/broker-features/standard/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java
deleted file mode 100644
index 4688ba3..0000000
--- a/examples/broker-features/standard/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java
+++ /dev/null
@@ -1,82 +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.CompletionListener;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSContext;
-import javax.jms.JMSProducer;
-import javax.jms.Message;
-import javax.jms.Queue;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * A JMS Completion Listener Example.
- */
-public class JMSCompletionListenerExample {
-
-   public static void main(final String[] args) throws Exception {
-      JMSContext jmsContext = null;
-      try {
-         // Step 2. Perfom a lookup on the queue
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         // Step 3. Perform a lookup on the Connection Factory
-         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?confirmationWindowSize=10240");
-
-         // Step 4.Create a JMS Context
-         jmsContext = cf.createContext();
-
-         // Step 5. Create a message producer.
-         JMSProducer producer = jmsContext.createProducer();
-
-         final CountDownLatch latch = new CountDownLatch(1);
-
-         //Step 6. We want to send the message Asynchronously and be notified when the Broker receives it so we set a completion handler
-         producer.setAsync(new CompletionListener() {
-            @Override
-            public void onCompletion(Message message) {
-               System.out.println("message acknowledged by ActiveMQ");
-               latch.countDown();
-            }
-
-            @Override
-            public void onException(Message message, Exception e) {
-               e.printStackTrace();
-            }
-         });
-
-         //Step 6. Send the Message
-         producer.send(queue, "this is a string");
-
-         //Step 7. wait for the Completion handler
-         if (!latch.await(5, TimeUnit.SECONDS)) {
-            throw new IllegalStateException("Completion listener not called as expected.");
-         }
-      }
-      finally {
-         if (jmsContext != null) {
-            jmsContext.close();
-         }
-      }
-   }
-}

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


[05/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/push/src/main/java/PushReg.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/src/main/java/PushReg.java b/examples/features/standard/rest/push/src/main/java/PushReg.java
new file mode 100644
index 0000000..2567826
--- /dev/null
+++ b/examples/features/standard/rest/push/src/main/java/PushReg.java
@@ -0,0 +1,52 @@
+/*
+ * 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.apache.activemq.artemis.rest.queue.push.xml.Authentication;
+import org.apache.activemq.artemis.rest.queue.push.xml.BasicAuth;
+import org.apache.activemq.artemis.rest.queue.push.xml.PushRegistration;
+import org.apache.activemq.artemis.rest.queue.push.xml.XmlLink;
+import org.jboss.resteasy.client.ClientRequest;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.spi.Link;
+
+public class PushReg {
+
+   public static void main(String[] args) throws Exception {
+      // get the push consumers factory resource
+      ClientRequest request = new ClientRequest("http://localhost:9095/queues/jms.queue.orders");
+      ClientResponse res = request.head();
+      Link pushConsumers = res.getHeaderAsLink("msg-push-consumers");
+
+      // next create the XML document that represents the registration
+      // Really, just create a link with the shipping URL and the type you want posted
+      PushRegistration reg = new PushRegistration();
+      BasicAuth authType = new BasicAuth();
+      authType.setUsername("guest");
+      authType.setPassword("guest");
+      Authentication auth = new Authentication();
+      auth.setType(authType);
+      reg.setAuthenticationMechanism(auth);
+      XmlLink target = new XmlLink();
+      target.setHref("http://localhost:9095/queues/jms.queue.shipping");
+      target.setType("application/xml");
+      target.setRelationship("destination");
+      reg.setTarget(target);
+
+      res = pushConsumers.request().body("application/xml", reg).post();
+      System.out.println("Create push registration.  Resource URL: " + res.getLocationLink().getHref());
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/push/src/main/java/ReceiveShipping.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/src/main/java/ReceiveShipping.java b/examples/features/standard/rest/push/src/main/java/ReceiveShipping.java
new file mode 100644
index 0000000..80a3892
--- /dev/null
+++ b/examples/features/standard/rest/push/src/main/java/ReceiveShipping.java
@@ -0,0 +1,54 @@
+/*
+ * 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.apache.activemq.artemis.jms.client.ActiveMQDestination;
+import org.apache.activemq.artemis.rest.Jms;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.Session;
+
+public class ReceiveShipping {
+
+   public static void main(String[] args) throws Exception {
+      ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml");
+      Destination destination = (ActiveMQDestination) ActiveMQDestination.fromAddress("jms.queue.shipping");
+
+      Connection conn = factory.createConnection();
+      try {
+         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer consumer = session.createConsumer(destination);
+         consumer.setMessageListener(new MessageListener() {
+               @Override
+               public void onMessage(Message message) {
+                  System.out.println("Received Message: ");
+                  Order order = Jms.getEntity(message, Order.class);
+                  System.out.println(order);
+               }
+            });
+         conn.start();
+         Thread.sleep(1000000);
+      }
+      finally {
+         conn.close();
+      }
+   }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/push/src/main/resources/activemq-client.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/src/main/resources/activemq-client.xml b/examples/features/standard/rest/push/src/main/resources/activemq-client.xml
new file mode 100644
index 0000000..6fe4547
--- /dev/null
+++ b/examples/features/standard/rest/push/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/6b17d966/examples/features/standard/rest/push/src/main/resources/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/src/main/resources/artemis-roles.properties b/examples/features/standard/rest/push/src/main/resources/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/rest/push/src/main/resources/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/push/src/main/resources/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/src/main/resources/artemis-users.properties b/examples/features/standard/rest/push/src/main/resources/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/rest/push/src/main/resources/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/6b17d966/examples/features/standard/rest/push/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/src/main/resources/broker.xml b/examples/features/standard/rest/push/src/main/resources/broker.xml
new file mode 100644
index 0000000..13f2f23
--- /dev/null
+++ b/examples/features/standard/rest/push/src/main/resources/broker.xml
@@ -0,0 +1,60 @@
+<?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 queues used by the example-->
+      <queue name="orders"/>
+      <queue name="shipping"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <persistence-enabled>false</persistence-enabled>
+      <!-- Connectors -->
+
+      <connectors>
+         <connector name="in-vm">vm://0</connector>
+      </connectors>
+
+      <acceptors>
+         <acceptor name="in-vm">vm://0</acceptor>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="#">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/push/src/main/resources/test-realm.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/src/main/resources/test-realm.properties b/examples/features/standard/rest/push/src/main/resources/test-realm.properties
new file mode 100644
index 0000000..65f2dd9
--- /dev/null
+++ b/examples/features/standard/rest/push/src/main/resources/test-realm.properties
@@ -0,0 +1,18 @@
+# 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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/push/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/src/main/webapp/WEB-INF/web.xml b/examples/features/standard/rest/push/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..d4ba92b
--- /dev/null
+++ b/examples/features/standard/rest/push/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,70 @@
+<?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.
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+        "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+    <filter>
+        <filter-name>Rest-Messaging</filter-name>
+        <filter-class>
+            org.jboss.resteasy.plugins.server.servlet.FilterDispatcher
+        </filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>Rest-Messaging</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <listener>
+        <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>org.apache.activemq.rest.integration.ActiveMQBootstrapListener</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>org.apache.activemq.rest.integration.RestMessagingBootstrapListener</listener-class>
+    </listener>
+
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>Resteasy</web-resource-name>
+            <url-pattern>/queues/jms.queue.shipping/*</url-pattern>
+        </web-resource-collection>
+        <auth-constraint>
+            <role-name>admin</role-name>
+        </auth-constraint>
+    </security-constraint>
+
+    <login-config>
+        <auth-method>BASIC</auth-method>
+        <realm-name>Test</realm-name>
+    </login-config>
+
+    <security-role>
+        <role-name>admin</role-name>
+    </security-role>
+
+</web-app>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/scheduled-message/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/scheduled-message/pom.xml b/examples/features/standard/scheduled-message/pom.xml
new file mode 100644
index 0000000..7447f33
--- /dev/null
+++ b/examples/features/standard/scheduled-message/pom.xml
@@ -0,0 +1,114 @@
+<?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>scheduled-message</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Scheduled Message Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <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-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>
+                     <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.ScheduledMessageExample</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>scheduled-message</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/scheduled-message/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/scheduled-message/readme.html b/examples/features/standard/scheduled-message/readme.html
new file mode 100644
index 0000000..9144f94
--- /dev/null
+++ b/examples/features/standard/scheduled-message/readme.html
@@ -0,0 +1,134 @@
+<!--
+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 Scheduled Message 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 Scheduled Message 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 a scheduled message to a JMS Queue using ActiveMQ Artemis.</p>
+     <p>A Scheduled Message is a message that will be delivered at a time specified by the sender. To do this,
+     simply set a HDR_SCHEDULED_DELIVERY_TIME header property. The value of the property should be the time of
+     delivery in milliseconds. </p>
+
+     <p>In this example, a message is created with the scheduled delivery time set to 5 seconds after the current time.</p>
+
+
+     <h2>Example step-by-step</h2>
+     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
+
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
+        <pre class="prettyprint">
+           <code>InitialContext initialContext = getContext();</code>
+        </pre>
+
+        <li>We look-up the JMS queue object from JNDI</li>
+        <pre class="prettyprint">
+           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>We look-up the JMS connection factory object from JNDI</li>
+        <pre class="prettyprint">
+           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>We create a JMS connection</li>
+        <pre class="prettyprint">
+           <code>connection = cf.createConnection();</code>
+        </pre>
+
+        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
+        <pre class="prettyprint">
+           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
+        </pre>
+
+        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
+        <pre class="prettyprint">
+          <code>MessageProducer producer = session.createProducer(queue);</code>
+       </pre>
+
+        <li>We create a JMS text message that we are going to send.</li>
+        <pre class="prettyprint">
+           <code>TextMessage message = session.createTextMessage("This is a scheduled message message which will be delivered in 5 sec.");</code>
+        </pre>
+
+        <li>We schedule the delivery time to be 5 sec later.</li>
+        <pre class="prettyprint">
+           <code>
+            long time = System.currentTimeMillis();
+            time += 5000;
+            message.setLongProperty(MessageImpl.HDR_SCHEDULED_DELIVERY_TIME.toString(), time);
+           </code>
+        </pre>
+
+        <li>We send message to the queue</li>
+        <pre class="prettyprint">
+           <code>messageProducer.send(message);</code>
+        </pre>
+
+        <li>We create a JMS Message Consumer to receive the message.</li>
+          <pre class="prettyprint">
+           <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
+        </pre>
+
+        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
+        <pre class="prettyprint">
+           <code>connection.start();</code>
+        </pre>
+
+        <li>We use a blocking receive() to consume the message and see when the message arrives.</li>
+        <pre class="prettyprint">
+           <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive();</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>
+
+     <h2>More information</h2>
+
+     <ul>
+         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#scheduled-messages">Scheduled Messages chapter</a></li>
+     </ul>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/scheduled-message/src/main/java/org/apache/activemq/artemis/jms/example/ScheduledMessageExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/scheduled-message/src/main/java/org/apache/activemq/artemis/jms/example/ScheduledMessageExample.java b/examples/features/standard/scheduled-message/src/main/java/org/apache/activemq/artemis/jms/example/ScheduledMessageExample.java
new file mode 100644
index 0000000..ba86949
--- /dev/null
+++ b/examples/features/standard/scheduled-message/src/main/java/org/apache/activemq/artemis/jms/example/ScheduledMessageExample.java
@@ -0,0 +1,94 @@
+/*
+ * 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.text.SimpleDateFormat;
+import java.util.Date;
+
+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;
+
+import org.apache.activemq.artemis.api.core.Message;
+
+public class ScheduledMessageExample {
+
+   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 scheduled message message which will be delivered in 5 sec.");
+
+         // Step 8. Set the delivery time to be 5 sec later.
+         long time = System.currentTimeMillis();
+         time += 5000;
+         message.setLongProperty(Message.HDR_SCHEDULED_DELIVERY_TIME.toString(), time);
+
+         // Step 9. Send the Message
+         producer.send(message);
+
+         System.out.println("Sent message: " + message.getText());
+         SimpleDateFormat formatter = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss");
+         System.out.println("Time of send: " + formatter.format(new Date()));
+
+         // Step 10. Create a JMS Message Consumer
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         // Step 11. Start the Connection
+         connection.start();
+
+         // Step 12. Receive the message
+         TextMessage messageReceived = (TextMessage) messageConsumer.receive();
+
+         System.out.println("Received message: " + messageReceived.getText());
+         System.out.println("Time of receive: " + formatter.format(new Date()));
+      }
+      finally {
+         // Step 13. 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/6b17d966/examples/features/standard/scheduled-message/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/scheduled-message/src/main/resources/jndi.properties b/examples/features/standard/scheduled-message/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/scheduled-message/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/6b17d966/examples/features/standard/security/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/security/pom.xml b/examples/features/standard/security/pom.xml
new file mode 100644
index 0000000..13976db
--- /dev/null
+++ b/examples/features/standard/security/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>security</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Security 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>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <testUser>bill</testUser>
+                     <testPassword>activemq</testPassword>
+                     <args>
+                        <param>run</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.SecurityExample</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>security</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/security/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/security/readme.html b/examples/features/standard/security/readme.html
new file mode 100644
index 0000000..d25dd42
--- /dev/null
+++ b/examples/features/standard/security/readme.html
@@ -0,0 +1,326 @@
+<!--
+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 Security 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 Security 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 how to configure and use security using ActiveMQ Artemis.</p>
+
+     <p>With security properly configured, ActiveMQ Artemis can restrict client access to its resources, including
+     connection creation, message sending/receiving, etc. This is done by configuring users and roles as well as permissions in
+     the configuration files. </p>
+
+     <p>ActiveMQ Artemis supports wild-card security configuration. This feature makes security configuration very
+     flexible and enables fine-grained control over permissions in an efficient way.</p>
+
+     <p>For a full description of how to configure security with ActiveMQ Artemis, please consult the user
+     manual.</p>
+
+     <p>This example demonstrates how to configure users/roles, how to configure topics with proper permissions using wild-card
+     expressions, and how they take effects in a simple program. </p>
+
+     <p>First we need to configure users with roles. Users and Roles are configured in <code>activemq-users.xml</code>. This example has four users
+     configured as below </p>
+
+     <pre class="prettyprint">
+     <code>
+		   &lt;user name=&quot;bill&quot; password=&quot;activemq&quot;&gt;
+		      &lt;role name=&quot;user&quot;/&gt;
+		   &lt;/user&gt;
+
+		   &lt;user name=&quot;andrew&quot; password=&quot;activemq1&quot;&gt;
+		      &lt;role name=&quot;europe-user&quot;/&gt;
+		      &lt;role name=&quot;user&quot;/&gt;
+		   &lt;/user&gt;
+
+		   &lt;user name=&quot;frank&quot; password=&quot;activemq2&quot;&gt;
+		      &lt;role name=&quot;us-user&quot;/&gt;
+		      &lt;role name=&quot;news-user&quot;/&gt;
+		      &lt;role name=&quot;user&quot;/&gt;
+		   &lt;/user&gt;
+
+		   &lt;user name=&quot;sam&quot; password=&quot;activemq3&quot;&gt;
+		      &lt;role name=&quot;news-user&quot;/&gt;
+		      &lt;role name=&quot;user&quot;/&gt;
+		   &lt;/user&gt;
+     </code>
+     </pre>
+
+     <p>
+     Each user has three properties available: user name, password, and roles it belongs to. It should be noted that
+     a user can belong to more than one role. In the above configuration, all users belong to role 'user'. User 'andrew' also
+     belongs to role 'europe-user', user 'frank' also belongs to 'us-user' and 'news-user' and user 'sam' also belongs to 'news-user'.
+     </p>
+     <p>
+     User name and password consists of a valid account that can be used to establish connections to a ActiveMQ Artemis server, while
+     roles are used in controlling the access privileges against ActiveMQ Artemis topics and queues. You can achieve this control by
+     configuring proper permissions in <code>broker.xml</code>, like the following
+     </p>
+     <pre class="prettyprint"><code>
+      &lt;security-settings&gt;
+         &lt;!-- any user can have full control of generic topics --&gt;
+		   &lt;security-setting match=&quot;jms.topic.#&quot;&gt;
+		      &lt;permission type=&quot;createDurableQueue&quot; roles=&quot;user&quot;/&gt;
+		      &lt;permission type=&quot;deleteDurableQueue&quot; roles=&quot;user&quot;/&gt;
+		      &lt;permission type=&quot;createNonDurableQueue&quot; roles=&quot;user&quot;/&gt;
+		      &lt;permission type=&quot;deleteNonDurableQueue&quot; roles=&quot;user&quot;/&gt;
+		      &lt;permission type=&quot;send&quot; roles=&quot;user&quot;/&gt;
+		      &lt;permission type=&quot;consume&quot; roles=&quot;user&quot;/&gt;
+		   &lt;/security-setting&gt;
+
+		   &lt;security-setting match=&quot;jms.topic.news.europe.#&quot;&gt;
+		      &lt;permission type=&quot;createDurableQueue&quot; roles=&quot;user&quot;/&gt;
+		      &lt;permission type=&quot;deleteDurableQueue&quot; roles=&quot;user&quot;/&gt;
+		      &lt;permission type=&quot;createNonDurableQueue&quot; roles=&quot;user&quot;/&gt;
+		      &lt;permission type=&quot;deleteNonDurableQueue&quot; roles=&quot;user&quot;/&gt;
+		      &lt;permission type=&quot;send&quot; roles=&quot;europe-user&quot;/&gt;
+		      &lt;permission type=&quot;consume&quot; roles=&quot;news-user&quot;/&gt;
+		   &lt;/security-setting&gt;
+
+		   &lt;security-setting match=&quot;jms.topic.news.us.#&quot;&gt;
+		      &lt;permission type=&quot;createDurableQueue&quot; roles=&quot;user&quot;/&gt;
+		      &lt;permission type=&quot;deleteDurableQueue&quot; roles=&quot;user&quot;/&gt;
+		      &lt;permission type=&quot;createNonDurableQueue&quot; roles=&quot;user&quot;/&gt;
+		      &lt;permission type=&quot;deleteNonDurableQueue&quot; roles=&quot;user&quot;/&gt;
+		      &lt;permission type=&quot;send&quot; roles=&quot;us-user&quot;/&gt;
+		      &lt;permission type=&quot;consume&quot; roles=&quot;news-user&quot;/&gt;
+		   &lt;/security-setting&gt;
+     &lt;/security-settings&gt;
+     </code></pre>
+
+     <p>Permissions can be defined on any group of queues, by using a wildcard. You can easily specify
+     wildcards to apply certain permissions to a set of matching queues and topics. In the above configuration
+     we have created four sets of permissions, each set matches against a special group of targets, indicated by wild-card match attributes.</p>
+
+     <p>You can provide a very broad permission control as a default and then add more strict control
+     over specific addresses. By the above we define the following access rules:</p>
+
+         <li>Only role 'us-user' can create/delete and pulish messages to topics whose names match wild-card pattern 'news.us.#'.</li>
+         <li>Only role 'europe-user' can create/delete and publish messages to topics whose names match wild-card pattern 'news.europe.#'.</li>
+         <li>Only role 'news-user' can subscribe messages to topics whose names match wild-card pattern 'news.us.#' and 'news.europe.#'.</li>
+         <li>For any other topics that don't match any of the above wild-card patterns, permissions are granted to users of role 'user'.</li>
+
+     <p>To illustrate the effect of permissions, three topics are deployed. Topic 'genericTopic' matches 'jms.topic.#' wild-card, topic 'news.europe.europeTopic' matches
+     jms.topic.news.europe.#' wild-cards, and topic 'news.us.usTopic' matches 'jms.topic.news.us.#'.</p>
+
+     <p>With ActiveMQ Artemis, the security manager is also configurable. You can use JAASSecurityManager or JBossASSecurityManager based on you need. Please
+     check out the activemq-beans.xml for how to do. In this example we just use the basic ActiveMQSecurityManagerImpl which reads users/roles/passwords from the xml
+     file <code>activemq-users.xml</code>.
+
+
+     <h2>Example step-by-step</h2>
+     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
+
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
+        <pre class="prettyprint">
+           <code>
+           InitialContext initialContext = getContext(0);
+           </code>
+        </pre>
+
+        <li>We perform lookup on the topics</li>
+        <pre class="prettyprint">
+           <code>
+           Topic genericTopic = (Topic) initialContext.lookup("/topic/genericTopic");
+           Topic europeTopic = (Topic) initialContext.lookup("/topic/europeTopic");
+           Topic usTopic = (Topic) initialContext.lookup("/topic/usTopic");
+           </code>
+        </pre>
+
+        <li>We perform a lookup on the Connection Factory</li>
+        <pre class="prettyprint">
+           <code>
+           ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");
+           </code>
+        </pre>
+
+        <li>We try to create a JMS Connection without user/password. It will fail.</li>
+        <pre class="prettyprint">
+           <code>
+           try
+           {
+              cf.createConnection();
+              result = false;
+           }
+           catch (JMSSecurityException e)
+           {
+              System.out.println("Default user cannot get a connection. Details: " + e.getMessage());
+           }
+           </code>
+        </pre>
+
+        <li>Bill tries to make a connection using wrong password</li>
+        <pre class="prettyprint">
+           <code>
+           billConnection = null;
+           try
+           {
+              billConnection = createConnection("bill", "activemq1", cf);
+              result = false;
+           }
+           catch (JMSException e)
+           {
+              System.out.println("User bill failed to connect. Details: " + e.getMessage());
+           }
+           </code>
+        </pre>
+
+        <li>Bill makes a good connection.</li>
+        <pre class="prettyprint">
+          <code>
+           billConnection = createConnection("bill", "activemq", cf);
+           billConnection.start();
+          </code>
+       </pre>
+
+        <li>Andrew makes a good connection</li>
+         <pre class="prettyprint">
+           <code>
+           andrewConnection = createConnection("andrew", "activemq1", cf);
+           andrewConnection.start();
+           </code>
+         </pre>
+
+        <li>Frank makes a good connection</li>
+        <pre class="prettyprint">
+           <code>
+           frankConnection = createConnection("frank", "activemq2", cf);
+           frankConnection.start();
+           </code>
+        </pre>
+
+        <li>Sam makes a good connection</li>
+        <pre class="prettyprint">
+           <code>
+           samConnection = createConnection("sam", "activemq3", cf);
+           samConnection.start();
+           </code>
+        </pre>
+
+        <li>We check every user can publish/subscribe genericTopics</li>
+        <pre class="prettyprint">
+           <code>
+           checkUserSendAndReceive(genericTopic, billConnection, "bill");
+           checkUserSendAndReceive(genericTopic, andrewConnection, "andrew");
+           checkUserSendAndReceive(genericTopic, frankConnection, "frank");
+           checkUserSendAndReceive(genericTopic, samConnection, "sam");
+           </code>
+        </pre>
+
+        <li>We check permissions on news.europe.europeTopic for bill: can't send and can't receive</li>
+        <pre class="prettyprint">
+           <code>
+           checkUserNoSendNoReceive(europeTopic, billConnection, "bill", andrewConnection, frankConnection);
+           </code>
+        </pre>
+
+        <li>We check permissions on news.europe.europeTopic for andrew: can send but can't receive</li>
+        <pre class="prettyprint">
+           <code>
+           checkUserSendNoReceive(europeTopic, andrewConnection, "andrew", frankConnection);
+           </code>
+        </pre>
+
+        <li>We check permissions on news.europe.europeTopic for frank: can't send but can receive</li>
+        <pre class="prettyprint">
+           <code>
+           checkUserReceiveNoSend(europeTopic, frankConnection, "frank", andrewConnection);
+           </code>
+        </pre>
+
+        <li>We check permissions on news.europe.europeTopic for sam: can't send but can receive</li>
+        <pre class="prettyprint">
+           <code>
+           checkUserReceiveNoSend(europeTopic, samConnection, "sam", andrewConnection);
+           </code>
+        </pre>
+
+        <li>We check permissions on news.us.usTopic for bill: can't send and can't receive</li>
+        <pre class="prettyprint">
+           <code>
+           checkUserNoSendNoReceive(usTopic, billConnection, "bill");
+           </code>
+        </pre>
+
+        <li>We check permissions on news.us.usTopic for andrew: can't send and can't receive</li>
+        <pre class="prettyprint">
+           <code>
+           checkUserNoSendNoReceive(usTopic, andrewConnection, "andrew");
+           </code>
+        </pre>
+
+        <li>We check permissions on news.us.usTopic for frank: can both send and receive</li>
+        <pre class="prettyprint">
+           <code>
+           checkUserSendAndReceive(usTopic, frankConnection, "frank");
+           </code>
+        </pre>
+
+        <li>We check permissions on news.us.usTopic for sam: can't send but can receive</li>
+        <pre class="prettyprint">
+           <code>
+           checkUserReceiveNoSend(usTopic, samConnection, "sam", frankConnection);
+           </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 (billConnection != null)
+              {
+                 billConnection.close();
+              }
+              if (andrewConnection != null)
+              {
+                 andrewConnection.close();
+              }
+              if (frankConnection != null)
+              {
+                 frankConnection.close();
+              }
+              if (samConnection != null)
+              {
+                 samConnection.close();
+              }
+
+              // Also the initialContext
+              if (initialContext != null)
+              {
+                 initialContext.close();
+              }
+           }
+           </code>
+        </pre>
+     </ol>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/security/src/main/java/org/apache/activemq/artemis/jms/example/SecurityExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/security/src/main/java/org/apache/activemq/artemis/jms/example/SecurityExample.java b/examples/features/standard/security/src/main/java/org/apache/activemq/artemis/jms/example/SecurityExample.java
new file mode 100644
index 0000000..88fd1da
--- /dev/null
+++ b/examples/features/standard/security/src/main/java/org/apache/activemq/artemis/jms/example/SecurityExample.java
@@ -0,0 +1,282 @@
+/*
+ * 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.JMSSecurityException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.naming.InitialContext;
+
+public class SecurityExample {
+
+   public static void main(final String[] args) throws Exception {
+      boolean result = true;
+      Connection failConnection = null;
+      Connection billConnection = null;
+      Connection andrewConnection = null;
+      Connection frankConnection = null;
+      Connection samConnection = null;
+
+      InitialContext initialContext = null;
+      try {
+         // /Step 1. Create an initial context to perform the JNDI lookup.
+         initialContext = new InitialContext();
+
+         // Step 2. perform lookup on the topics
+         Topic genericTopic = (Topic) initialContext.lookup("topic/genericTopic");
+         Topic europeTopic = (Topic) initialContext.lookup("topic/europeTopic");
+         Topic usTopic = (Topic) initialContext.lookup("topic/usTopic");
+
+         // Step 3. perform a lookup on the Connection Factory
+         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 4. Try to create a JMS Connection without user/password. It will fail.
+         try {
+            failConnection = cf.createConnection();
+            result = false;
+         }
+         catch (JMSSecurityException e) {
+            System.out.println("Default user cannot get a connection. Details: " + e.getMessage());
+         }
+
+         // Step 5. bill tries to make a connection using wrong password
+         billConnection = null;
+         try {
+            billConnection = createConnection("bill", "activemq1", cf);
+            result = false;
+         }
+         catch (JMSException e) {
+            System.out.println("User bill failed to connect. Details: " + e.getMessage());
+         }
+
+         // Step 6. bill makes a good connection.
+         billConnection = createConnection("bill", "activemq", cf);
+         billConnection.start();
+
+         // Step 7. andrew makes a good connection.
+         andrewConnection = createConnection("andrew", "activemq1", cf);
+         andrewConnection.start();
+
+         // Step 8. frank makes a good connection.
+         frankConnection = createConnection("frank", "activemq2", cf);
+         frankConnection.start();
+
+         // Step 9. sam makes a good connection.
+         samConnection = createConnection("sam", "activemq3", cf);
+         samConnection.start();
+
+         // Step 10. Check every user can publish/subscribe genericTopics.
+         System.out.println("------------------------Checking permissions on " + genericTopic + "----------------");
+         checkUserSendAndReceive(genericTopic, billConnection, "bill");
+         checkUserSendAndReceive(genericTopic, andrewConnection, "andrew");
+         checkUserSendAndReceive(genericTopic, frankConnection, "frank");
+         checkUserSendAndReceive(genericTopic, samConnection, "sam");
+         System.out.println("-------------------------------------------------------------------------------------");
+
+         System.out.println("------------------------Checking permissions on " + europeTopic + "----------------");
+
+         // Step 11. Check permissions on news.europe.europeTopic for bill: can't send and can't receive
+         checkUserNoSendNoReceive(europeTopic, billConnection, "bill");
+
+         // Step 12. Check permissions on news.europe.europeTopic for andrew: can send but can't receive
+         checkUserSendNoReceive(europeTopic, andrewConnection, "andrew", frankConnection);
+
+         // Step 13. Check permissions on news.europe.europeTopic for frank: can't send but can receive
+         checkUserReceiveNoSend(europeTopic, frankConnection, "frank", andrewConnection);
+
+         // Step 14. Check permissions on news.europe.europeTopic for sam: can't send but can receive
+         checkUserReceiveNoSend(europeTopic, samConnection, "sam", andrewConnection);
+         System.out.println("-------------------------------------------------------------------------------------");
+
+         System.out.println("------------------------Checking permissions on " + usTopic + "----------------");
+
+         // Step 15. Check permissions on news.us.usTopic for bill: can't send and can't receive
+         checkUserNoSendNoReceive(usTopic, billConnection, "bill");
+
+         // Step 16. Check permissions on news.us.usTopic for andrew: can't send and can't receive
+         checkUserNoSendNoReceive(usTopic, andrewConnection, "andrew");
+
+         // Step 17. Check permissions on news.us.usTopic for frank: can both send and receive
+         checkUserSendAndReceive(usTopic, frankConnection, "frank");
+
+         // Step 18. Check permissions on news.us.usTopic for sam: can't send but can receive
+         checkUserReceiveNoSend(usTopic, samConnection, "sam", frankConnection);
+         System.out.println("-------------------------------------------------------------------------------------");
+      }
+      finally {
+         // Step 19. Be sure to close our JMS resources!
+         if (failConnection != null) {
+            failConnection.close();
+         }
+         if (billConnection != null) {
+            billConnection.close();
+         }
+         if (andrewConnection != null) {
+            andrewConnection.close();
+         }
+         if (frankConnection != null) {
+            frankConnection.close();
+         }
+         if (samConnection != null) {
+            samConnection.close();
+         }
+
+         // Also the initialContext
+         if (initialContext != null) {
+            initialContext.close();
+         }
+      }
+   }
+
+   // Check the user can receive message but cannot send message.
+   private static void checkUserReceiveNoSend(final Topic topic,
+                                              final Connection connection,
+                                              final String user,
+                                              final Connection sendingConn) throws JMSException {
+      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+      MessageProducer producer = session.createProducer(topic);
+      MessageConsumer consumer = session.createConsumer(topic);
+      TextMessage msg = session.createTextMessage("hello-world-1");
+
+      try {
+         producer.send(msg);
+         throw new IllegalStateException("Security setting is broken! User " + user +
+                                            " can send message [" +
+                                            msg.getText() +
+                                            "] to topic " +
+                                            topic);
+      }
+      catch (JMSException e) {
+         System.out.println("User " + user + " cannot send message [" + msg.getText() + "] to topic: " + topic);
+      }
+
+      // Now send a good message
+      Session session1 = sendingConn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+      producer = session1.createProducer(topic);
+      producer.send(msg);
+
+      TextMessage receivedMsg = (TextMessage) consumer.receive(2000);
+
+      if (receivedMsg != null) {
+         System.out.println("User " + user + " can receive message [" + receivedMsg.getText() + "] from topic " + topic);
+      }
+      else {
+         throw new IllegalStateException("Security setting is broken! User " + user + " cannot receive message from topic " + topic);
+      }
+
+      session1.close();
+      session.close();
+   }
+
+   // Check the user can send message but cannot receive message
+   private static void checkUserSendNoReceive(final Topic topic,
+                                              final Connection connection,
+                                              final String user,
+                                              final Connection receivingConn) throws JMSException {
+      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+      MessageProducer producer = session.createProducer(topic);
+      try {
+         session.createConsumer(topic);
+      }
+      catch (JMSException e) {
+         System.out.println("User " + user + " cannot receive any message from topic " + topic);
+      }
+
+      Session session1 = receivingConn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+      MessageConsumer goodConsumer = session1.createConsumer(topic);
+
+      TextMessage msg = session.createTextMessage("hello-world-2");
+      producer.send(msg);
+
+      TextMessage receivedMsg = (TextMessage) goodConsumer.receive(2000);
+      if (receivedMsg != null) {
+         System.out.println("User " + user + " can send message [" + receivedMsg.getText() + "] to topic " + topic);
+      }
+      else {
+         throw new IllegalStateException("Security setting is broken! User " + user +
+                                            " cannot send message [" +
+                                            msg.getText() +
+                                            "] to topic " +
+                                            topic);
+      }
+
+      session.close();
+      session1.close();
+   }
+
+   // Check the user has neither send nor receive permission on topic
+   private static void checkUserNoSendNoReceive(final Topic topic,
+                                                final Connection connection,
+                                                final String user) throws JMSException {
+      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+      MessageProducer producer = session.createProducer(topic);
+
+      try {
+         session.createConsumer(topic);
+      }
+      catch (JMSException e) {
+         System.out.println("User " + user + " cannot create consumer on topic " + topic);
+      }
+
+      TextMessage msg = session.createTextMessage("hello-world-3");
+      try {
+         producer.send(msg);
+         throw new IllegalStateException("Security setting is broken! User " + user +
+                                            " can send message [" +
+                                            msg.getText() +
+                                            "] to topic " +
+                                            topic);
+      }
+      catch (JMSException e) {
+         System.out.println("User " + user + " cannot send message [" + msg.getText() + "] to topic: " + topic);
+      }
+
+      session.close();
+   }
+
+   // Check the user connection has both send and receive permissions on the topic
+   private static void checkUserSendAndReceive(final Topic topic,
+                                               final Connection connection,
+                                               final String user) throws JMSException {
+      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+      TextMessage msg = session.createTextMessage("hello-world-4");
+      MessageProducer producer = session.createProducer(topic);
+      MessageConsumer consumer = session.createConsumer(topic);
+      producer.send(msg);
+      TextMessage receivedMsg = (TextMessage) consumer.receive(5000);
+      if (receivedMsg != null) {
+         System.out.println("User " + user + " can send message: [" + msg.getText() + "] to topic: " + topic);
+         System.out.println("User " + user + " can receive message: [" + msg.getText() + "] from topic: " + topic);
+      }
+      else {
+         throw new IllegalStateException("Error! User " + user + " cannot receive the message! ");
+      }
+      session.close();
+   }
+
+   private static Connection createConnection(final String username,
+                                              final String password,
+                                              final ConnectionFactory cf) throws JMSException {
+      return cf.createConnection(username, password);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/security/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/security/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/security/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..09b3f5d
--- /dev/null
+++ b/examples/features/standard/security/src/main/resources/activemq/server0/artemis-roles.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.
+## ---------------------------------------------------------------------------
+bill=user
+andrew=europe-user,user
+frank=us-user,news-user,user
+sam=news-user,user
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/security/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/security/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/security/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..0a206c6
--- /dev/null
+++ b/examples/features/standard/security/src/main/resources/activemq/server0/artemis-users.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.
+## ---------------------------------------------------------------------------
+bill=activemq
+andrew=activemq1
+frank=activemq2
+sam=activemq3
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/security/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/security/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/security/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..6a8b82b
--- /dev/null
+++ b/examples/features/standard/security/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,81 @@
+<?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">
+      <topic name="genericTopic"/>
+
+      <topic name="news.europe.europeTopic"/>
+
+      <topic name="news.us.usTopic"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!-- any user can have full control of generic topics -->
+         <security-setting match="jms.topic.#">
+            <permission type="createDurableQueue" roles="user"/>
+            <permission type="deleteDurableQueue" roles="user"/>
+            <permission type="createNonDurableQueue" roles="user"/>
+            <permission type="deleteNonDurableQueue" roles="user"/>
+            <permission type="send" roles="user"/>
+            <permission type="consume" roles="user"/>
+         </security-setting>
+
+         <security-setting match="jms.topic.news.europe.#">
+            <permission type="createDurableQueue" roles="user"/>
+            <permission type="deleteDurableQueue" roles="user"/>
+            <permission type="createNonDurableQueue" roles="user"/>
+            <permission type="deleteNonDurableQueue" roles="user"/>
+            <permission type="send" roles="europe-user"/>
+            <permission type="consume" roles="news-user"/>
+         </security-setting>
+
+         <security-setting match="jms.topic.news.us.#">
+            <permission type="createDurableQueue" roles="user"/>
+            <permission type="deleteDurableQueue" roles="user"/>
+            <permission type="createNonDurableQueue" roles="user"/>
+            <permission type="deleteNonDurableQueue" roles="user"/>
+            <permission type="send" roles="us-user"/>
+            <permission type="consume" roles="news-user"/>
+         </security-setting>
+      </security-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/security/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/security/src/main/resources/jndi.properties b/examples/features/standard/security/src/main/resources/jndi.properties
new file mode 100644
index 0000000..0a3b640
--- /dev/null
+++ b/examples/features/standard/security/src/main/resources/jndi.properties
@@ -0,0 +1,22 @@
+# 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
+topic.topic/genericTopic=genericTopic
+topic.topic/europeTopic=news.europe.europeTopic
+topic.topic/usTopic=news.us.usTopic

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/send-acknowledgements/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/send-acknowledgements/pom.xml b/examples/features/standard/send-acknowledgements/pom.xml
new file mode 100644
index 0000000..8295cdc
--- /dev/null
+++ b/examples/features/standard/send-acknowledgements/pom.xml
@@ -0,0 +1,104 @@
+<?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>send-acknowledgements</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Send Acknowledgements 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>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <spawn>true</spawn>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.SendAcknowledgementsExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.broker</groupId>
+                  <artifactId>send-acknowledgements</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/send-acknowledgements/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/send-acknowledgements/readme.html b/examples/features/standard/send-acknowledgements/readme.html
new file mode 100644
index 0000000..fcc37fc
--- /dev/null
+++ b/examples/features/standard/send-acknowledgements/readme.html
@@ -0,0 +1,140 @@
+<!--
+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 Asynchronous Send Acknowledgements 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>Asynchronous Send Acknowledgements 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>Asynchronous Send Acknowledgements are an advanced feature of ActiveMQ Artemis which allow you to
+     receive acknowledgements that messages were successfully received at the server in a separate thread to the sending thread<p/>
+     <p>In this example we create a normal JMS session, then set a SendAcknowledgementHandler on the JMS
+     session's underlying core session. We send many messages to the server without blocking and asynchronously
+     receive send acknowledgements via the SendAcknowledgementHandler.
+
+     <p>For more information on Asynchronous Send Acknowledgements please see the user manual</p>
+     <h2>Example step-by-step</h2>
+     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
+
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
+        <pre class="prettyprint">
+           <code>InitialContext initialContext = getContext();</code>
+        </pre>
+
+        <li>We look-up the JMS queue object from JNDI</li>
+        <pre class="prettyprint">
+           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>We look-up the JMS connection factory object from JNDI</li>
+        <pre class="prettyprint">
+           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>We create a JMS connection</li>
+        <pre class="prettyprint">
+           <code>connection = cf.createConnection();</code>
+        </pre>
+
+        <li>Define a SendAcknowledgementHandler which will receive asynchronous acknowledgements</li>
+        <pre class="prettyprint">
+           <code>
+         class MySendAcknowledgementsHandler implements SendAcknowledgementHandler
+         {
+            int count = 0;
+
+            public void sendAcknowledged(final Message message)
+            {
+               System.out.println("Received send acknowledgement for message " + count++);
+            }
+         }
+           </code>
+        </pre>
+
+        <li>Create a JMS session</li>
+        <pre class="prettyprint">
+          <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
+       </pre>
+
+        <li>Set the handler on the underlying core session</li>
+        <pre class="prettyprint">
+           <code>
+         ClientSession coreSession = ((ActiveMQSession)session).getCoreSession();
+
+         coreSession.setSendAcknowledgementHandler(new MySendAcknowledgementsHandler());
+
+           </code>
+        </pre>
+
+        <li>Create a JMS Message Producer</li>
+        <pre class="prettyprint">
+           <code>
+         MessageProducer producer = session.createProducer(queue);
+
+         producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+           </code>
+        </pre>
+
+        <li>Send 5000 messages, the handler will get called asynchronously some time later after the messages are sent.</li>
+          <pre class="prettyprint">
+           <code>
+         final int numMessages = 5000;
+
+         for (int i = 0; i < numMessages; i++)
+         {
+            javax.jms.Message jmsMessage = session.createMessage();
+
+            producer.send(jmsMessage);
+
+            System.out.println("Sent message " + i);
+         }
+           </code>
+        </pre>
+
+
+        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
+
+        <pre class="prettyprint">
+           <code>finally
+           {
+              if (initialContext != null)
+              {
+                initialContext.close();
+              }
+              if (connection != null)
+              {
+                 connection.close();
+              }
+           }</code>
+        </pre>
+
+
+
+     </ol>
+  </body>
+</html>


[35/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-context/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-context/pom.xml b/examples/broker-features/standard/jms-context/pom.xml
deleted file mode 100644
index 1f3e017..0000000
--- a/examples/broker-features/standard/jms-context/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>context</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Context 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>
-                     <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.JMSContextExample</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>context</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-context/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-context/readme.html b/examples/broker-features/standard/jms-context/readme.html
deleted file mode 100644
index 34895a2..0000000
--- a/examples/broker-features/standard/jms-context/readme.html
+++ /dev/null
@@ -1,35 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Context 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 Context 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 by using a JMS Context</p>
-     <p>A JMSContext is part of JMS 2.0 and combines the JMS Connection and Session Objects into a simple Interface</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java b/examples/broker-features/standard/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java
deleted file mode 100644
index d2a341c..0000000
--- a/examples/broker-features/standard/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java
+++ /dev/null
@@ -1,51 +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.DeliveryMode;
-import javax.jms.JMSContext;
-import javax.jms.Queue;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * A simple JMS Queue example that creates a producer and consumer on a queue and sends then receives a message.
- */
-public class JMSContextExample {
-
-   public static void main(final String[] args) throws Exception {
-      // Instantiate the queue
-      Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-      // Instantiate the ConnectionFactory (Using the default URI on this case)
-      // Also instantiate the jmsContext
-      // Using closeable interface
-      try (ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
-           JMSContext jmsContext = cf.createContext()) {
-         // Create a message producer, note that we can chain all this into one statement
-         jmsContext.createProducer().setDeliveryMode(DeliveryMode.PERSISTENT).send(queue, "this is a string");
-
-         // Create a Consumer and receive the payload of the message direct.
-         String payLoad = jmsContext.createConsumer(queue).receiveBody(String.class);
-
-         System.out.println("payLoad = " + payLoad);
-
-      }
-
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-shared-consumer/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-shared-consumer/pom.xml b/examples/broker-features/standard/jms-shared-consumer/pom.xml
deleted file mode 100644
index e5fa1ce..0000000
--- a/examples/broker-features/standard/jms-shared-consumer/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?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>shared-consumer</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Shared Consumer 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.JMSSharedConsumerExample</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>shared-consumer</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-shared-consumer/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-shared-consumer/readme.html b/examples/broker-features/standard/jms-shared-consumer/readme.html
deleted file mode 100644
index b92b340..0000000
--- a/examples/broker-features/standard/jms-shared-consumer/readme.html
+++ /dev/null
@@ -1,119 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Shared Consumer 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 Shared Consumer 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 can use shared consumers to share a subscription on a topic. In JMS 1.1 this was not allowed
-     and so caused a scalability issue. In JMS 2 this restriction has been lifted so you can share the load across different
-         threads and connections.</p>
-
-     <h2>Example step-by-step</h2>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS topic object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Topic topic = (Topic) initialContext.lookup("/topic/exampleTopic");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS context</li>
-        <pre class="prettyprint">
-           <code>jmsContext = cf.createContext();</code>
-        </pre>
-
-        <li>We create a JMS Producer.</li>
-        <pre class="prettyprint">
-           <code>JMSProducer producer = jmsContext.createProducer();</code>
-        </pre>
-
-        <li>We create a shared consumer using the subscription name <literal>sc1</literal></li>
-        <pre class="prettyprint">
-          <code>JMSConsumer jmsConsumer = jmsContext.createSharedConsumer(topic, "sc1");</code>
-       </pre>
-
-        <li>We then create a second JMS context for a second shared consumer</li>
-        <pre class="prettyprint">
-           <code>jmsContext2 = cf.createContext();</code>
-        </pre>
-
-         <li>we then create the second shared consumer using the same subscription name</li>
-        <pre class="prettyprint">
-           <code>JMSConsumer jmsConsumer2 = jmsContext2.createSharedConsumer(topic, "sc1");</code>
-        </pre>
-
-         <li>we then send 2 messages</li>
-        <pre class="prettyprint">
-           <code>
-           producer.send(topic, "this is a String!");
-
-           producer.send(topic, "this is a second String!") ;</code>
-        </pre>
-
-         <li>we then receive the 2 messages using both shared consumers</li>
-        <pre class="prettyprint">
-           <code>
-           String body = jmsConsumer.receiveBody(String.class, 5000);
-
-           body = jmsConsumer2.receiveBody(String.class, 5000);</code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                 initialContext.close();
-              }
-              if (jmsContext != null)
-              {
-                 jmsContext.close();
-              }
-               if (jmsContext2 != null)
-               {
-               jmsContext2.close();
-               }
-           }</code>
-        </pre>
-
-
-
-     </ol>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java b/examples/broker-features/standard/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java
deleted file mode 100644
index da43eb0..0000000
--- a/examples/broker-features/standard/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java
+++ /dev/null
@@ -1,87 +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.ConnectionFactory;
-import javax.jms.JMSConsumer;
-import javax.jms.JMSContext;
-import javax.jms.JMSProducer;
-import javax.jms.Topic;
-import javax.naming.InitialContext;
-
-/**
- * A JMS Example that uses shared consumers.
- */
-public class JMSSharedConsumerExample {
-
-   public static void main(final String[] args) throws Exception {
-      InitialContext initialContext = null;
-      JMSContext jmsContext = null;
-      JMSContext jmsContext2 = null;
-      try {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
-
-         // Step 2. Perfom a lookup on the queue
-         Topic topic = (Topic) initialContext.lookup("topic/exampleTopic");
-
-         // Step 3. Perform a lookup on the Connection Factory
-         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 4.Create a JMS Context
-         jmsContext = cf.createContext();
-
-         // Step 5. Create a message producer.
-         JMSProducer producer = jmsContext.createProducer();
-
-         // Step 6. Create a shared consumer
-         JMSConsumer jmsConsumer = jmsContext.createSharedConsumer(topic, "sc1");
-
-         // Step 7. Create a second JMS Context for a second shared consumer
-         jmsContext2 = cf.createContext();
-
-         // Step 8. Create the second shared consumer
-         JMSConsumer jmsConsumer2 = jmsContext2.createSharedConsumer(topic, "sc1");
-
-         // Step 9. send 2 messages
-         producer.send(topic, "this is a String!");
-
-         producer.send(topic, "this is a second String!");
-
-         // Step 10. receive the messages shared by both consumers
-         String body = jmsConsumer.receiveBody(String.class, 5000);
-
-         System.out.println("body = " + body);
-
-         body = jmsConsumer2.receiveBody(String.class, 5000);
-
-         System.out.println("body = " + body);
-      }
-      finally {
-         // Step 11. Be sure to close our JMS resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (jmsContext != null) {
-            jmsContext.close();
-         }
-         if (jmsContext2 != null) {
-            jmsContext2.close();
-         }
-      }
-   }
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 2b2ba2e..0000000
--- a/examples/broker-features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?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 topic used by the example-->
-      <topic name="exampleTopic"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-
-      <!-- Acceptors -->
-
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example topic-->
-         <security-setting match="jms.topic.exampleTopic">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jms-shared-consumer/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jms-shared-consumer/src/main/resources/jndi.properties b/examples/broker-features/standard/jms-shared-consumer/src/main/resources/jndi.properties
deleted file mode 100644
index 54bed6d..0000000
--- a/examples/broker-features/standard/jms-shared-consumer/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-topic.topic/exampleTopic=exampleTopic

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jmx/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jmx/pom.xml b/examples/broker-features/standard/jmx/pom.xml
deleted file mode 100644
index 693b2fc..0000000
--- a/examples/broker-features/standard/jmx/pom.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?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>jmx</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS "JMX" Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <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-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>
-                     <!-- options used for JMX on the example -->
-                     <javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
-                     </javaOptions>
-                  </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.JMXExample</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>jmx</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jmx/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jmx/readme.html b/examples/broker-features/standard/jmx/readme.html
deleted file mode 100644
index 8dd4fe9..0000000
--- a/examples/broker-features/standard/jmx/readme.html
+++ /dev/null
@@ -1,181 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMX Management 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>JMX Management 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 how to manage ActiveMQ Artemis using <a href="http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/">JMX</a></p>
-
-     <h2>Example configuration</h2>
-
-     <p>ActiveMQ Artemis exposes its managed resources by default on the platform MBeanServer.</p>
-     <p>To access this MBeanServer remotely, the Java Virtual machine must be started with system properties:
-         <pre class="prettyprint">
-             <code>-Dcom.sun.management.jmxremote
-             -Dcom.sun.management.jmxremote.port=3000
-             -Dcom.sun.management.jmxremote.ssl=false
-             -Dcom.sun.management.jmxremote.authenticate=false</code>
-        </pre>
-        <p>These properties are explained in the Java 5 <a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#remote">Management guide</a>
-            (please note that for this example, we will disable user authentication for simplicity sake).</p>
-        <p>With these properties, ActiveMQ Artemis server will be manageable remotely using standard JMX URL on port <code>3000</code>.</p>
-     </p>
-
-     <h2>Example step-by-step</h2>
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get its properties from <a href="server0/client-jndi.properties">client-jndi.properties</a></li>
-        <pre class="prettyprint">
-            <code>InitialContext initialContext = getContext(0);</code>
-        </pre>
-
-        <li>We look up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-            <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-            <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-            <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-            <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-            <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create a JMS text message that we are going to send.</li>
-        <pre class="prettyprint">
-            <code>TextMessage message = session.createTextMessage("This is a text message");</code>
-        </pre>
-
-        <li>We send message to the queue</li>
-        <pre class="prettyprint">
-            <code>messageProducer.send(message);</code>
-        </pre>
-
-        <p><em>Now that we have a message in the queue, we will manage the queue by retrieving the number of messages in the queue
-            (i.e. 1) and by removing the message which has been sent in step 8.</em></p>
-
-        <li>We retrieve the <code>ObjectName</code> corresponding to the queue using a helper class <code>ObjectNameBuilder</code></li>
-        <pre class="prettyprint">
-              <code>ObjectName on = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queue.getQueueName());</code>
-        </pre>
-
-        <li>We create a JMX Connector to connect to the server's MBeanServer using the <a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#connecting">standard JMX service URL</a></li>
-        <pre class="prettyprint">
-            <code>JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap());</code>
-        </pre>
-
-        <li>We retrieve a <code>MBeanServerConnection</code> from the JMX connector</li>
-        <pre class="prettyprint">
-           <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);</code>
-        </pre>
-
-        <li>We create a <code>JMSQueueControl</code> proxy to manage the queue on the server</li>
-        <pre class="prettyprint">
-            <code>JMSQueueControl queueControl = (JMSQueueControl)MBeanServerInvocationHandler.newProxyInstance(mbsc,
-                                                                                              on,
-                                                                                              JMSQueueControl.class,
-                                                                                              false);
-             </code>
-        </pre>
-
-        <li>We use this mbean proxy to retrieve the number of messages in the queue using the <code>getMessageCount</code> method</li>
-        <pre class="prettyprint">
-            <code>System.out.println(queueControl.getName() + " contains " + queueControl.getMessageCount() + " messages");</code>
-        </pre>
-
-        <li>We will now remove the message sent at step 8 using the <code>removeMessage</code> method with the JMS Message ID of the message</li>
-        <pre class="prettyprint">
-            <code>System.out.println("message has been removed: " + queueControl.removeMessage(message.getJMSMessageID()));</code>
-        </pre>
-
-        <li>We use again the mbean proxy to retrieve the number of messages. This time, it will display <code>0</code> messages</li>
-        <pre class="prettyprint">
-            <code>System.out.println(queueControl.getName() + " contains " + queueControl.getMessageCount() + " messages");</code>
-        </pre>
-
-        <li>Now we have finish the management operations, we close the JMX connector</li>
-        <pre class="prettyprint">
-            <code>connector.close()</code>
-        </pre>
-
-        <p><em>We will now try to consume the message sent to the queue but it won't be there: it has been removed by the management operation</em></p>
-
-        <li>We create a JMS message consumer on the queue</li>
-        <pre class="prettyprint">
-            <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-            <code>connection.start();</code>
-        </pre>
-
-        <li>We try to receive a message from the queue. Since there is none, the call will timeout after 5000ms and messageReceived will be null
-        </li>
-        <pre class="prettyprint">
-            <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-            System.out.println("Received message: " + messageReceived);</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>
-
-     <h2>More information</h2>
-
-     <ul>
-        <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.jmx">Using Management Via JMX chapter</a></li>
-        <li><a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html">Java 5 Management guide</a></li>
-     </ul>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java b/examples/broker-features/standard/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java
deleted file mode 100644
index 108897f..0000000
--- a/examples/broker-features/standard/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java
+++ /dev/null
@@ -1,121 +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.HashMap;
-
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.management.MBeanServerConnection;
-import javax.management.MBeanServerInvocationHandler;
-import javax.management.ObjectName;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-import javax.naming.InitialContext;
-
-import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
-import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
-
-/**
- * An example that shows how to manage ActiveMQ Artemis using JMX.
- */
-public class JMXExample {
-
-   private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3000/jmxrmi";
-
-   public static void main(final String[] args) throws Exception {
-      QueueConnection 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
-         QueueConnectionFactory cf = (QueueConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 4.Create a JMS Connection
-         connection = cf.createQueueConnection();
-
-         // Step 5. Create a JMS Session
-         QueueSession session = connection.createQueueSession(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. Retrieve the ObjectName of the queue. This is used to identify the server resources to manage
-         ObjectName on = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queue.getQueueName());
-
-         // Step 10. Create JMX Connector to connect to the server's MBeanServer
-         JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMXExample.JMX_URL), new HashMap());
-
-         // Step 11. Retrieve the MBeanServerConnection
-         MBeanServerConnection mbsc = connector.getMBeanServerConnection();
-
-         // Step 12. Create a JMSQueueControl proxy to manage the queue on the server
-         JMSQueueControl queueControl = MBeanServerInvocationHandler.newProxyInstance(mbsc, on, JMSQueueControl.class, false);
-         // Step 13. Display the number of messages in the queue
-         System.out.println(queueControl.getName() + " contains " + queueControl.getMessageCount() + " messages");
-
-         // Step 14. Remove the message sent at step #8
-         System.out.println("message has been removed: " + queueControl.removeMessage(message.getJMSMessageID()));
-
-         // Step 15. Display the number of messages in the queue
-         System.out.println(queueControl.getName() + " contains " + queueControl.getMessageCount() + " messages");
-
-         // Step 16. We close the JMX connector
-         connector.close();
-
-         // Step 17. Create a JMS Message Consumer on the queue
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-
-         // Step 18. Start the Connection
-         connection.start();
-
-         // Step 19. Trying to receive a message. Since the only message in the queue was removed by a management
-         // operation, there is none to consume.
-         // The call will timeout after 5000ms and messageReceived will be null
-         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-         System.out.println("Received message: " + messageReceived);
-      }
-      finally {
-         // Step 20. Be sure to close the resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jmx/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jmx/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/jmx/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7a30153..0000000
--- a/examples/broker-features/standard/jmx/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?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.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-
-      <!-- true to expose ActiveMQ Artemis resources through JMX -->
-      <jmx-management-enabled>true</jmx-management-enabled>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty">tcp://localhost:61616</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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/jmx/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/jmx/src/main/resources/jndi.properties b/examples/broker-features/standard/jmx/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/jmx/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/large-message/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/large-message/pom.xml b/examples/broker-features/standard/large-message/pom.xml
deleted file mode 100644
index 007ccd7..0000000
--- a/examples/broker-features/standard/large-message/pom.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?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>large-message</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Large Message Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.LargeMessageExample</clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.broker</groupId>
-                  <artifactId>large-message</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/large-message/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/large-message/readme.html b/examples/broker-features/standard/large-message/readme.html
deleted file mode 100644
index 0dc42cb..0000000
--- a/examples/broker-features/standard/large-message/readme.html
+++ /dev/null
@@ -1,200 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Large Message 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>Large Message Example</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory, This example will start and stop the server since it will look for a failure.</pre>
-
-
-     <p>This example shows you how to send and receive very large messages with ActiveMQ Artemis.</p>
-     <p>ActiveMQ Artemis supports the sending and receiving of huge messages, much larger than can fit in available RAM
-     on the client or server. Effectively the only limit to message size is the amount of disk space you have on the server.</p>
-     <p>Large messages are persisted on the server so they can survive a server restart. In other words ActiveMQ Artemis doesn't just
-     do a simple socket stream from the sender to the consumer.</p>
-     <p>In order to do this ActiveMQ Artemis provides an extension to JMS where you can use an InputStream or OutputStream as the source and destination for your messages. You can send messages as large as it would fit in your disk.</p>
-     <p>You may also choose to read LargeMessages using the regular ByteStream or ByteMessage methods, but using the InputStream and OutputStream will provide you a much better performance</p>
-
-     <h2>Example step-by-step</h2>
-     <p>In this example we limit both the server and the client to be running in a maximum of 50MB of RAM,
-     and we send a message with a body of size 256MB.</p>
-     <p>ActiveMQ Artemis can support much large message sizes but we
-     choose these sizes and limit RAM so the example runs more quickly.</p>
-     <p>We create a file on disk representing the message body, create
-     a FileInputStream on that file and set that InputStream as the body of the message before sending.</p>
-     <p>The message is sent, then we stop the server, and restart it. This demonstrates the large message will survive a restart of the server.</p>
-     <p>Once the server is restarted we receive the message and stream it's body to another file on disk.</p>
-
-     <ol>
-        <li>Create an initial context to perform the JNDI lookup.</li>
-        <pre class="prettyprint">
-           <code>initialContext = getContext(0);</code>
-        </pre>
-
-        <li>Perfom a lookup on the queue.</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>Perform a lookup on the Connection Factory. This ConnectionFactory has a special attribute set on it. activemq-jms.xml)
-            Messages with more than 10K are considered large.</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>Create the JMS objects for sending the message.</li>
-        <pre class="prettyprint">
-           <code>
-        connection = cf.createConnection();
-
-        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-        MessageProducer producer = session.createProducer(queue);
-           </code>
-        </pre>
-
-        <li>Create a huge file - this will form the body of the message we will send.</li>
-        <pre class="prettyprint">
-           <code>
-        File fileInput = new File("huge_message_to_send.dat");
-
-        fileInput.createNewFile();
-
-        createFile(fileInput, FILE_SIZE);
-           </code>
-        </pre>
-
-        <li>Create a BytesMessage</li>
-        <pre class="prettyprint">
-          <code>BytesMessage message = session.createBytesMessage();</code>
-       </pre>
-
-        <li>We set the InputStream on the message. When sending the message will read the InputStream
-        until it gets EOF. In this case we point the InputStream at a file on disk, and it will suck up the entire
-        file, however we could use any InputStream not just a FileInputStream.</li>
-        <pre class="prettyprint"><code>
-         FileInputStream fileInputStream = new FileInputStream(fileInput);
-
-         BufferedInputStream bufferedInput = new BufferedInputStream(fileInputStream);
-
-         message.setObjectProperty("JMS_AMQ_InputStream", bufferedInput);
-        </code></pre>
-
-        <li>Send the Message.</li>
-        <pre class="prettyprint"><code>
-         producer.send(message);
-         </code></pre>
-
-
-        <li>We send message to the queue. After the send completion the message file will be located at ./build/data/largeMessages</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message);</code>
-        </pre>
-
-        <li>
-        To demonstrate that that we're not simply streaming the message from sending to consumer, we stop
-        the server and restart it before consuming the message. This demonstrates that the large message gets persisted, like a
-        normal persistent message, on the server. If you look at ./build/data/largeMessages you will see the largeMessage
-        stored on disk the server.
-        </li>
-          <pre class="prettyprint">
-           <code>
-        connection.close();
-
-        initialContext.close();
-
-        stopServer(0);
-
-        // Give the server a little time to shutdown properly
-        Thread.sleep(5000);
-
-        startServer(0);
-           </code>
-        </pre>
-
-        <li>Now the server is restarted we can recreate the JMS Objects, and start the new connection.</li>
-        <pre class="prettyprint">
-           <code>
-        initialContext = getContext(0);
-
-        queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-
-        cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-
-        connection = cf.createConnection();
-
-        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-        MessageConsumer messageConsumer = session.createConsumer(queue);
-
-        connection.start();
-
-           </code>
-        </pre>
-
-        <li>Receive the message. When we receive the large message we initially just receive the message with
-        an empty body.</li>
-        <pre class="prettyprint"><code>BytesMessage messageReceived = (BytesMessage)messageConsumer.receive(120000);
-        </code></pre>
-
-        <li>We set an OutputStream on the message. This causes the message body to be written to the
-         OutputStream until there are no more bytes to be written.
-         You don't have to use a FileOutputStream, you can use any OutputStream.
-         You may choose to use the regular BytesMessage or
-         StreamMessage interface but this method is much faster for large messages.</li>
-        <pre class="prettyprint"><code>
-         File outputFile = new File("huge_message_received.dat");
-
-         FileOutputStream fileOutputStream = new FileOutputStream(outputFile);
-
-         BufferedOutputStream bufferedOutput = new BufferedOutputStream(fileOutputStream);
-
-        </code></pre>
-
-         <li>This will save the stream and wait until the entire message is written before continuing.</li>
-        <pre class="prettyprint"><code>
-         messageReceived.setObjectProperty("JMS_AMQ_SaveStream", bufferedOutput);
-        </code></pre>
-
-        <li>Be sure to close our resources!</li>
-
-        <pre class="prettyprint">
-           <code>
-           finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java b/examples/broker-features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
deleted file mode 100644
index 88ad6cc..0000000
--- a/examples/broker-features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
+++ /dev/null
@@ -1,193 +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 org.apache.activemq.artemis.util.ServerUtil;
-
-import javax.jms.BytesMessage;
-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.naming.InitialContext;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-/**
- * This example demonstrates the ability of ActiveMQ Artemis to send and consume a very large message, much
- * bigger than can fit in RAM.
- */
-public class LargeMessageExample {
-
-   /**
-    * The message we will send is size 2GiB, even though we are only running in 50MB of RAM on both
-    * client and server.
-    * <p>
-    * This may take some considerable time to create, send and consume - if it takes too long or you
-    * don't have enough disk space just reduce the file size here
-    */
-   private static final long FILE_SIZE = 2L * 1024 * 1024 * 1024; // 2 GiB message
-
-   public static void main(final String[] args) throws Exception {
-      Process server = null;
-      Connection connection = null;
-      InitialContext initialContext = null;
-
-      try {
-         server = ServerUtil.startServer(args[0], LargeMessageExample.class.getSimpleName(), 0, 5000);
-
-         // 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. This ConnectionFactory has a special attribute set on
-         // it.
-         // Messages with more than 10K are considered large
-         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 4. Create the JMS objects
-         connection = cf.createConnection();
-
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         MessageProducer producer = session.createProducer(queue);
-
-         // Step 5. Create a huge file - this will form the body of the message we will send.
-
-         System.out.println("Creating a file to send of size " + FILE_SIZE +
-                               " bytes. This may take a little while... " +
-                               "If this is too big for your disk you can easily change the FILE_SIZE in the example.");
-
-         File fileInput = new File("huge_message_to_send.dat");
-
-         createFile(fileInput, FILE_SIZE);
-
-         System.out.println("File created.");
-
-         // Step 6. Create a BytesMessage
-         BytesMessage message = session.createBytesMessage();
-
-         // Step 7. We set the InputStream on the message. When sending the message will read the InputStream
-         // until it gets EOF. In this case we point the InputStream at a file on disk, and it will suck up the entire
-         // file, however we could use any InputStream not just a FileInputStream.
-         FileInputStream fileInputStream = new FileInputStream(fileInput);
-         BufferedInputStream bufferedInput = new BufferedInputStream(fileInputStream);
-
-         message.setObjectProperty("JMS_AMQ_InputStream", bufferedInput);
-
-         System.out.println("Sending the huge message.");
-
-         // Step 9. Send the Message
-         producer.send(message);
-
-         System.out.println("Large Message sent");
-
-         System.out.println("Stopping server.");
-
-         // Step 10. To demonstrate that that we're not simply streaming the message from sending to consumer, we stop
-         // the server and restart it before consuming the message. This demonstrates that the large message gets
-         // persisted, like a
-         // normal persistent message, on the server. If you look at ./build/data/largeMessages you will see the
-         // largeMessage stored on disk the server
-
-         connection.close();
-
-         initialContext.close();
-
-         ServerUtil.killServer(server);
-
-         server = ServerUtil.startServer(args[0], "LargeMessageExample", 0, 5000);
-
-         System.out.println("Server restarted.");
-
-         // Step 11. Now the server is restarted we can recreate the JMS Objects, and start the new connection
-
-         initialContext = new InitialContext();
-
-         queue = (Queue) initialContext.lookup("queue/exampleQueue");
-
-         cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         connection = cf.createConnection();
-
-         session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-
-         connection.start();
-
-         System.out.println("Receiving message.");
-
-         // Step 12. Receive the message. When we receive the large message we initially just receive the message with
-         // an empty body.
-         BytesMessage messageReceived = (BytesMessage) messageConsumer.receive(120000);
-
-         System.out.println("Received message with: " + messageReceived.getLongProperty("_AMQ_LARGE_SIZE") +
-                               " bytes. Now streaming to file on disk.");
-
-         // Step 13. We set an OutputStream on the message. This causes the message body to be written to the
-         // OutputStream until there are no more bytes to be written.
-         // You don't have to use a FileOutputStream, you can use any OutputStream.
-         // You may choose to use the regular BytesMessage or
-         // StreamMessage interface but this method is much faster for large messages.
-
-         File outputFile = new File("huge_message_received.dat");
-
-         FileOutputStream fileOutputStream = new FileOutputStream(outputFile);
-
-         BufferedOutputStream bufferedOutput = new BufferedOutputStream(fileOutputStream);
-
-         // Step 14. This will save the stream and wait until the entire message is written before continuing.
-         messageReceived.setObjectProperty("JMS_AMQ_SaveStream", bufferedOutput);
-
-         fileOutputStream.close();
-
-         System.out.println("File streamed to disk. Size of received file on disk is " + outputFile.length());
-      }
-      finally {
-         // Step 12. Be sure to close our resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-
-         if (connection != null) {
-            connection.close();
-         }
-
-         ServerUtil.killServer(server);
-      }
-   }
-
-   private static void createFile(final File file, final long fileSize) throws IOException {
-      FileOutputStream fileOut = new FileOutputStream(file);
-      BufferedOutputStream buffOut = new BufferedOutputStream(fileOut);
-      byte[] outBuffer = new byte[1024 * 1024];
-      for (long i = 0; i < fileSize; i += outBuffer.length) {
-         buffOut.write(outBuffer);
-      }
-      buffOut.close();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/large-message/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/large-message/src/main/resources/jndi.properties b/examples/broker-features/standard/large-message/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/large-message/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/last-value-queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/last-value-queue/pom.xml b/examples/broker-features/standard/last-value-queue/pom.xml
deleted file mode 100644
index e38c08e..0000000
--- a/examples/broker-features/standard/last-value-queue/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>last-value-queue</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Last Value 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>
-                     <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.LastValueQueueExample</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>last-value-queue</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>


[46/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-queue/pom.xml b/examples/broker-features/clustered/clustered-queue/pom.xml
deleted file mode 100644
index 78a8c8b..0000000
--- a/examples/broker-features/clustered/clustered-queue/pom.xml
+++ /dev/null
@@ -1,154 +0,0 @@
-<?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.clustered</groupId>
-      <artifactId>broker-clustered</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>clustered-queue</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Clustered 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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server0</location>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server1</location>
-                     <testURI>tcp://localhost:61617</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server1</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ClusteredQueueExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server1</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.clustered</groupId>
-                  <artifactId>clustered-queue</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-queue/readme.html b/examples/broker-features/clustered/clustered-queue/readme.html
deleted file mode 100644
index b5fce81..0000000
--- a/examples/broker-features/clustered/clustered-queue/readme.html
+++ /dev/null
@@ -1,56 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Load Balanced Clustered 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 Load Balanced Clustered 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 demonstrates a JMS queue deployed on two different nodes. The two nodes are configured to form a cluster.</p>
-     <p>We then create a consumer on the queue on each node, and we create a producer on only one of the nodes.</p>
-     <p>We then send some messages via the producer, and we verify that <b>both</b> consumers receive the sent messages
-     in a round-robin fashion.</p>
-     <p>In other words, ActiveMQ Artemis <b>load balances</b> the sent messages across all consumers on the cluster</p>
-     <p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
-     JNDI, these could be instantiated directly.</p>
-     <p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster between the two nodes
-     and to load balance the messages between the nodes.</p>
-     <pre class="prettyprint">
-     <code>&lt;cluster-connection name="my-cluster"&gt;
-        &lt;address&gt;jms&lt;/address&gt;
-        &lt;connector-ref>netty-connector&lt;/connector-ref>
-        &lt;retry-interval&gt;500&lt;/retry-interval&gt;
-        &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
-        &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
-        &lt;max-hops&gt;1&lt;/max-hops&gt;
-        &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
-     &lt;/cluster-connection&gt;
-     </code>
-     </pre>
-     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
-     section of the user manual.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java b/examples/broker-features/clustered/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java
deleted file mode 100644
index f92514b..0000000
--- a/examples/broker-features/clustered/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java
+++ /dev/null
@@ -1,117 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
- * nodes of the cluster.
- */
-public class ClusteredQueueExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection connection0 = null;
-
-      Connection connection1 = null;
-
-      try {
-         // Step 2. Instantiate the Queue
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         // Instantiate connection towards server 0
-         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
-
-         // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
-         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
-
-         // Step 6. We create a JMS Connection connection0 which is a connection to server 0
-         connection0 = cf0.createConnection();
-
-         // Step 7. We create a JMS Connection connection1 which is a connection to server 1
-         connection1 = cf1.createConnection();
-
-         // Step 8. We create a JMS Session on server 0
-         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 9. We create a JMS Session on server 1
-         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 10. We start the connections to ensure delivery occurs on them
-         connection0.start();
-
-         connection1.start();
-
-         // Step 11. We create JMS MessageConsumer objects on server 0 and server 1
-         MessageConsumer consumer0 = session0.createConsumer(queue);
-
-         MessageConsumer consumer1 = session1.createConsumer(queue);
-
-         Thread.sleep(1000);
-
-         // Step 12. We create a JMS MessageProducer object on server 0
-         MessageProducer producer = session0.createProducer(queue);
-
-         // Step 13. We send some messages to server 0
-
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session0.createTextMessage("This is text message " + i);
-
-            producer.send(message);
-
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 14. We now consume those messages on *both* server 0 and server 1.
-         // We note the messages have been distributed between servers in a round robin fashion
-         // JMS Queues implement point-to-point message where each message is only ever consumed by a
-         // maximum of one consumer
-
-         for (int i = 0; i < numMessages; i += 2) {
-            TextMessage message0 = (TextMessage) consumer0.receive(5000);
-
-            System.out.println("Got message: " + message0.getText() + " from node 0");
-
-            TextMessage message1 = (TextMessage) consumer1.receive(5000);
-
-            System.out.println("Got message: " + message1.getText() + " from node 1");
-         }
-      }
-      finally {
-         // Step 15. Be sure to close our resources!
-
-         if (connection0 != null) {
-            connection0.close();
-         }
-
-         if (connection1 != null) {
-            connection1.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-queue/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-queue/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/clustered/clustered-queue/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index eb30a90..0000000
--- a/examples/broker-features/clustered/clustered-queue/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?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>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-queue/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-queue/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/clustered/clustered-queue/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 531fed1..0000000
--- a/examples/broker-features/clustered/clustered-queue/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?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>target/server1/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>target/server1/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>target/server1/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>target/server1/data/messaging/paging</paging-directory>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-static-discovery/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-static-discovery/pom.xml b/examples/broker-features/clustered/clustered-static-discovery/pom.xml
deleted file mode 100644
index b3ce3c1..0000000
--- a/examples/broker-features/clustered/clustered-static-discovery/pom.xml
+++ /dev/null
@@ -1,239 +0,0 @@
-<?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.clustered</groupId>
-      <artifactId>broker-clustered</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>clustered-static-discovery</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Clustered Static Discovery Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create2</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server2</instance>
-                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create3</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server3</instance>
-                     <configuration>${basedir}/target/classes/activemq/server3</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server0</location>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <spawn>true</spawn>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server1</location>
-                     <testURI>tcp://localhost:61617</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server1</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start2</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server2</location>
-                     <testURI>tcp://localhost:61618</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server2</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start3</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server3</location>
-                     <testURI>tcp://localhost:61619</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server3</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.StaticClusteredQueueExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server1</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop2</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server2</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop3</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server3</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.clustered</groupId>
-                  <artifactId>clustered-static-discovery</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-static-discovery/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-static-discovery/readme.html b/examples/broker-features/clustered/clustered-static-discovery/readme.html
deleted file mode 100644
index 88931b9..0000000
--- a/examples/broker-features/clustered/clustered-static-discovery/readme.html
+++ /dev/null
@@ -1,58 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Load Balanced Static Clustered 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 Load Balanced Static Clustered 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 demonstrates a JMS queue deployed on two different nodes. The two nodes are configured to form a cluster
-       from a <em>static</em> list of nodes.</p>
-     <p>We then create a consumer on the queue on each node, and we create a producer on only one of the nodes.</p>
-     <p>We then send some messages via the producer, and we verify that <b>both</b> consumers receive the sent messages
-     in a round-robin fashion.</p>
-     <p>In other words, ActiveMQ Artemis <b>load balances</b> the sent messages across all consumers on the cluster</p>
-     <p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
-     JNDI, these could be instantiated directly.</p>
-     <p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster between the two nodes
-     and to load balance the messages between the nodes.</p>
-     <pre class="prettyprint">
-     <code>&lt;cluster-connection name="my-cluster"&gt;
-        &lt;address&gt;jms&lt;/address&gt;
-        &lt;connector-ref>netty-connector&lt;/connector-ref>
-        &lt;retry-interval&gt;500&lt;/retry-interval&gt;
-        &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
-        &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
-        &lt;max-hops&gt;1&lt;/max-hops&gt;
-        &lt;static-connectors>
-           &lt;connector-ref>server1-connector&lt;/connector-ref>
-        &lt;/static-connectors>
-     &lt;/cluster-connection&gt;
-     </code>
-     </pre>
-     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
-     section of the user manual.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java b/examples/broker-features/clustered/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java
deleted file mode 100644
index 453fafc..0000000
--- a/examples/broker-features/clustered/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java
+++ /dev/null
@@ -1,173 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-import org.apache.activemq.artemis.util.ServerUtil;
-
-/**
- * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
- * nodes of the cluster. The cluster is created from a static list of nodes.
- */
-public class StaticClusteredQueueExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection initialConnection = null;
-
-      Connection connection0 = null;
-
-      Connection connection1 = null;
-
-      Connection connection2 = null;
-
-      Connection connection3 = null;
-
-      try {
-         // Step 2. Use direct instantiation (or JNDI if you like)
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         // Step 3. new JMS Connection Factory object from JNDI on server 3
-         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61619");
-
-         //grab an initial connection and wait, in reality you wouldn't do it this way but since we want to ensure an
-         // equal load balance we do this and then create 4 connections round robined
-         initialConnection = cf0.createConnection();
-
-         Thread.sleep(2000);
-         // Step 6. We create a JMS Connection connection0 which is a connection to server 0
-         connection0 = cf0.createConnection();
-
-         // Step 7. We create a JMS Connection connection1 which is a connection to server 1
-         connection1 = cf0.createConnection();
-
-         // Step 6. We create a JMS Connection connection0 which is a connection to server 0
-         connection2 = cf0.createConnection();
-
-         // Step 7. We create a JMS Connection connection1 which is a connection to server 1
-         connection3 = cf0.createConnection();
-
-         // Step 8. We create a JMS Session on server 0
-         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 9. We create a JMS Session on server 1
-         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 8. We create a JMS Session on server 0
-         Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 9. We create a JMS Session on server 1
-         Session session3 = connection3.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 10. We start the connections to ensure delivery occurs on them
-         connection0.start();
-
-         connection1.start();
-
-         connection2.start();
-
-         connection3.start();
-
-         // Step 11. We create JMS MessageConsumer objects on server 0 and server 1
-         MessageConsumer consumer0 = session0.createConsumer(queue);
-
-         MessageConsumer consumer1 = session1.createConsumer(queue);
-
-         MessageConsumer consumer2 = session2.createConsumer(queue);
-
-         MessageConsumer consumer3 = session3.createConsumer(queue);
-
-         Thread.sleep(2000);
-
-         // Step 12. We create a JMS MessageProducer object on server 3
-         MessageProducer producer = session3.createProducer(queue);
-
-         // Step 13. We send some messages to server 0
-
-         final int numMessages = 20;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session0.createTextMessage("This is text message " + i);
-
-            producer.send(message);
-
-            System.out.println("Sent message: " + message.getText());
-         }
-         Thread.sleep(2000);
-         // Step 14. We now consume those messages on *both* server 0 and server 1.
-         // We note the messages have been distributed between servers in a round robin fashion
-         // JMS Queues implement point-to-point message where each message is only ever consumed by a
-         // maximum of one consumer
-         int con0Node = ServerUtil.getServer(connection0);
-         int con1Node = ServerUtil.getServer(connection1);
-         int con2Node = ServerUtil.getServer(connection2);
-         int con3Node = ServerUtil.getServer(connection3);
-
-         if (con0Node + con1Node + con2Node + con3Node != 6) {
-            throw new IllegalStateException();
-         }
-         for (int i = 0; i < numMessages; i += 4) {
-            TextMessage message0 = (TextMessage) consumer0.receive(5000);
-
-            System.out.println("Got message: " + message0.getText() + " from node " + con0Node);
-
-            TextMessage message1 = (TextMessage) consumer1.receive(5000);
-
-            System.out.println("Got message: " + message1.getText() + " from node " + con1Node);
-
-            TextMessage message2 = (TextMessage) consumer2.receive(5000);
-
-            System.out.println("Got message: " + message2.getText() + " from node " + con2Node);
-
-            TextMessage message3 = (TextMessage) consumer3.receive(5000);
-
-            System.out.println("Got message: " + message3.getText() + " from node " + con3Node);
-         }
-      }
-      finally {
-         // Step 15. Be sure to close our resources!
-
-         if (initialConnection != null) {
-            initialConnection.close();
-         }
-
-         if (connection0 != null) {
-            connection0.close();
-         }
-
-         if (connection1 != null) {
-            connection1.close();
-         }
-
-         if (connection2 != null) {
-            connection2.close();
-         }
-
-         if (connection3 != null) {
-            connection3.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index b1bfd11..0000000
--- a/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?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>
-         <!-- connector to the server1 -->
-         <connector name="server1-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <static-connectors>
-               <connector-ref>server1-connector</connector-ref>
-            </static-connectors>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 0412576..0000000
--- a/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?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:61617</connector>
-         <!-- connector to the server0 -->
-         <connector name="server0-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <static-connectors>
-               <connector-ref>server0-connector</connector-ref>
-            </static-connectors>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml b/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml
deleted file mode 100644
index 98b8f04..0000000
--- a/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml
+++ /dev/null
@@ -1,79 +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.
-  -->
-
-<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:61618</connector>
-         <!-- connector to the server0 -->
-         <connector name="server0-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <static-connectors>
-               <connector-ref>server0-connector</connector-ref>
-            </static-connectors>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml b/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml
deleted file mode 100644
index 40bef87..0000000
--- a/examples/broker-features/clustered/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml
+++ /dev/null
@@ -1,79 +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.
-  -->
-
-<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:61619</connector>
-         <!-- connector to the server0 -->
-         <connector name="server0-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61619</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <static-connectors>
-               <connector-ref>server0-connector</connector-ref>
-            </static-connectors>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-static-oneway/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-static-oneway/pom.xml b/examples/broker-features/clustered/clustered-static-oneway/pom.xml
deleted file mode 100644
index 18a303c..0000000
--- a/examples/broker-features/clustered/clustered-static-oneway/pom.xml
+++ /dev/null
@@ -1,198 +0,0 @@
-<?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.clustered</groupId>
-      <artifactId>broker-clustered</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>clustered-static-oneway</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Clustered Static One Way Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create2</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server2</instance>
-                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server0</location>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server1</location>
-                     <testURI>tcp://localhost:61617</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server1</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start2</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server2</location>
-                     <testURI>tcp://localhost:61618</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server2</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ClusterStaticOnewayExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server1</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop2</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server2</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.clustered</groupId>
-                  <artifactId>clustered-static-oneway</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-static-oneway/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-static-oneway/readme.html b/examples/broker-features/clustered/clustered-static-oneway/readme.html
deleted file mode 100644
index 04334a5..0000000
--- a/examples/broker-features/clustered/clustered-static-oneway/readme.html
+++ /dev/null
@@ -1,64 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Load Balanced Static Clustered 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 Load Balanced Static Clustered One Way 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 demonstrates a JMS queue deployed on three different nodes. The three nodes are configured to form a one way cluster
-       from a <em>static</em> list of nodes. </p>
-     <p>A one way cluster is different from a symmetrical cluster in that each node is only connected to one another node in
-     a chain type fashion, so server 0 -> server 1 -> server 2</p>
-     <p>We then create a consumer on the queue on each node, and we create a producer on only one of the nodes.</p>
-     <p>We then send some messages via the producer, and we verify that <b>all</b> consumers receive the sent messages
-     in a round-robin fashion.</p>
-     <p>In other words, ActiveMQ Artemis <b>load balances</b> the sent messages across all consumers on the cluster</p>
-     <p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
-     JNDI, these could be instantiated directly.</p>
-     <p>Here's the relevant snippet from the server configuration, which tells the server to form a one way cluster between the three nodes
-     and to load balance the messages between the nodes. Note that we have set <em>allow-direct-connections-only</em> to true,
-     this means that this server will only ever connect the address's specified in the list of connectors. ALso notice
-     that <em>max-hops</em> is 2, this is because server 0 is not directly connected to server 2, 2 hops in fact, so we
-     allow any updates from servers up to 2 hops away</p>
-     <pre class="prettyprint">
-     <code>
-     &lt;cluster-connection name="my-cluster"&gt;
-        &lt;address&gt;jms&lt;/address&gt;
-        &lt;connector-ref>netty-connector&lt;/connector-ref>
-        &lt;retry-interval&gt;500&lt;/retry-interval&gt;
-        &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
-        &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
-        &lt;max-hops&gt;2&lt;/max-hops&gt;
-        &lt;static-connectors allow-direct-connections-only="true"&gt;
-            &lt;connector-ref>server1-connector&lt;/connector-ref&gt;
-         &lt;/static-connectors&gt;
-     &lt;/cluster-connection&gt;
-     </code>
-     </pre>
-     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
-     section of the user manual.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java b/examples/broker-features/clustered/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java
deleted file mode 100644
index 0397907..0000000
--- a/examples/broker-features/clustered/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java
+++ /dev/null
@@ -1,159 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-import org.apache.activemq.artemis.util.ServerUtil;
-
-/**
- * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
- * nodes of the cluster. The cluster is created from a static list of nodes.
- */
-public class ClusterStaticOnewayExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection initialConnection = null;
-
-      Connection connection0 = null;
-
-      Connection connection1 = null;
-
-      Connection connection2 = null;
-
-      try {
-         // Step 2. Instantiate Queue
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
-
-         //step 4. grab an initial connection and wait, in reality you wouldn't do it this way but since we want to ensure an
-         // equal load balance we do this and then create 4 connections round robined
-         initialConnection = cf0.createConnection();
-
-         Thread.sleep(2000);
-         // Step 5. We create a JMS Connection connection0 which is a connection to server 0
-         connection0 = cf0.createConnection();
-
-         // Step 6. We create a JMS Connection connection1 which is a connection to server 1
-         connection1 = cf0.createConnection();
-
-         // Step 7. We create a JMS Connection connection0 which is a connection to server 2
-         connection2 = cf0.createConnection();
-
-         // Step 8. We create a JMS Session on server 0
-         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 9. We create a JMS Session on server 1
-         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 10. We create a JMS Session on server 2
-         Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 11. We start the connections to ensure delivery occurs on them
-         connection0.start();
-
-         connection1.start();
-
-         connection2.start();
-
-         // Step 12. We create JMS MessageConsumer objects on server 0,server 1 and server 2
-         MessageConsumer consumer0 = session0.createConsumer(queue);
-
-         MessageConsumer consumer1 = session1.createConsumer(queue);
-
-         MessageConsumer consumer2 = session2.createConsumer(queue);
-
-         Thread.sleep(4000);
-
-         int con0Node = ServerUtil.getServer(connection0);
-         int con1Node = ServerUtil.getServer(connection1);
-         int con2Node = ServerUtil.getServer(connection2);
-
-         System.out.println("con0Node = " + con0Node);
-         System.out.println("con1Node = " + con1Node);
-         System.out.println("con2Node = " + con2Node);
-
-         if (con0Node + con1Node + con2Node != 3) {
-            throw new IllegalStateException("connections not load balanced");
-         }
-         // Step 13. We create a JMS MessageProducer object on server 0
-         Session sendSession = ServerUtil.getServerConnection(0, connection0, connection1, connection2).createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         MessageProducer producer = sendSession.createProducer(queue);
-
-         // Step 14. We send some messages to server 0
-
-         final int numMessages = 18;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session0.createTextMessage("This is text message " + i);
-
-            producer.send(message);
-
-            System.out.println("Sent message: " + message.getText());
-         }
-         Thread.sleep(2000);
-         // Step 15. We now consume those messages on *both* server 0,server 1 and 2.
-         // We note the messages have been distributed between servers in a round robin fashion
-         // JMS Queues implement point-to-point message where each message is only ever consumed by a
-         // maximum of one consumer
-
-         for (int i = 0; i < numMessages; i += 3) {
-            TextMessage message0 = (TextMessage) consumer0.receive(5000);
-
-            System.out.println("Got message: " + message0.getText() + " from node " + con0Node);
-
-            TextMessage message1 = (TextMessage) consumer1.receive(5000);
-
-            System.out.println("Got message: " + message1.getText() + " from node " + con1Node);
-
-            TextMessage message2 = (TextMessage) consumer2.receive(5000);
-
-            System.out.println("Got message: " + message2.getText() + " from node " + con2Node);
-         }
-      }
-      finally {
-         // Step 15. Be sure to close our resources!
-
-         if (initialConnection != null) {
-            initialConnection.close();
-         }
-
-         if (connection0 != null) {
-            connection0.close();
-         }
-
-         if (connection1 != null) {
-            connection1.close();
-         }
-
-         if (connection2 != null) {
-            connection2.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/clustered/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 3e86ed3..0000000
--- a/examples/broker-features/clustered/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,79 +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.
-  -->
-
-<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>
-         <!-- connector to the server1 -->
-         <connector name="server1-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>2</max-hops>
-            <static-connectors allow-direct-connections-only="true">
-               <connector-ref>server1-connector</connector-ref>
-            </static-connectors>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/clustered/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 1464ea9..0000000
--- a/examples/broker-features/clustered/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,79 +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.
-  -->
-
-<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:61617</connector>
-         <!-- connector to the server0 -->
-         <connector name="server2-connector">tcp://localhost:61618</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>2</max-hops>
-            <static-connectors allow-direct-connections-only="true">
-               <connector-ref>server2-connector</connector-ref>
-            </static-connectors>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>


[48/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
renaming broker-features -> features on examples


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/6b17d966
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/6b17d966
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/6b17d966

Branch: refs/heads/master
Commit: 6b17d966cee6f9ecc918e123db937c2cb90f8543
Parents: 800cc46
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Aug 13 00:11:56 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Aug 13 00:11:56 2015 -0400

----------------------------------------------------------------------
 .../client-side-load-balancing/pom.xml          | 196 ---------
 .../client-side-load-balancing/readme.html      |  49 ---
 .../example/ClientSideLoadBalancingExample.java | 138 -------
 .../src/main/resources/jndi.properties          |  20 -
 .../clustered-durable-subscription/pom.xml      | 158 -------
 .../clustered-durable-subscription/readme.html  |  66 ---
 .../ClusteredDurableSubscriptionExample.java    | 130 ------
 .../main/resources/activemq/server0/broker.xml  |  96 -----
 .../main/resources/activemq/server1/broker.xml  |  96 -----
 .../clustered/clustered-grouping/pom.xml        | 194 ---------
 .../clustered/clustered-grouping/readme.html    |  81 ----
 .../jms/example/ClusteredGroupingExample.java   | 153 -------
 .../main/resources/activemq/server0/broker.xml  | 105 -----
 .../main/resources/activemq/server1/broker.xml  | 102 -----
 .../main/resources/activemq/server2/broker.xml  | 102 -----
 .../clustered/clustered-jgroups/pom.xml         | 161 --------
 .../clustered/clustered-jgroups/readme.html     |  67 ---
 .../jms/example/ClusteredJgroupsExample.java    | 140 -------
 .../main/resources/activemq/server0/broker.xml  |  97 -----
 .../activemq/server0/client-jndi.properties     |  19 -
 .../activemq/server0/test-jgroups-file_ping.xml |  73 ----
 .../main/resources/activemq/server1/broker.xml  |  96 -----
 .../activemq/server1/client-jndi.properties     |  19 -
 .../activemq/server1/test-jgroups-file_ping.xml |  73 ----
 .../clustered/clustered-queue/pom.xml           | 154 -------
 .../clustered/clustered-queue/readme.html       |  56 ---
 .../jms/example/ClusteredQueueExample.java      | 117 ------
 .../main/resources/activemq/server0/broker.xml  |  95 -----
 .../main/resources/activemq/server1/broker.xml  |  96 -----
 .../clustered-static-discovery/pom.xml          | 239 -----------
 .../clustered-static-discovery/readme.html      |  58 ---
 .../example/StaticClusteredQueueExample.java    | 173 --------
 .../main/resources/activemq/server0/broker.xml  |  82 ----
 .../main/resources/activemq/server1/broker.xml  |  82 ----
 .../main/resources/activemq/server2/broker.xml  |  79 ----
 .../main/resources/activemq/server3/broker.xml  |  79 ----
 .../clustered/clustered-static-oneway/pom.xml   | 198 ---------
 .../clustered-static-oneway/readme.html         |  64 ---
 .../jms/example/ClusterStaticOnewayExample.java | 159 -------
 .../main/resources/activemq/server0/broker.xml  |  79 ----
 .../main/resources/activemq/server1/broker.xml  |  79 ----
 .../main/resources/activemq/server2/broker.xml  |  74 ----
 .../clustered/clustered-topic/pom.xml           | 153 -------
 .../clustered/clustered-topic/readme.html       |  55 ---
 .../jms/example/ClusteredTopicExample.java      | 129 ------
 .../main/resources/activemq/server0/broker.xml  |  97 -----
 .../main/resources/activemq/server1/broker.xml  |  95 -----
 examples/broker-features/clustered/pom.xml      |  77 ----
 .../queue-message-redistribution/pom.xml        | 155 -------
 .../queue-message-redistribution/readme.html    |  61 ---
 .../QueueMessageRedistributionExample.java      | 145 -------
 .../main/resources/activemq/server0/broker.xml  | 106 -----
 .../main/resources/activemq/server1/broker.xml  | 107 -----
 .../clustered/symmetric-cluster/pom.xml         | 320 ---------------
 .../clustered/symmetric-cluster/readme.html     |  74 ----
 .../jms/example/SymmetricClusterExample.java    | 222 ----------
 .../main/resources/activemq/server0/broker.xml  |  99 -----
 .../main/resources/activemq/server1/broker.xml  |  97 -----
 .../main/resources/activemq/server2/broker.xml  |  97 -----
 .../main/resources/activemq/server3/broker.xml  |  97 -----
 .../main/resources/activemq/server4/broker.xml  |  96 -----
 .../main/resources/activemq/server5/broker.xml  |  96 -----
 .../ha/application-layer-failover/pom.xml       | 102 -----
 .../ha/application-layer-failover/readme.html   | 169 --------
 .../ApplicationLayerFailoverExample.java        | 221 ----------
 .../ha/client-side-failoverlistener/pom.xml     | 109 -----
 .../ha/client-side-failoverlistener/readme.html |  37 --
 .../ClientSideFailoverListerExample.java        | 129 ------
 .../src/main/resources/jndi.properties          |  20 -
 .../ha/colocated-failover-scale-down/pom.xml    | 103 -----
 .../colocated-failover-scale-down/readme.html   |  65 ---
 .../ColocatedFailoverScaleDownExample.java      | 140 -------
 .../main/resources/activemq/server0/broker.xml  | 129 ------
 .../main/resources/activemq/server1/broker.xml  | 127 ------
 .../ha/colocated-failover/pom.xml               | 102 -----
 .../ha/colocated-failover/readme.html           |  56 ---
 .../jms/example/ColocatedFailoverExample.java   | 147 -------
 .../main/resources/activemq/server0/broker.xml  | 115 ------
 .../main/resources/activemq/server1/broker.xml  | 114 ------
 .../ha/ha-policy-autobackup/pom.xml             | 103 -----
 .../jms/example/HAPolicyAutoBackupExample.java  | 155 -------
 .../main/resources/activemq/server0/broker.xml  | 108 -----
 .../main/resources/activemq/server1/broker.xml  | 108 -----
 .../ha/multiple-failover-failback/pom.xml       | 121 ------
 .../MultipleFailoverFailbackExample.java        | 142 -------
 .../src/main/resources/jndi.properties          |  20 -
 .../ha/multiple-failover/pom.xml                | 121 ------
 .../jms/example/MultipleFailoverExample.java    | 142 -------
 .../src/main/resources/jndi.properties          |  20 -
 .../ha/non-transaction-failover/pom.xml         | 109 -----
 .../ha/non-transaction-failover/readme.html     | 157 -------
 .../example/NonTransactionFailoverExample.java  | 128 ------
 .../src/main/resources/jndi.properties          |  20 -
 examples/broker-features/ha/pom.xml             |  95 -----
 .../ha/replicated-failback-static/pom.xml       | 104 -----
 .../ha/replicated-failback-static/readme.html   |  38 --
 .../ReplicatedFailbackStaticExample.java        | 149 -------
 .../main/resources/activemq/server0/broker.xml  |  87 ----
 .../main/resources/activemq/server1/broker.xml  |  89 ----
 .../src/main/resources/jndi.properties          |  20 -
 .../ha/replicated-failback/pom.xml              | 103 -----
 .../ha/replicated-failback/readme.html          |  38 --
 .../jms/example/ReplicatedFailbackExample.java  | 149 -------
 .../main/resources/activemq/server0/broker.xml  | 101 -----
 .../main/resources/activemq/server1/broker.xml  | 102 -----
 .../src/main/resources/jndi.properties          |  20 -
 .../ha/replicated-multiple-failover/pom.xml     | 118 ------
 .../ha/replicated-multiple-failover/readme.html |  45 --
 .../ReplicatedMultipleFailoverExample.java      | 149 -------
 .../main/resources/activemq/server0/broker.xml  |  95 -----
 .../main/resources/activemq/server1/broker.xml  |  95 -----
 .../main/resources/activemq/server2/broker.xml  |  95 -----
 .../src/main/resources/jndi.properties          |  20 -
 .../ha/replicated-transaction-failover/pom.xml  | 104 -----
 .../replicated-transaction-failover/readme.html | 148 -------
 .../ReplicatedTransactionFailoverExample.java   | 168 --------
 .../main/resources/activemq/server0/broker.xml  |  96 -----
 .../main/resources/activemq/server1/broker.xml  |  97 -----
 .../src/main/resources/jndi.properties          |  20 -
 examples/broker-features/ha/scale-down/pom.xml  | 105 -----
 .../broker-features/ha/scale-down/readme.html   |  51 ---
 .../artemis/jms/example/ScaleDownExample.java   | 132 ------
 .../main/resources/activemq/server0/broker.xml  | 117 ------
 .../main/resources/activemq/server1/broker.xml  | 108 -----
 .../ha/stop-server-failover/pom.xml             | 160 --------
 .../ha/stop-server-failover/readme.html         |  44 --
 .../jms/example/StopServerFailoverExample.java  | 117 ------
 .../src/main/resources/jndi.properties          |  20 -
 .../ha/transaction-failover/pom.xml             | 104 -----
 .../ha/transaction-failover/readme.html         |  46 ---
 .../jms/example/TransactionFailoverExample.java | 167 --------
 .../main/resources/activemq/server0/broker.xml  |  98 -----
 .../main/resources/activemq/server1/broker.xml  |  98 -----
 .../src/main/resources/jndi.properties          |  20 -
 examples/broker-features/perf/perf/pom.xml      | 156 -------
 examples/broker-features/perf/perf/readme.html  |  39 --
 .../activemq/artemis/jms/example/PerfBase.java  | 409 -------------------
 .../artemis/jms/example/PerfListener.java       |  46 ---
 .../artemis/jms/example/PerfParams.java         | 158 -------
 .../artemis/jms/example/PerfSender.java         |  46 ---
 .../activemq/artemis/jms/example/Server.java    |  27 --
 .../main/resources/activemq/server0/broker.xml  |  46 ---
 .../perf/src/main/resources/jndi.properties     |  20 -
 .../perf/src/main/resources/perf.properties     |  30 --
 examples/broker-features/perf/pom.xml           |  50 ---
 examples/broker-features/perf/soak/README       |  85 ----
 examples/broker-features/perf/soak/pom.xml      | 162 --------
 .../perf/soak/server0/broker.xml                |  49 ---
 .../broker-features/perf/soak/soak.properties   |  30 --
 .../artemis/jms/soak/example/SoakBase.java      | 116 ------
 .../artemis/jms/soak/example/SoakParams.java    | 158 -------
 .../artemis/jms/soak/example/SoakReceiver.java  | 190 ---------
 .../artemis/jms/soak/example/SoakSender.java    | 195 ---------
 .../soak/src/main/resources/jndi.properties     |  20 -
 examples/broker-features/pom.xml                |  68 ---
 examples/broker-features/standard/README.md     |  32 --
 .../broker-features/standard/bridge/pom.xml     | 167 --------
 .../broker-features/standard/bridge/readme.html |  74 ----
 .../artemis/jms/example/BridgeExample.java      | 175 --------
 .../jms/example/HatColourChangeTransformer.java |  38 --
 .../main/resources/activemq/server0/broker.xml  |  88 ----
 .../main/resources/activemq/server1/broker.xml  |  59 ---
 .../broker-features/standard/browser/pom.xml    | 110 -----
 .../standard/browser/readme.html                |  40 --
 .../jms/example/QueueBrowserExample.java        | 103 -----
 .../browser/src/main/resources/jndi.properties  |  20 -
 .../standard/client-kickoff/pom.xml             | 112 -----
 .../standard/client-kickoff/readme.html         |  54 ---
 .../jms/example/ClientKickoffExample.java       | 106 -----
 .../main/resources/activemq/server0/broker.xml  |  47 ---
 .../src/main/resources/jndi.properties          |  19 -
 .../standard/consumer-rate-limit/pom.xml        | 109 -----
 .../standard/consumer-rate-limit/readme.html    |  47 ---
 .../jms/example/ConsumerRateLimitExample.java   | 115 ------
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/dead-letter/pom.xml                | 110 -----
 .../standard/dead-letter/readme.html            |  66 ---
 .../artemis/jms/example/DeadLetterExample.java  | 136 ------
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  71 ----
 .../src/main/resources/jndi.properties          |  21 -
 .../standard/delayed-redelivery/pom.xml         | 110 -----
 .../standard/delayed-redelivery/readme.html     |  56 ---
 .../jms/example/DelayedRedeliveryExample.java   | 126 ------
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  70 ----
 .../src/main/resources/jndi.properties          |  20 -
 .../broker-features/standard/divert/pom.xml     | 159 -------
 .../broker-features/standard/divert/readme.html | 119 ------
 .../example/AddForwardingTimeTransformer.java   |  31 --
 .../artemis/jms/example/DivertExample.java      | 212 ----------
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  | 121 ------
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |  64 ---
 .../standard/durable-subscription/pom.xml       | 110 -----
 .../standard/durable-subscription/readme.html   |  39 --
 .../jms/example/DurableSubscriptionExample.java | 116 ------
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  61 ---
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/embedded-simple/pom.xml            |  84 ----
 .../standard/embedded-simple/readme.html        |  96 -----
 .../artemis/jms/example/EmbeddedExample.java    |  86 ----
 .../src/main/resources/broker.xml               |  52 ---
 .../broker-features/standard/embedded/pom.xml   |  84 ----
 .../standard/embedded/readme.html               |  38 --
 .../artemis/jms/example/EmbeddedExample.java    | 107 -----
 .../broker-features/standard/expiry/pom.xml     | 110 -----
 .../broker-features/standard/expiry/readme.html |  61 ---
 .../artemis/jms/example/ExpiryExample.java      | 120 ------
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  70 ----
 .../expiry/src/main/resources/jndi.properties   |  21 -
 .../standard/http-transport/pom.xml             | 110 -----
 .../standard/http-transport/readme.html         |  52 ---
 .../jms/example/HttpTransportExample.java       |  81 ----
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  61 ---
 .../instantiate-connection-factory/pom.xml      | 111 -----
 .../instantiate-connection-factory/readme.html  |  49 ---
 .../InstantiateConnectionFactoryExample.java    |  81 ----
 .../standard/interceptor/pom.xml                | 111 -----
 .../standard/interceptor/readme.html            |  72 ----
 .../artemis/jms/example/InterceptorExample.java |  88 ----
 .../artemis/jms/example/SimpleInterceptor.java  |  48 ---
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  65 ---
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/jms-auto-closeable/pom.xml         | 106 -----
 .../standard/jms-auto-closeable/readme.html     |  96 -----
 .../jms/example/JMSAutoCloseableExample.java    |  51 ---
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/jms-bridge/jms-bridge.png          | Bin 93885 -> 0 bytes
 .../broker-features/standard/jms-bridge/pom.xml | 159 -------
 .../standard/jms-bridge/readme.html             | 246 -----------
 .../artemis/jms/example/JMSBridgeExample.java   | 136 ------
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  53 ---
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |  53 ---
 .../standard/jms-completion-listener/pom.xml    | 110 -----
 .../jms-completion-listener/readme.html         | 112 -----
 .../example/JMSCompletionListenerExample.java   |  82 ----
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/jms-context/pom.xml                | 109 -----
 .../standard/jms-context/readme.html            |  35 --
 .../artemis/jms/example/JMSContextExample.java  |  51 ---
 .../standard/jms-shared-consumer/pom.xml        | 111 -----
 .../standard/jms-shared-consumer/readme.html    | 119 ------
 .../jms/example/JMSSharedConsumerExample.java   |  87 ----
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  61 ---
 .../src/main/resources/jndi.properties          |  20 -
 examples/broker-features/standard/jmx/pom.xml   | 117 ------
 .../broker-features/standard/jmx/readme.html    | 181 --------
 .../artemis/jms/example/JMXExample.java         | 121 ------
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  64 ---
 .../jmx/src/main/resources/jndi.properties      |  20 -
 .../standard/large-message/pom.xml              |  88 ----
 .../standard/large-message/readme.html          | 200 ---------
 .../jms/example/LargeMessageExample.java        | 193 ---------
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/last-value-queue/pom.xml           | 109 -----
 .../standard/last-value-queue/readme.html       | 162 --------
 .../jms/example/LastValueQueueExample.java      | 104 -----
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  67 ---
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/management-notifications/pom.xml   | 109 -----
 .../management-notifications/readme.html        | 215 ----------
 .../example/ManagementNotificationExample.java  | 109 -----
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  81 ----
 .../src/main/resources/jndi.properties          |  21 -
 .../broker-features/standard/management/pom.xml | 109 -----
 .../standard/management/readme.html             | 208 ----------
 .../artemis/jms/example/ManagementExample.java  | 133 ------
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  76 ----
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/message-counters/pom.xml           | 116 ------
 .../standard/message-counters/readme.html       | 197 ---------
 .../jms/example/MessageCounterExample.java      | 134 ------
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  86 ----
 .../src/main/resources/jndi.properties          |  21 -
 .../standard/message-group/pom.xml              | 109 -----
 .../standard/message-group/readme.html          | 152 -------
 .../jms/example/MessageGroupExample.java        | 122 ------
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/message-group2/pom.xml             | 109 -----
 .../standard/message-group2/readme.html         | 161 --------
 .../jms/example/MessageGroup2Example.java       | 129 ------
 .../standard/message-priority/pom.xml           | 109 -----
 .../standard/message-priority/readme.html       | 159 -------
 .../jms/example/MessagePriorityExample.java     | 134 ------
 .../standard/no-consumer-buffering/pom.xml      | 108 -----
 .../standard/no-consumer-buffering/readme.html  | 205 ----------
 .../jms/example/NoConsumerBufferingExample.java | 110 -----
 .../src/main/resources/jndi.properties          |  20 -
 .../broker-features/standard/paging/pom.xml     | 109 -----
 .../broker-features/standard/paging/readme.html | 187 ---------
 .../artemis/jms/example/PagingExample.java      | 135 ------
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  93 -----
 .../paging/src/main/resources/jndi.properties   |  21 -
 examples/broker-features/standard/pom.xml       | 171 --------
 .../standard/pre-acknowledge/pom.xml            | 109 -----
 .../standard/pre-acknowledge/readme.html        | 154 -------
 .../jms/example/PreacknowledgeExample.java      | 126 ------
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  63 ---
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/producer-rate-limit/pom.xml        | 109 -----
 .../standard/producer-rate-limit/readme.html    | 176 --------
 .../jms/example/ProducerRateLimitExample.java   | 106 -----
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/queue-requestor/pom.xml            | 104 -----
 .../standard/queue-requestor/readme.html        |  46 ---
 .../jms/example/QueueRequestorExample.java      |  96 -----
 .../jms/example/TextReverserService.java        | 113 -----
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  67 ---
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/queue-selector/pom.xml             | 109 -----
 .../standard/queue-selector/readme.html         |  52 ---
 .../jms/example/QueueSelectorExample.java       | 143 -------
 .../src/main/resources/jndi.properties          |  20 -
 examples/broker-features/standard/queue/pom.xml | 109 -----
 .../broker-features/standard/queue/readme.html  |  38 --
 .../artemis/jms/example/QueueExample.java       |  84 ----
 .../queue/src/main/resources/jndi.properties    |  20 -
 .../standard/reattach-node/pom.xml              | 111 -----
 .../standard/reattach-node/readme.html          |  55 ---
 .../artemis/jms/example/ReattachExample.java    | 150 -------
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  82 ----
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/request-reply/pom.xml              | 112 -----
 .../standard/request-reply/readme.html          | 180 --------
 .../jms/example/RequestReplyExample.java        | 202 ---------
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/rest/dup-send/README.txt           |  41 --
 .../standard/rest/dup-send/pom.xml              | 170 --------
 .../rest/dup-send/src/main/java/Order.java      |  69 ----
 .../rest/dup-send/src/main/java/PostOrder.java  |  69 ----
 .../dup-send/src/main/java/PostOrderWithId.java |  45 --
 .../dup-send/src/main/java/ReceiveOrder.java    |  51 ---
 .../src/main/resources/activemq-client.xml      |  36 --
 .../src/main/resources/activemq-rest.xml        |  23 --
 .../src/main/resources/artemis-roles.properties |  17 -
 .../src/main/resources/artemis-users.properties |  17 -
 .../rest/dup-send/src/main/resources/broker.xml |  59 ---
 .../dup-send/src/main/webapp/WEB-INF/web.xml    |  55 ---
 .../standard/rest/javascript-chat/README.txt    |  16 -
 .../standard/rest/javascript-chat/pom.xml       | 184 ---------
 .../src/main/resources/artemis-roles.properties |  17 -
 .../src/main/resources/artemis-users.properties |  17 -
 .../src/main/resources/broker.xml               |  58 ---
 .../src/main/webapp/WEB-INF/web.xml             |  51 ---
 .../javascript-chat/src/main/webapp/index.html  | 189 ---------
 .../messaging/test/AutoAckTopicTest.java        |  88 ----
 .../standard/rest/jms-to-rest/README.txt        |  49 ---
 .../standard/rest/jms-to-rest/pom.xml           | 170 --------
 .../standard/rest/jms-to-rest/postOrder.py      |  44 --
 .../standard/rest/jms-to-rest/receiveOrder.py   |  68 ---
 .../jms-to-rest/src/main/java/JmsHelper.java    |  38 --
 .../jms-to-rest/src/main/java/JmsReceive.java   |  55 ---
 .../rest/jms-to-rest/src/main/java/JmsSend.java |  47 ---
 .../rest/jms-to-rest/src/main/java/Order.java   |  69 ----
 .../jms-to-rest/src/main/java/RestReceive.java  |  52 ---
 .../jms-to-rest/src/main/java/RestSend.java     |  40 --
 .../src/main/resources/activemq-client.xml      |  36 --
 .../src/main/resources/artemis-roles.properties |  17 -
 .../src/main/resources/artemis-users.properties |  17 -
 .../jms-to-rest/src/main/resources/broker.xml   |  59 ---
 .../jms-to-rest/src/main/webapp/WEB-INF/web.xml |  51 ---
 examples/broker-features/standard/rest/pom.xml  |  45 --
 .../standard/rest/push/README.txt               |  32 --
 .../broker-features/standard/rest/push/pom.xml  | 176 --------
 .../rest/push/src/main/java/JmsHelper.java      |  37 --
 .../standard/rest/push/src/main/java/Order.java |  69 ----
 .../rest/push/src/main/java/PostOrder.java      |  47 ---
 .../rest/push/src/main/java/PushReg.java        |  52 ---
 .../push/src/main/java/ReceiveShipping.java     |  54 ---
 .../push/src/main/resources/activemq-client.xml |  36 --
 .../src/main/resources/artemis-roles.properties |  17 -
 .../src/main/resources/artemis-users.properties |  17 -
 .../rest/push/src/main/resources/broker.xml     |  60 ---
 .../src/main/resources/test-realm.properties    |  18 -
 .../rest/push/src/main/webapp/WEB-INF/web.xml   |  70 ----
 .../standard/scheduled-message/pom.xml          | 114 ------
 .../standard/scheduled-message/readme.html      | 134 ------
 .../jms/example/ScheduledMessageExample.java    |  94 -----
 .../src/main/resources/jndi.properties          |  20 -
 .../broker-features/standard/security/pom.xml   | 111 -----
 .../standard/security/readme.html               | 326 ---------------
 .../artemis/jms/example/SecurityExample.java    | 282 -------------
 .../activemq/server0/artemis-roles.properties   |  20 -
 .../activemq/server0/artemis-users.properties   |  20 -
 .../main/resources/activemq/server0/broker.xml  |  81 ----
 .../security/src/main/resources/jndi.properties |  22 -
 .../standard/send-acknowledgements/pom.xml      | 104 -----
 .../standard/send-acknowledgements/readme.html  | 140 -------
 .../example/SendAcknowledgementsExample.java    | 104 -----
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/spring-integration/pom.xml         |  82 ----
 .../standard/spring-integration/readme.html     |  36 --
 .../artemis/jms/example/ExampleListener.java    |  37 --
 .../artemis/jms/example/MessageSender.java      |  71 ----
 .../artemis/jms/example/SpringExample.java      |  32 --
 .../src/main/resources/artemis-roles.properties |  17 -
 .../src/main/resources/artemis-users.properties |  17 -
 .../src/main/resources/broker.xml               |  53 ---
 .../src/main/resources/spring-jms-beans.xml     |  80 ----
 .../standard/ssl-enabled/pom.xml                | 109 -----
 .../standard/ssl-enabled/readme.html            |  56 ---
 .../artemis/jms/example/SSLExample.java         |  86 ----
 .../activemq/server0/activemq.example.keystore  | Bin 1273 -> 0 bytes
 .../server0/activemq.example.truststore         | Bin 866 -> 0 bytes
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ---
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/static-selector/pom.xml            | 109 -----
 .../standard/static-selector/readme.html        |  60 ---
 .../jms/example/StaticSelectorExample.java      | 137 -------
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  67 ---
 .../src/main/resources/jndi.properties          |  20 -
 .../broker-features/standard/temp-queue/pom.xml | 109 -----
 .../standard/temp-queue/readme.html             |  40 --
 .../jms/example/TemporaryQueueExample.java      | 118 ------
 .../main/resources/activemq/server0/broker.xml  |  65 ---
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/topic-hierarchies/pom.xml          | 109 -----
 .../standard/topic-hierarchies/readme.html      |  42 --
 .../jms/example/TopicHierarchyExample.java      | 121 ------
 .../main/resources/activemq/server0/broker.xml  |  71 ----
 .../src/main/resources/jndi.properties          |  19 -
 .../standard/topic-selector-example1/pom.xml    | 109 -----
 .../topic-selector-example1/readme.html         |  38 --
 .../jms/example/TopicSelectorExample1.java      | 145 -------
 .../main/resources/activemq/server0/broker.xml  |  60 ---
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/topic-selector-example2/pom.xml    | 109 -----
 .../topic-selector-example2/readme.html         |  47 ---
 .../jms/example/TopicSelectorExample2.java      | 145 -------
 .../main/resources/activemq/server0/broker.xml  |  60 ---
 .../src/main/resources/jndi.properties          |  20 -
 examples/broker-features/standard/topic/pom.xml | 108 -----
 .../broker-features/standard/topic/readme.html  |  36 --
 .../artemis/jms/example/TopicExample.java       |  94 -----
 .../main/resources/activemq/server0/broker.xml  |  59 ---
 .../topic/src/main/resources/jndi.properties    |  20 -
 .../standard/transactional/pom.xml              | 109 -----
 .../standard/transactional/readme.html          |  40 --
 .../jms/example/TransactionalExample.java       | 126 ------
 .../src/main/resources/jndi.properties          |  20 -
 .../standard/xa-heuristic/pom.xml               | 111 -----
 .../standard/xa-heuristic/readme.html           |  48 ---
 .../activemq/artemis/jms/example/DummyXid.java  | 184 ---------
 .../artemis/jms/example/XAHeuristicExample.java | 219 ----------
 .../src/main/resources/jndi.properties          |  21 -
 .../broker-features/standard/xa-receive/pom.xml | 109 -----
 .../standard/xa-receive/readme.html             |  48 ---
 .../activemq/artemis/jms/example/DummyXid.java  | 184 ---------
 .../artemis/jms/example/XAReceiveExample.java   | 145 -------
 .../src/main/resources/jndi.properties          |  21 -
 .../broker-features/standard/xa-send/pom.xml    | 109 -----
 .../standard/xa-send/readme.html                | 215 ----------
 .../activemq/artemis/jms/example/DummyXid.java  | 184 ---------
 .../artemis/jms/example/XASendExample.java      | 191 ---------
 .../xa-send/src/main/resources/jndi.properties  |  21 -
 .../sub-modules/aerogear/pom.xml                | 125 ------
 .../sub-modules/aerogear/readme.html            | 157 -------
 .../artemis/jms/example/AerogearExample.java    |  77 ----
 .../main/resources/activemq/server0/broker.xml  |  77 ----
 .../aerogear/src/main/resources/jndi.properties |  20 -
 .../sub-modules/artemis-ra-rar/pom.xml          | 101 -----
 .../artemis-ra-rar/src/main/resources/ra.xml    | 308 --------------
 examples/broker-features/sub-modules/pom.xml    |  58 ---
 .../broker-features/sub-modules/vertx/pom.xml   | 145 -------
 .../sub-modules/vertx/readme.html               | 103 -----
 .../artemis/core/example/ExampleVerticle.java   |  54 ---
 .../core/example/VertxConnectorExample.java     | 105 -----
 .../main/resources/activemq/server0/broker.xml  |  81 ----
 .../client-side-load-balancing/pom.xml          | 196 +++++++++
 .../client-side-load-balancing/readme.html      |  49 +++
 .../example/ClientSideLoadBalancingExample.java | 138 +++++++
 .../src/main/resources/jndi.properties          |  20 +
 .../clustered-durable-subscription/pom.xml      | 158 +++++++
 .../clustered-durable-subscription/readme.html  |  66 +++
 .../ClusteredDurableSubscriptionExample.java    | 130 ++++++
 .../main/resources/activemq/server0/broker.xml  |  96 +++++
 .../main/resources/activemq/server1/broker.xml  |  96 +++++
 .../clustered/clustered-grouping/pom.xml        | 194 +++++++++
 .../clustered/clustered-grouping/readme.html    |  81 ++++
 .../jms/example/ClusteredGroupingExample.java   | 153 +++++++
 .../main/resources/activemq/server0/broker.xml  | 105 +++++
 .../main/resources/activemq/server1/broker.xml  | 102 +++++
 .../main/resources/activemq/server2/broker.xml  | 102 +++++
 .../clustered/clustered-jgroups/pom.xml         | 161 ++++++++
 .../clustered/clustered-jgroups/readme.html     |  67 +++
 .../jms/example/ClusteredJgroupsExample.java    | 140 +++++++
 .../main/resources/activemq/server0/broker.xml  |  97 +++++
 .../activemq/server0/client-jndi.properties     |  19 +
 .../activemq/server0/test-jgroups-file_ping.xml |  73 ++++
 .../main/resources/activemq/server1/broker.xml  |  96 +++++
 .../activemq/server1/client-jndi.properties     |  19 +
 .../activemq/server1/test-jgroups-file_ping.xml |  73 ++++
 .../features/clustered/clustered-queue/pom.xml  | 154 +++++++
 .../clustered/clustered-queue/readme.html       |  56 +++
 .../jms/example/ClusteredQueueExample.java      | 117 ++++++
 .../main/resources/activemq/server0/broker.xml  |  95 +++++
 .../main/resources/activemq/server1/broker.xml  |  96 +++++
 .../clustered-static-discovery/pom.xml          | 239 +++++++++++
 .../clustered-static-discovery/readme.html      |  58 +++
 .../example/StaticClusteredQueueExample.java    | 173 ++++++++
 .../main/resources/activemq/server0/broker.xml  |  82 ++++
 .../main/resources/activemq/server1/broker.xml  |  82 ++++
 .../main/resources/activemq/server2/broker.xml  |  79 ++++
 .../main/resources/activemq/server3/broker.xml  |  79 ++++
 .../clustered/clustered-static-oneway/pom.xml   | 198 +++++++++
 .../clustered-static-oneway/readme.html         |  64 +++
 .../jms/example/ClusterStaticOnewayExample.java | 159 +++++++
 .../main/resources/activemq/server0/broker.xml  |  79 ++++
 .../main/resources/activemq/server1/broker.xml  |  79 ++++
 .../main/resources/activemq/server2/broker.xml  |  74 ++++
 .../features/clustered/clustered-topic/pom.xml  | 153 +++++++
 .../clustered/clustered-topic/readme.html       |  55 +++
 .../jms/example/ClusteredTopicExample.java      | 129 ++++++
 .../main/resources/activemq/server0/broker.xml  |  97 +++++
 .../main/resources/activemq/server1/broker.xml  |  95 +++++
 examples/features/clustered/pom.xml             |  77 ++++
 .../queue-message-redistribution/pom.xml        | 155 +++++++
 .../queue-message-redistribution/readme.html    |  61 +++
 .../QueueMessageRedistributionExample.java      | 145 +++++++
 .../main/resources/activemq/server0/broker.xml  | 106 +++++
 .../main/resources/activemq/server1/broker.xml  | 107 +++++
 .../clustered/symmetric-cluster/pom.xml         | 320 +++++++++++++++
 .../clustered/symmetric-cluster/readme.html     |  74 ++++
 .../jms/example/SymmetricClusterExample.java    | 222 ++++++++++
 .../main/resources/activemq/server0/broker.xml  |  99 +++++
 .../main/resources/activemq/server1/broker.xml  |  97 +++++
 .../main/resources/activemq/server2/broker.xml  |  97 +++++
 .../main/resources/activemq/server3/broker.xml  |  97 +++++
 .../main/resources/activemq/server4/broker.xml  |  96 +++++
 .../main/resources/activemq/server5/broker.xml  |  96 +++++
 .../ha/application-layer-failover/pom.xml       | 102 +++++
 .../ha/application-layer-failover/readme.html   | 169 ++++++++
 .../ApplicationLayerFailoverExample.java        | 221 ++++++++++
 .../ha/client-side-failoverlistener/pom.xml     | 109 +++++
 .../ha/client-side-failoverlistener/readme.html |  37 ++
 .../ClientSideFailoverListerExample.java        | 129 ++++++
 .../src/main/resources/jndi.properties          |  20 +
 .../ha/colocated-failover-scale-down/pom.xml    | 103 +++++
 .../colocated-failover-scale-down/readme.html   |  65 +++
 .../ColocatedFailoverScaleDownExample.java      | 140 +++++++
 .../main/resources/activemq/server0/broker.xml  | 129 ++++++
 .../main/resources/activemq/server1/broker.xml  | 127 ++++++
 examples/features/ha/colocated-failover/pom.xml | 102 +++++
 .../features/ha/colocated-failover/readme.html  |  56 +++
 .../jms/example/ColocatedFailoverExample.java   | 147 +++++++
 .../main/resources/activemq/server0/broker.xml  | 115 ++++++
 .../main/resources/activemq/server1/broker.xml  | 114 ++++++
 .../features/ha/ha-policy-autobackup/pom.xml    | 103 +++++
 .../jms/example/HAPolicyAutoBackupExample.java  | 155 +++++++
 .../main/resources/activemq/server0/broker.xml  | 108 +++++
 .../main/resources/activemq/server1/broker.xml  | 108 +++++
 .../ha/multiple-failover-failback/pom.xml       | 121 ++++++
 .../MultipleFailoverFailbackExample.java        | 142 +++++++
 .../src/main/resources/jndi.properties          |  20 +
 examples/features/ha/multiple-failover/pom.xml  | 121 ++++++
 .../jms/example/MultipleFailoverExample.java    | 142 +++++++
 .../src/main/resources/jndi.properties          |  20 +
 .../ha/non-transaction-failover/pom.xml         | 109 +++++
 .../ha/non-transaction-failover/readme.html     | 157 +++++++
 .../example/NonTransactionFailoverExample.java  | 128 ++++++
 .../src/main/resources/jndi.properties          |  20 +
 examples/features/ha/pom.xml                    |  95 +++++
 .../ha/replicated-failback-static/pom.xml       | 104 +++++
 .../ha/replicated-failback-static/readme.html   |  38 ++
 .../ReplicatedFailbackStaticExample.java        | 149 +++++++
 .../main/resources/activemq/server0/broker.xml  |  87 ++++
 .../main/resources/activemq/server1/broker.xml  |  89 ++++
 .../src/main/resources/jndi.properties          |  20 +
 .../features/ha/replicated-failback/pom.xml     | 103 +++++
 .../features/ha/replicated-failback/readme.html |  38 ++
 .../jms/example/ReplicatedFailbackExample.java  | 149 +++++++
 .../main/resources/activemq/server0/broker.xml  | 101 +++++
 .../main/resources/activemq/server1/broker.xml  | 102 +++++
 .../src/main/resources/jndi.properties          |  20 +
 .../ha/replicated-multiple-failover/pom.xml     | 118 ++++++
 .../ha/replicated-multiple-failover/readme.html |  45 ++
 .../ReplicatedMultipleFailoverExample.java      | 149 +++++++
 .../main/resources/activemq/server0/broker.xml  |  95 +++++
 .../main/resources/activemq/server1/broker.xml  |  95 +++++
 .../main/resources/activemq/server2/broker.xml  |  95 +++++
 .../src/main/resources/jndi.properties          |  20 +
 .../ha/replicated-transaction-failover/pom.xml  | 104 +++++
 .../replicated-transaction-failover/readme.html | 148 +++++++
 .../ReplicatedTransactionFailoverExample.java   | 168 ++++++++
 .../main/resources/activemq/server0/broker.xml  |  96 +++++
 .../main/resources/activemq/server1/broker.xml  |  97 +++++
 .../src/main/resources/jndi.properties          |  20 +
 examples/features/ha/scale-down/pom.xml         | 105 +++++
 examples/features/ha/scale-down/readme.html     |  51 +++
 .../artemis/jms/example/ScaleDownExample.java   | 132 ++++++
 .../main/resources/activemq/server0/broker.xml  | 117 ++++++
 .../main/resources/activemq/server1/broker.xml  | 108 +++++
 .../features/ha/stop-server-failover/pom.xml    | 160 ++++++++
 .../ha/stop-server-failover/readme.html         |  44 ++
 .../jms/example/StopServerFailoverExample.java  | 117 ++++++
 .../src/main/resources/jndi.properties          |  20 +
 .../features/ha/transaction-failover/pom.xml    | 104 +++++
 .../ha/transaction-failover/readme.html         |  46 +++
 .../jms/example/TransactionFailoverExample.java | 167 ++++++++
 .../main/resources/activemq/server0/broker.xml  |  98 +++++
 .../main/resources/activemq/server1/broker.xml  |  98 +++++
 .../src/main/resources/jndi.properties          |  20 +
 examples/features/perf/perf/pom.xml             | 156 +++++++
 examples/features/perf/perf/readme.html         |  39 ++
 .../activemq/artemis/jms/example/PerfBase.java  | 409 +++++++++++++++++++
 .../artemis/jms/example/PerfListener.java       |  46 +++
 .../artemis/jms/example/PerfParams.java         | 158 +++++++
 .../artemis/jms/example/PerfSender.java         |  46 +++
 .../activemq/artemis/jms/example/Server.java    |  27 ++
 .../main/resources/activemq/server0/broker.xml  |  46 +++
 .../perf/src/main/resources/jndi.properties     |  20 +
 .../perf/src/main/resources/perf.properties     |  30 ++
 examples/features/perf/pom.xml                  |  50 +++
 examples/features/perf/soak/README              |  85 ++++
 examples/features/perf/soak/pom.xml             | 162 ++++++++
 examples/features/perf/soak/server0/broker.xml  |  49 +++
 examples/features/perf/soak/soak.properties     |  30 ++
 .../artemis/jms/soak/example/SoakBase.java      | 116 ++++++
 .../artemis/jms/soak/example/SoakParams.java    | 158 +++++++
 .../artemis/jms/soak/example/SoakReceiver.java  | 190 +++++++++
 .../artemis/jms/soak/example/SoakSender.java    | 195 +++++++++
 .../soak/src/main/resources/jndi.properties     |  20 +
 examples/features/pom.xml                       |  68 +++
 examples/features/standard/README.md            |  32 ++
 examples/features/standard/bridge/pom.xml       | 167 ++++++++
 examples/features/standard/bridge/readme.html   |  74 ++++
 .../artemis/jms/example/BridgeExample.java      | 175 ++++++++
 .../jms/example/HatColourChangeTransformer.java |  38 ++
 .../main/resources/activemq/server0/broker.xml  |  88 ++++
 .../main/resources/activemq/server1/broker.xml  |  59 +++
 examples/features/standard/browser/pom.xml      | 110 +++++
 examples/features/standard/browser/readme.html  |  40 ++
 .../jms/example/QueueBrowserExample.java        | 103 +++++
 .../browser/src/main/resources/jndi.properties  |  20 +
 .../features/standard/client-kickoff/pom.xml    | 112 +++++
 .../standard/client-kickoff/readme.html         |  54 +++
 .../jms/example/ClientKickoffExample.java       | 106 +++++
 .../main/resources/activemq/server0/broker.xml  |  47 +++
 .../src/main/resources/jndi.properties          |  19 +
 .../standard/consumer-rate-limit/pom.xml        | 109 +++++
 .../standard/consumer-rate-limit/readme.html    |  47 +++
 .../jms/example/ConsumerRateLimitExample.java   | 115 ++++++
 .../src/main/resources/jndi.properties          |  20 +
 examples/features/standard/dead-letter/pom.xml  | 110 +++++
 .../features/standard/dead-letter/readme.html   |  66 +++
 .../artemis/jms/example/DeadLetterExample.java  | 136 ++++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  71 ++++
 .../src/main/resources/jndi.properties          |  21 +
 .../standard/delayed-redelivery/pom.xml         | 110 +++++
 .../standard/delayed-redelivery/readme.html     |  56 +++
 .../jms/example/DelayedRedeliveryExample.java   | 126 ++++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  70 ++++
 .../src/main/resources/jndi.properties          |  20 +
 examples/features/standard/divert/pom.xml       | 159 +++++++
 examples/features/standard/divert/readme.html   | 119 ++++++
 .../example/AddForwardingTimeTransformer.java   |  31 ++
 .../artemis/jms/example/DivertExample.java      | 212 ++++++++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  | 121 ++++++
 .../activemq/server1/artemis-roles.properties   |  17 +
 .../activemq/server1/artemis-users.properties   |  17 +
 .../main/resources/activemq/server1/broker.xml  |  64 +++
 .../standard/durable-subscription/pom.xml       | 110 +++++
 .../standard/durable-subscription/readme.html   |  39 ++
 .../jms/example/DurableSubscriptionExample.java | 116 ++++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  61 +++
 .../src/main/resources/jndi.properties          |  20 +
 .../features/standard/embedded-simple/pom.xml   |  84 ++++
 .../standard/embedded-simple/readme.html        |  96 +++++
 .../artemis/jms/example/EmbeddedExample.java    |  86 ++++
 .../src/main/resources/broker.xml               |  52 +++
 examples/features/standard/embedded/pom.xml     |  84 ++++
 examples/features/standard/embedded/readme.html |  38 ++
 .../artemis/jms/example/EmbeddedExample.java    | 107 +++++
 examples/features/standard/expiry/pom.xml       | 110 +++++
 examples/features/standard/expiry/readme.html   |  61 +++
 .../artemis/jms/example/ExpiryExample.java      | 120 ++++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  70 ++++
 .../expiry/src/main/resources/jndi.properties   |  21 +
 .../features/standard/http-transport/pom.xml    | 110 +++++
 .../standard/http-transport/readme.html         |  52 +++
 .../jms/example/HttpTransportExample.java       |  81 ++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  61 +++
 .../instantiate-connection-factory/pom.xml      | 111 +++++
 .../instantiate-connection-factory/readme.html  |  49 +++
 .../InstantiateConnectionFactoryExample.java    |  81 ++++
 examples/features/standard/interceptor/pom.xml  | 111 +++++
 .../features/standard/interceptor/readme.html   |  72 ++++
 .../artemis/jms/example/InterceptorExample.java |  88 ++++
 .../artemis/jms/example/SimpleInterceptor.java  |  48 +++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  65 +++
 .../src/main/resources/jndi.properties          |  20 +
 .../standard/jms-auto-closeable/pom.xml         | 106 +++++
 .../standard/jms-auto-closeable/readme.html     |  96 +++++
 .../jms/example/JMSAutoCloseableExample.java    |  51 +++
 .../src/main/resources/jndi.properties          |  20 +
 .../features/standard/jms-bridge/jms-bridge.png | Bin 0 -> 93885 bytes
 examples/features/standard/jms-bridge/pom.xml   | 159 +++++++
 .../features/standard/jms-bridge/readme.html    | 246 +++++++++++
 .../artemis/jms/example/JMSBridgeExample.java   | 136 ++++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  53 +++
 .../activemq/server1/artemis-roles.properties   |  17 +
 .../activemq/server1/artemis-users.properties   |  17 +
 .../main/resources/activemq/server1/broker.xml  |  53 +++
 .../standard/jms-completion-listener/pom.xml    | 110 +++++
 .../jms-completion-listener/readme.html         | 112 +++++
 .../example/JMSCompletionListenerExample.java   |  82 ++++
 .../src/main/resources/jndi.properties          |  20 +
 examples/features/standard/jms-context/pom.xml  | 109 +++++
 .../features/standard/jms-context/readme.html   |  35 ++
 .../artemis/jms/example/JMSContextExample.java  |  51 +++
 .../standard/jms-shared-consumer/pom.xml        | 111 +++++
 .../standard/jms-shared-consumer/readme.html    | 119 ++++++
 .../jms/example/JMSSharedConsumerExample.java   |  87 ++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  61 +++
 .../src/main/resources/jndi.properties          |  20 +
 examples/features/standard/jmx/pom.xml          | 117 ++++++
 examples/features/standard/jmx/readme.html      | 181 ++++++++
 .../artemis/jms/example/JMXExample.java         | 121 ++++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  64 +++
 .../jmx/src/main/resources/jndi.properties      |  20 +
 .../features/standard/large-message/pom.xml     |  88 ++++
 .../features/standard/large-message/readme.html | 200 +++++++++
 .../jms/example/LargeMessageExample.java        | 193 +++++++++
 .../src/main/resources/jndi.properties          |  20 +
 .../features/standard/last-value-queue/pom.xml  | 109 +++++
 .../standard/last-value-queue/readme.html       | 162 ++++++++
 .../jms/example/LastValueQueueExample.java      | 104 +++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  67 +++
 .../src/main/resources/jndi.properties          |  20 +
 .../standard/management-notifications/pom.xml   | 109 +++++
 .../management-notifications/readme.html        | 215 ++++++++++
 .../example/ManagementNotificationExample.java  | 109 +++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  81 ++++
 .../src/main/resources/jndi.properties          |  21 +
 examples/features/standard/management/pom.xml   | 109 +++++
 .../features/standard/management/readme.html    | 208 ++++++++++
 .../artemis/jms/example/ManagementExample.java  | 133 ++++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  76 ++++
 .../src/main/resources/jndi.properties          |  20 +
 .../features/standard/message-counters/pom.xml  | 116 ++++++
 .../standard/message-counters/readme.html       | 197 +++++++++
 .../jms/example/MessageCounterExample.java      | 134 ++++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  86 ++++
 .../src/main/resources/jndi.properties          |  21 +
 .../features/standard/message-group/pom.xml     | 109 +++++
 .../features/standard/message-group/readme.html | 152 +++++++
 .../jms/example/MessageGroupExample.java        | 122 ++++++
 .../src/main/resources/jndi.properties          |  20 +
 .../features/standard/message-group2/pom.xml    | 109 +++++
 .../standard/message-group2/readme.html         | 161 ++++++++
 .../jms/example/MessageGroup2Example.java       | 129 ++++++
 .../features/standard/message-priority/pom.xml  | 109 +++++
 .../standard/message-priority/readme.html       | 159 +++++++
 .../jms/example/MessagePriorityExample.java     | 134 ++++++
 .../standard/no-consumer-buffering/pom.xml      | 108 +++++
 .../standard/no-consumer-buffering/readme.html  | 205 ++++++++++
 .../jms/example/NoConsumerBufferingExample.java | 110 +++++
 .../src/main/resources/jndi.properties          |  20 +
 examples/features/standard/paging/pom.xml       | 109 +++++
 examples/features/standard/paging/readme.html   | 187 +++++++++
 .../artemis/jms/example/PagingExample.java      | 135 ++++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  93 +++++
 .../paging/src/main/resources/jndi.properties   |  21 +
 examples/features/standard/pom.xml              | 171 ++++++++
 .../features/standard/pre-acknowledge/pom.xml   | 109 +++++
 .../standard/pre-acknowledge/readme.html        | 154 +++++++
 .../jms/example/PreacknowledgeExample.java      | 126 ++++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  63 +++
 .../src/main/resources/jndi.properties          |  20 +
 .../standard/producer-rate-limit/pom.xml        | 109 +++++
 .../standard/producer-rate-limit/readme.html    | 176 ++++++++
 .../jms/example/ProducerRateLimitExample.java   | 106 +++++
 .../src/main/resources/jndi.properties          |  20 +
 .../features/standard/queue-requestor/pom.xml   | 104 +++++
 .../standard/queue-requestor/readme.html        |  46 +++
 .../jms/example/QueueRequestorExample.java      |  96 +++++
 .../jms/example/TextReverserService.java        | 113 +++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  67 +++
 .../src/main/resources/jndi.properties          |  20 +
 .../features/standard/queue-selector/pom.xml    | 109 +++++
 .../standard/queue-selector/readme.html         |  52 +++
 .../jms/example/QueueSelectorExample.java       | 143 +++++++
 .../src/main/resources/jndi.properties          |  20 +
 examples/features/standard/queue/pom.xml        | 109 +++++
 examples/features/standard/queue/readme.html    |  38 ++
 .../artemis/jms/example/QueueExample.java       |  84 ++++
 .../queue/src/main/resources/jndi.properties    |  20 +
 .../features/standard/reattach-node/pom.xml     | 111 +++++
 .../features/standard/reattach-node/readme.html |  55 +++
 .../artemis/jms/example/ReattachExample.java    | 150 +++++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  82 ++++
 .../src/main/resources/jndi.properties          |  20 +
 .../features/standard/request-reply/pom.xml     | 112 +++++
 .../features/standard/request-reply/readme.html | 180 ++++++++
 .../jms/example/RequestReplyExample.java        | 202 +++++++++
 .../src/main/resources/jndi.properties          |  20 +
 .../features/standard/rest/dup-send/README.txt  |  41 ++
 .../features/standard/rest/dup-send/pom.xml     | 170 ++++++++
 .../rest/dup-send/src/main/java/Order.java      |  69 ++++
 .../rest/dup-send/src/main/java/PostOrder.java  |  69 ++++
 .../dup-send/src/main/java/PostOrderWithId.java |  45 ++
 .../dup-send/src/main/java/ReceiveOrder.java    |  51 +++
 .../src/main/resources/activemq-client.xml      |  36 ++
 .../src/main/resources/activemq-rest.xml        |  23 ++
 .../src/main/resources/artemis-roles.properties |  17 +
 .../src/main/resources/artemis-users.properties |  17 +
 .../rest/dup-send/src/main/resources/broker.xml |  59 +++
 .../dup-send/src/main/webapp/WEB-INF/web.xml    |  55 +++
 .../standard/rest/javascript-chat/README.txt    |  16 +
 .../standard/rest/javascript-chat/pom.xml       | 184 +++++++++
 .../src/main/resources/artemis-roles.properties |  17 +
 .../src/main/resources/artemis-users.properties |  17 +
 .../src/main/resources/broker.xml               |  58 +++
 .../src/main/webapp/WEB-INF/web.xml             |  51 +++
 .../javascript-chat/src/main/webapp/index.html  | 189 +++++++++
 .../messaging/test/AutoAckTopicTest.java        |  88 ++++
 .../standard/rest/jms-to-rest/README.txt        |  49 +++
 .../features/standard/rest/jms-to-rest/pom.xml  | 170 ++++++++
 .../standard/rest/jms-to-rest/postOrder.py      |  44 ++
 .../standard/rest/jms-to-rest/receiveOrder.py   |  68 +++
 .../jms-to-rest/src/main/java/JmsHelper.java    |  38 ++
 .../jms-to-rest/src/main/java/JmsReceive.java   |  55 +++
 .../rest/jms-to-rest/src/main/java/JmsSend.java |  47 +++
 .../rest/jms-to-rest/src/main/java/Order.java   |  69 ++++
 .../jms-to-rest/src/main/java/RestReceive.java  |  52 +++
 .../jms-to-rest/src/main/java/RestSend.java     |  40 ++
 .../src/main/resources/activemq-client.xml      |  36 ++
 .../src/main/resources/artemis-roles.properties |  17 +
 .../src/main/resources/artemis-users.properties |  17 +
 .../jms-to-rest/src/main/resources/broker.xml   |  59 +++
 .../jms-to-rest/src/main/webapp/WEB-INF/web.xml |  51 +++
 examples/features/standard/rest/pom.xml         |  45 ++
 examples/features/standard/rest/push/README.txt |  32 ++
 examples/features/standard/rest/push/pom.xml    | 176 ++++++++
 .../rest/push/src/main/java/JmsHelper.java      |  37 ++
 .../standard/rest/push/src/main/java/Order.java |  69 ++++
 .../rest/push/src/main/java/PostOrder.java      |  47 +++
 .../rest/push/src/main/java/PushReg.java        |  52 +++
 .../push/src/main/java/ReceiveShipping.java     |  54 +++
 .../push/src/main/resources/activemq-client.xml |  36 ++
 .../src/main/resources/artemis-roles.properties |  17 +
 .../src/main/resources/artemis-users.properties |  17 +
 .../rest/push/src/main/resources/broker.xml     |  60 +++
 .../src/main/resources/test-realm.properties    |  18 +
 .../rest/push/src/main/webapp/WEB-INF/web.xml   |  70 ++++
 .../features/standard/scheduled-message/pom.xml | 114 ++++++
 .../standard/scheduled-message/readme.html      | 134 ++++++
 .../jms/example/ScheduledMessageExample.java    |  94 +++++
 .../src/main/resources/jndi.properties          |  20 +
 examples/features/standard/security/pom.xml     | 111 +++++
 examples/features/standard/security/readme.html | 326 +++++++++++++++
 .../artemis/jms/example/SecurityExample.java    | 282 +++++++++++++
 .../activemq/server0/artemis-roles.properties   |  20 +
 .../activemq/server0/artemis-users.properties   |  20 +
 .../main/resources/activemq/server0/broker.xml  |  81 ++++
 .../security/src/main/resources/jndi.properties |  22 +
 .../standard/send-acknowledgements/pom.xml      | 104 +++++
 .../standard/send-acknowledgements/readme.html  | 140 +++++++
 .../example/SendAcknowledgementsExample.java    | 104 +++++
 .../src/main/resources/jndi.properties          |  20 +
 .../standard/spring-integration/pom.xml         |  82 ++++
 .../standard/spring-integration/readme.html     |  36 ++
 .../artemis/jms/example/ExampleListener.java    |  37 ++
 .../artemis/jms/example/MessageSender.java      |  71 ++++
 .../artemis/jms/example/SpringExample.java      |  32 ++
 .../src/main/resources/artemis-roles.properties |  17 +
 .../src/main/resources/artemis-users.properties |  17 +
 .../src/main/resources/broker.xml               |  53 +++
 .../src/main/resources/spring-jms-beans.xml     |  80 ++++
 examples/features/standard/ssl-enabled/pom.xml  | 109 +++++
 .../features/standard/ssl-enabled/readme.html   |  56 +++
 .../artemis/jms/example/SSLExample.java         |  86 ++++
 .../activemq/server0/activemq.example.keystore  | Bin 0 -> 1273 bytes
 .../server0/activemq.example.truststore         | Bin 0 -> 866 bytes
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  60 +++
 .../src/main/resources/jndi.properties          |  20 +
 .../features/standard/static-selector/pom.xml   | 109 +++++
 .../standard/static-selector/readme.html        |  60 +++
 .../jms/example/StaticSelectorExample.java      | 137 +++++++
 .../activemq/server0/artemis-roles.properties   |  17 +
 .../activemq/server0/artemis-users.properties   |  17 +
 .../main/resources/activemq/server0/broker.xml  |  67 +++
 .../src/main/resources/jndi.properties          |  20 +
 examples/features/standard/temp-queue/pom.xml   | 109 +++++
 .../features/standard/temp-queue/readme.html    |  40 ++
 .../jms/example/TemporaryQueueExample.java      | 118 ++++++
 .../main/resources/activemq/server0/broker.xml  |  65 +++
 .../src/main/resources/jndi.properties          |  20 +
 .../features/standard/topic-hierarchies/pom.xml | 109 +++++
 .../standard/topic-hierarchies/readme.html      |  42 ++
 .../jms/example/TopicHierarchyExample.java      | 121 ++++++
 .../main/resources/activemq/server0/broker.xml  |  71 ++++
 .../src/main/resources/jndi.properties          |  19 +
 .../standard/topic-selector-example1/pom.xml    | 109 +++++
 .../topic-selector-example1/readme.html         |  38 ++
 .../jms/example/TopicSelectorExample1.java      | 145 +++++++
 .../main/resources/activemq/server0/broker.xml  |  60 +++
 .../src/main/resources/jndi.properties          |  20 +
 .../standard/topic-selector-example2/pom.xml    | 109 +++++
 .../topic-selector-example2/readme.html         |  47 +++
 .../jms/example/TopicSelectorExample2.java      | 145 +++++++
 .../main/resources/activemq/server0/broker.xml  |  60 +++
 .../src/main/resources/jndi.properties          |  20 +
 examples/features/standard/topic/pom.xml        | 108 +++++
 examples/features/standard/topic/readme.html    |  36 ++
 .../artemis/jms/example/TopicExample.java       |  94 +++++
 .../main/resources/activemq/server0/broker.xml  |  59 +++
 .../topic/src/main/resources/jndi.properties    |  20 +
 .../features/standard/transactional/pom.xml     | 109 +++++
 .../features/standard/transactional/readme.html |  40 ++
 .../jms/example/TransactionalExample.java       | 126 ++++++
 .../src/main/resources/jndi.properties          |  20 +
 examples/features/standard/xa-heuristic/pom.xml | 111 +++++
 .../features/standard/xa-heuristic/readme.html  |  48 +++
 .../activemq/artemis/jms/example/DummyXid.java  | 184 +++++++++
 .../artemis/jms/example/XAHeuristicExample.java | 219 ++++++++++
 .../src/main/resources/jndi.properties          |  21 +
 examples/features/standard/xa-receive/pom.xml   | 109 +++++
 .../features/standard/xa-receive/readme.html    |  48 +++
 .../activemq/artemis/jms/example/DummyXid.java  | 184 +++++++++
 .../artemis/jms/example/XAReceiveExample.java   | 145 +++++++
 .../src/main/resources/jndi.properties          |  21 +
 examples/features/standard/xa-send/pom.xml      | 109 +++++
 examples/features/standard/xa-send/readme.html  | 215 ++++++++++
 .../activemq/artemis/jms/example/DummyXid.java  | 184 +++++++++
 .../artemis/jms/example/XASendExample.java      | 191 +++++++++
 .../xa-send/src/main/resources/jndi.properties  |  21 +
 examples/features/sub-modules/aerogear/pom.xml  | 125 ++++++
 .../features/sub-modules/aerogear/readme.html   | 157 +++++++
 .../artemis/jms/example/AerogearExample.java    |  77 ++++
 .../main/resources/activemq/server0/broker.xml  |  77 ++++
 .../aerogear/src/main/resources/jndi.properties |  20 +
 .../features/sub-modules/artemis-ra-rar/pom.xml | 101 +++++
 .../artemis-ra-rar/src/main/resources/ra.xml    | 308 ++++++++++++++
 examples/features/sub-modules/pom.xml           |  58 +++
 examples/features/sub-modules/vertx/pom.xml     | 145 +++++++
 examples/features/sub-modules/vertx/readme.html | 103 +++++
 .../artemis/core/example/ExampleVerticle.java   |  54 +++
 .../core/example/VertxConnectorExample.java     | 105 +++++
 .../main/resources/activemq/server0/broker.xml  |  81 ++++
 examples/pom.xml                                |   3 +-
 1021 files changed, 42935 insertions(+), 42936 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/client-side-load-balancing/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/client-side-load-balancing/pom.xml b/examples/broker-features/clustered/client-side-load-balancing/pom.xml
deleted file mode 100644
index c2993b2..0000000
--- a/examples/broker-features/clustered/client-side-load-balancing/pom.xml
+++ /dev/null
@@ -1,196 +0,0 @@
-<?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.clustered</groupId>
-      <artifactId>broker-clustered</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>client-side-load-balancing</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Client Side Load Balancing 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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server0</instance>
-                     <clustered>true</clustered>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server1</instance>
-                     <clustered>true</clustered>
-                     <portOffset>1</portOffset>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create2</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server2</instance>
-                     <clustered>true</clustered>
-                     <portOffset>2</portOffset>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <spawn>true</spawn>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server1</location>
-                     <testURI>tcp://localhost:61617</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server1</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start2</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server2</location>
-                     <testURI>tcp://localhost:61618</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server2</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ClientSideLoadBalancingExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server1</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop2</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server2</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.clustered</groupId>
-                  <artifactId>client-side-load-balancing</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/client-side-load-balancing/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/client-side-load-balancing/readme.html b/examples/broker-features/clustered/client-side-load-balancing/readme.html
deleted file mode 100644
index 9d3aba5..0000000
--- a/examples/broker-features/clustered/client-side-load-balancing/readme.html
+++ /dev/null
@@ -1,49 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Client-Side Load-Balancing 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 Client-Side Load-Balancing 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 connnections created from a single JMS Connection factory can be created
-     to different nodes of the cluster. In other words it demonstrates how ActiveMQ Artemis does <b>client side load balancing</b> of
-     connections across the cluster.</p>
-     <p>The particular load-balancing policy can be chosen to be random, round-robin or user-defined. Please see the user
-     guide for more details of how to configure the specific load-balancing policy. In this example we will use
-     the default round-robin load balancing policy.</p>
-     <p>The list of servers over which ActiveMQ Artemis will round-robin the connections can either be specified explicitly
-     in the connection factory when instantiating it directly, when configuring it on the server or configured
-     to use UDP discovery to discover the list of servers over which to round-robin. This example will use UDP
-     discovery to obtain the list.</p>
-     <p>This example starts three servers which all broadcast their location using UDP discovery. The UDP broadcast configuration
-     can be seen in the <code>broker.xml</code> file.</p>
-     <p>A JMS ConnectionFactory is deployed on each server specifying the discovery group that will be used by that
-     connection factory.</p>
-     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
-     section of the user manual.</p>
-
-   </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java b/examples/broker-features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java
deleted file mode 100644
index 1281017..0000000
--- a/examples/broker-features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java
+++ /dev/null
@@ -1,138 +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.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-/**
- * This example demonstrates how sessions created from a single connection can be load
- * balanced across the different nodes of the cluster.
- *
- * In this example there are three nodes and we use a round-robin client side load-balancing
- * policy.
- */
-public class ClientSideLoadBalancingExample {
-
-   public static void main(final String[] args) throws Exception {
-      InitialContext initialContext = null;
-
-      Connection connectionA = null;
-      Connection connectionB = null;
-      Connection connectionC = null;
-
-      try {
-         // Step 1. Get an initial context for looking up JNDI from server 0
-         initialContext = new InitialContext();
-
-         // Step 2. Look-up the JMS Queue object from JNDI
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-
-         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 4. We create 3 JMS connections from the same connection factory. Since we are using round-robin
-         // load-balancing this should result in each sessions being connected to a different node of the cluster
-         Connection conn = connectionFactory.createConnection();
-         // Wait a little while to make sure broadcasts from all nodes have reached the client
-         Thread.sleep(5000);
-         connectionA = connectionFactory.createConnection();
-         connectionB = connectionFactory.createConnection();
-         connectionC = connectionFactory.createConnection();
-         conn.close();
-
-         // Step 5. We create JMS Sessions
-         Session sessionA = connectionA.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         Session sessionB = connectionB.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         Session sessionC = connectionC.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         System.out.println("Session A - " + ((org.apache.activemq.artemis.core.client.impl.DelegatingSession) ((org.apache.activemq.artemis.jms.client.ActiveMQSession) sessionA).getCoreSession()).getConnection().getRemoteAddress());
-         System.out.println("Session B - " + ((org.apache.activemq.artemis.core.client.impl.DelegatingSession) ((org.apache.activemq.artemis.jms.client.ActiveMQSession) sessionB).getCoreSession()).getConnection().getRemoteAddress());
-         System.out.println("Session C - " + ((org.apache.activemq.artemis.core.client.impl.DelegatingSession) ((org.apache.activemq.artemis.jms.client.ActiveMQSession) sessionC).getCoreSession()).getConnection().getRemoteAddress());
-
-         // Step 6. We create JMS MessageProducer objects on the sessions
-         MessageProducer producerA = sessionA.createProducer(queue);
-         MessageProducer producerB = sessionB.createProducer(queue);
-         MessageProducer producerC = sessionC.createProducer(queue);
-
-         // Step 7. We send some messages on each producer
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage messageA = sessionA.createTextMessage("A:This is text message " + i);
-            producerA.send(messageA);
-            System.out.println("Sent message: " + messageA.getText());
-
-            TextMessage messageB = sessionB.createTextMessage("B:This is text message " + i);
-            producerB.send(messageB);
-            System.out.println("Sent message: " + messageB.getText());
-
-            TextMessage messageC = sessionC.createTextMessage("C:This is text message " + i);
-            producerC.send(messageC);
-            System.out.println("Sent message: " + messageC.getText());
-         }
-
-         // Step 8. We start the connection to consume messages
-         connectionA.start();
-         connectionB.start();
-         connectionC.start();
-
-         // Step 9. We consume messages from the 3 session, one at a time.
-         // We try to consume one more message than expected from each session. If
-         // the session were not properly load-balanced, we would be missing a
-         // message from one of the sessions at the end.
-         consume(sessionA, queue, numMessages, "A");
-         consume(sessionB, queue, numMessages, "B");
-         consume(sessionC, queue, numMessages, "C");
-      }
-      finally {
-         // Step 10. Be sure to close our resources!
-
-         if (connectionA != null) {
-            connectionA.close();
-         }
-         if (connectionB != null) {
-            connectionB.close();
-         }
-         if (connectionC != null) {
-            connectionC.close();
-         }
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-      }
-   }
-
-   private static void consume(Session session, Queue queue, int numMessages, String node) throws JMSException {
-      MessageConsumer consumer = session.createConsumer(queue);
-
-      for (int i = 0; i < numMessages; i++) {
-         TextMessage message = (TextMessage) consumer.receive(2000);
-         System.out.println("Got message: " + message.getText() + " from node " + node);
-      }
-
-      System.out.println("receive other message from node " + node + ": " + consumer.receive(2000));
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/client-side-load-balancing/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/client-side-load-balancing/src/main/resources/jndi.properties b/examples/broker-features/clustered/client-side-load-balancing/src/main/resources/jndi.properties
deleted file mode 100644
index d3f932c..0000000
--- a/examples/broker-features/clustered/client-side-load-balancing/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=udp://231.7.7.7:9876
-queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-durable-subscription/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-durable-subscription/pom.xml b/examples/broker-features/clustered/clustered-durable-subscription/pom.xml
deleted file mode 100644
index 8f28710..0000000
--- a/examples/broker-features/clustered/clustered-durable-subscription/pom.xml
+++ /dev/null
@@ -1,158 +0,0 @@
-<?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.clustered</groupId>
-      <artifactId>broker-clustered</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>clustered-durable-subscription</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Clustered Durable Subscription 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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <clustered>true</clustered>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <clustered>true</clustered>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                     <portOffset>1</portOffset>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server0</location>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server1</location>
-                     <testURI>tcp://localhost:61617</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server1</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ClusteredDurableSubscriptionExample
-                     </clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server1</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.clustered</groupId>
-                  <artifactId>clustered-durable-subscription</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>


[42/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/pom.xml b/examples/broker-features/ha/pom.xml
deleted file mode 100644
index 016d9b1..0000000
--- a/examples/broker-features/ha/pom.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?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.clustered</groupId>
-      <artifactId>broker-features</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <groupId>org.apache.activemq.examples.failover</groupId>
-   <artifactId>broker-failover</artifactId>
-   <packaging>pom</packaging>
-   <name>ActiveMQ Artemis Failover Examples</name>
-
-   <!-- Properties -->
-   <properties>
-      <!--
-      Explicitly declaring the source encoding eliminates the following
-      message: [WARNING] Using platform encoding (UTF-8 actually) to copy
-      filtered resources, i.e. build is platform dependent!
-      -->
-      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-      <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
-   </properties>
-
-   <profiles>
-      <profile>
-         <id>release</id>
-         <modules>
-            <module>application-layer-failover</module>
-            <module>client-side-failoverlistener</module>
-            <module>colocated-failover</module>
-            <module>colocated-failover-scale-down</module>
-            <module>ha-policy-autobackup</module>
-            <module>multiple-failover</module>
-            <module>multiple-failover-failback</module>
-            <module>non-transaction-failover</module>
-            <module>replicated-failback</module>
-            <module>replicated-failback-static</module>
-            <module>replicated-multiple-failover</module>
-            <module>replicated-transaction-failover</module>
-            <module>scale-down</module>
-            <module>stop-server-failover</module>
-            <module>transaction-failover</module>
-         </modules>
-      </profile>
-      <profile>
-         <id>examples</id>
-         <modules>
-            <module>application-layer-failover</module>
-            <module>client-side-failoverlistener</module>
-
-            <!-- ARTEMIS-197 FIX ME:
-            <module>colocated-failover</module>
-            <module>colocated-failover-scale-down</module> -->
-
-            <module>ha-policy-autobackup</module>
-            <module>multiple-failover</module>
-            <module>multiple-failover-failback</module>
-            <module>non-transaction-failover</module>
-
-            <!-- ARTEMIS-197 FIX ME:
-            <module>replicated-failback</module>
-            <module>replicated-failback-static</module> -->
-
-            <module>replicated-multiple-failover</module>
-            <module>replicated-transaction-failover</module>
-            <module>scale-down</module>
-            <module>transaction-failover</module>
-         </modules>
-      </profile>
-   </profiles>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-failback-static/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-failback-static/pom.xml b/examples/broker-features/ha/replicated-failback-static/pom.xml
deleted file mode 100644
index 91bb01e..0000000
--- a/examples/broker-features/ha/replicated-failback-static/pom.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>replicated-failback-static</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Replicated Failback Static Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedFailbackStaticExample</clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                        <param>${basedir}/target/server1</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>replicated-failback-static</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-failback-static/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-failback-static/readme.html b/examples/broker-features/ha/replicated-failback-static/readme.html
deleted file mode 100644
index cab789a..0000000
--- a/examples/broker-features/ha/replicated-failback-static/readme.html
+++ /dev/null
@@ -1,38 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Failback using Static selectors 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 Multiple Failover using Replication Example</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
-
-     <p>This example demonstrates three servers coupled as a live-backup-backup group for high availability (HA) using replication, and a client
-     connection failing over from live to backup when the live server is crashed and then to the second backup once the new live fails.</p>
-
-     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
-     section of the user manual.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java b/examples/broker-features/ha/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java
deleted file mode 100644
index d2f74ba..0000000
--- a/examples/broker-features/ha/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java
+++ /dev/null
@@ -1,149 +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 org.apache.activemq.artemis.util.ServerUtil;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-/**
- * Example of live and replicating backup pair.
- * <p>
- * After both servers are started, the live server is killed and the backup becomes active ("fails-over").
- * <p>
- * Later the live server is restarted and takes back its position by asking the backup to stop ("fail-back").
- */
-public class ReplicatedFailbackStaticExample {
-
-   private static Process server0;
-
-   private static Process server1;
-
-   public static void main(final String[] args) throws Exception {
-      final int numMessages = 30;
-
-      Connection connection = null;
-
-      InitialContext initialContext = null;
-
-      try {
-         server0 = ServerUtil.startServer(args[0], ReplicatedFailbackStaticExample.class.getSimpleName() + "0", 0, 30000);
-         server1 = ServerUtil.startServer(args[1], ReplicatedFailbackStaticExample.class.getSimpleName() + "1", 1, 10000);
-
-         // Step 1. Get an initial context for looking up JNDI from the server #1
-         initialContext = new InitialContext();
-
-         // Step 2. Look up the JMS resources from JNDI
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 3. Create a JMS Connection
-         connection = connectionFactory.createConnection();
-
-         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
-         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
-         // Step 5. Start the connection to ensure delivery occurs
-         connection.start();
-
-         // Step 6. Create a JMS MessageProducer and a MessageConsumer
-         MessageProducer producer = session.createProducer(queue);
-         MessageConsumer consumer = session.createConsumer(queue);
-
-         // Step 7. Send some messages to server #1, the live server
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session.createTextMessage("This is text message " + i);
-            producer.send(message);
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 8. Receive and acknowledge a third of the sent messages
-         TextMessage message0 = null;
-         for (int i = 0; i < numMessages / 3; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-         message0.acknowledge();
-
-         // Step 9. Receive the rest third of the sent messages but *do not* acknowledge them yet
-         for (int i = numMessages / 3; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-
-         // Step 10. Crash server #0, the live server, and wait a little while to make sure
-         // it has really crashed
-         ServerUtil.killServer(server0);
-
-         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
-         // backup server has occurred
-         try {
-            message0.acknowledge();
-         }
-         catch (JMSException e) {
-            System.out.println("Got (the expected) exception while acknowledging message: " + e.getMessage());
-         }
-
-         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
-         for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-         }
-         message0.acknowledge();
-
-         server0 = ServerUtil.startServer(args[0], ReplicatedFailbackStaticExample.class.getSimpleName() + "0", 0, 10000);
-
-         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
-         // backup server has occurred
-         try {
-            message0.acknowledge();
-         }
-         catch (JMSException e) {
-            System.err.println("Got exception while acknowledging message: " + e.getMessage());
-         }
-
-         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
-         for (int i = (numMessages / 3) * 2; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-         }
-         message0.acknowledge();
-      }
-      finally {
-         // Step 13. Be sure to close our resources!
-
-         if (connection != null) {
-            connection.close();
-         }
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-
-         ServerUtil.killServer(server0);
-         ServerUtil.killServer(server1);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-failback-static/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/ha/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index f6fa349..0000000
--- a/examples/broker-features/ha/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?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>
-
-      <cluster-user>exampleUser</cluster-user>
-
-      <cluster-password>secret</cluster-password>
-
-      <ha-policy>
-         <replication>
-            <master>
-               <!--we need this for auto failback-->
-               <check-for-live-server>true</check-for-live-server>
-            </master>
-         </replication>
-      </ha-policy>
-
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-         <connector name="netty-backup-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <static-connectors>
-               <connector-ref>netty-backup-connector</connector-ref>
-            </static-connectors>
-         </cluster-connection>
-      </cluster-connections>
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-failback-static/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-failback-static/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/ha/replicated-failback-static/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 9b89d80..0000000
--- a/examples/broker-features/ha/replicated-failback-static/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?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>
-
-      <cluster-user>exampleUser</cluster-user>
-
-      <cluster-password>secret</cluster-password>
-
-      <ha-policy>
-         <replication>
-            <slave>
-               <allow-failback>true</allow-failback>
-               <!-- not needed but tells the backup not to restart after failback as there will be > 0 backups saved -->
-               <max-saved-replicated-journals-size>0</max-saved-replicated-journals-size>
-            </slave>
-         </replication>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-live-connector">tcp://localhost:61616</connector>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <static-connectors>
-               <connector-ref>netty-live-connector</connector-ref>
-            </static-connectors>
-         </cluster-connection>
-      </cluster-connections>
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-failback-static/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-failback-static/src/main/resources/jndi.properties b/examples/broker-features/ha/replicated-failback-static/src/main/resources/jndi.properties
deleted file mode 100644
index 7f7a19f..0000000
--- a/examples/broker-features/ha/replicated-failback-static/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/ha/replicated-failback/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-failback/pom.xml b/examples/broker-features/ha/replicated-failback/pom.xml
deleted file mode 100644
index d996718..0000000
--- a/examples/broker-features/ha/replicated-failback/pom.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>replicated-failback</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Replicated Failback Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
-   </dependencies>
-
-   <build>
-      <plugins>
-         <plugin>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-maven-plugin</artifactId>
-            <executions>
-               <execution>
-                  <id>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedFailbackExample</clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                        <param>${basedir}/target/server1</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>replicated-failback</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-failback/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-failback/readme.html b/examples/broker-features/ha/replicated-failback/readme.html
deleted file mode 100644
index 4e53739..0000000
--- a/examples/broker-features/ha/replicated-failback/readme.html
+++ /dev/null
@@ -1,38 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Multiple Failover using Replication 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 Multiple Failover using Replication Example</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
-
-     <p>This example demonstrates three servers coupled as a live-backup-backup group for high availability (HA) using replication, and a client
-     connection failing over from live to backup when the live server is crashed and then to the second backup once the new live fails.</p>
-
-     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
-     section of the user manual.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java b/examples/broker-features/ha/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java
deleted file mode 100644
index 29ae381..0000000
--- a/examples/broker-features/ha/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java
+++ /dev/null
@@ -1,149 +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 org.apache.activemq.artemis.util.ServerUtil;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-/**
- * Example of live and replicating backup pair.
- * <p>
- * After both servers are started, the live server is killed and the backup becomes active ("fails-over").
- * <p>
- * Later the live server is restarted and takes back its position by asking the backup to stop ("fail-back").
- */
-public class ReplicatedFailbackExample {
-
-   private static Process server0;
-
-   private static Process server1;
-
-   public static void main(final String[] args) throws Exception {
-      final int numMessages = 30;
-
-      Connection connection = null;
-
-      InitialContext initialContext = null;
-
-      try {
-         server0 = ServerUtil.startServer(args[0], ReplicatedFailbackExample.class.getSimpleName() + "0", 0, 30000);
-         server1 = ServerUtil.startServer(args[1], ReplicatedFailbackExample.class.getSimpleName() + "1", 1, 10000);
-
-         // Step 1. Get an initial context for looking up JNDI from the server #1
-         initialContext = new InitialContext();
-
-         // Step 2. Look up the JMS resources from JNDI
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 3. Create a JMS Connection
-         connection = connectionFactory.createConnection();
-
-         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
-         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
-         // Step 5. Start the connection to ensure delivery occurs
-         connection.start();
-
-         // Step 6. Create a JMS MessageProducer and a MessageConsumer
-         MessageProducer producer = session.createProducer(queue);
-         MessageConsumer consumer = session.createConsumer(queue);
-
-         // Step 7. Send some messages to server #1, the live server
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session.createTextMessage("This is text message " + i);
-            producer.send(message);
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 8. Receive and acknowledge a third of the sent messages
-         TextMessage message0 = null;
-         for (int i = 0; i < numMessages / 3; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-         message0.acknowledge();
-
-         // Step 9. Receive the rest third of the sent messages but *do not* acknowledge them yet
-         for (int i = numMessages / 3; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-
-         // Step 10. Crash server #0, the live server, and wait a little while to make sure
-         // it has really crashed
-         ServerUtil.killServer(server0);
-
-         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
-         // backup server has occurred
-         try {
-            message0.acknowledge();
-         }
-         catch (JMSException e) {
-            System.out.println("Got (the expected) exception while acknowledging message: " + e.getMessage());
-         }
-
-         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
-         for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-         }
-         message0.acknowledge();
-
-         server0 = ServerUtil.startServer(args[0], ReplicatedFailbackExample.class.getSimpleName() + "0", 0, 10000);
-
-         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
-         // backup server has occurred
-         try {
-            message0.acknowledge();
-         }
-         catch (JMSException e) {
-            System.err.println("Got exception while acknowledging message: " + e.getMessage());
-         }
-
-         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
-         for (int i = (numMessages / 3) * 2; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-         }
-         message0.acknowledge();
-      }
-      finally {
-         // Step 13. Be sure to close our resources!
-
-         if (connection != null) {
-            connection.close();
-         }
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-
-         ServerUtil.killServer(server0);
-         ServerUtil.killServer(server1);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-failback/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-failback/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/ha/replicated-failback/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index c7f4783..0000000
--- a/examples/broker-features/ha/replicated-failback/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-<?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>
-
-      <cluster-user>exampleUser</cluster-user>
-
-      <cluster-password>secret</cluster-password>
-
-      <ha-policy>
-         <replication>
-            <master>
-               <!--we need this for auto failback-->
-               <check-for-live-server>true</check-for-live-server>
-            </master>
-         </replication>
-      </ha-policy>
-
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>5000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-failback/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-failback/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/ha/replicated-failback/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index da5a656..0000000
--- a/examples/broker-features/ha/replicated-failback/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?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>
-
-      <cluster-user>exampleUser</cluster-user>
-
-      <cluster-password>secret</cluster-password>
-
-      <ha-policy>
-         <replication>
-            <slave>
-               <allow-failback>true</allow-failback>
-            </slave>
-         </replication>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-live-connector">tcp://localhost:61616</connector>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>5000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-failback/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-failback/src/main/resources/jndi.properties b/examples/broker-features/ha/replicated-failback/src/main/resources/jndi.properties
deleted file mode 100644
index 7f7a19f..0000000
--- a/examples/broker-features/ha/replicated-failback/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/ha/replicated-multiple-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-multiple-failover/pom.xml b/examples/broker-features/ha/replicated-multiple-failover/pom.xml
deleted file mode 100644
index 23dcfd7..0000000
--- a/examples/broker-features/ha/replicated-multiple-failover/pom.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>replicated-multiple-failover</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Replicated Multiple Failover Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create2</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server2</instance>
-                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedMultipleFailoverExample
-                     </clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                        <param>${basedir}/target/server1</param>
-                        <param>${basedir}/target/server2</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>replicated-multiple-failover</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-multiple-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-multiple-failover/readme.html b/examples/broker-features/ha/replicated-multiple-failover/readme.html
deleted file mode 100644
index da37085..0000000
--- a/examples/broker-features/ha/replicated-multiple-failover/readme.html
+++ /dev/null
@@ -1,45 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Multiple Failover using Replication 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 Multiple Failover using Replication Example</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
-
-
-     <p>This example demonstrates three servers coupled as a live-backup-backup group for high availability (HA) using replication, and a client
-     connection failing over from live to backup when the live server is crashed and then to the second backup once the new live fails.</p>
-
-     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
-     section of the user manual.</p>
-
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-     <p>In this example, the live server is server 1, and the backup server is server 0</p>
-     <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
-     seamlessly on server 0, the backup server.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedMultipleFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedMultipleFailoverExample.java b/examples/broker-features/ha/replicated-multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedMultipleFailoverExample.java
deleted file mode 100644
index 491d792..0000000
--- a/examples/broker-features/ha/replicated-multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedMultipleFailoverExample.java
+++ /dev/null
@@ -1,149 +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 org.apache.activemq.artemis.util.ServerUtil;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-public class ReplicatedMultipleFailoverExample {
-
-   private static Process server0;
-
-   private static Process server1;
-
-   private static Process server2;
-
-   public static void main(final String[] args) throws Exception {
-      final int numMessages = 30;
-
-      Connection connection = null;
-
-      InitialContext initialContext = null;
-
-      try {
-         server0 = ServerUtil.startServer(args[0], ReplicatedMultipleFailoverExample.class.getSimpleName() + "0", 0, 5000);
-         server1 = ServerUtil.startServer(args[1], ReplicatedMultipleFailoverExample.class.getSimpleName() + "1", 1, 5000);
-         server2 = ServerUtil.startServer(args[2], ReplicatedMultipleFailoverExample.class.getSimpleName() + "2", 2, 5000);
-
-         Process[] processes = new Process[]{server0, server1, server2};
-
-         // Step 1. Get an initial context for looking up JNDI from the server #1
-         initialContext = new InitialContext();
-
-         // Step 2. Look up the JMS resources from JNDI
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 3. Create a JMS Connection
-         connection = connectionFactory.createConnection();
-
-         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
-         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
-         // Step 5. Start the connection to ensure delivery occurs
-         connection.start();
-
-         // Step 6. Create a JMS MessageProducer and a MessageConsumer
-         MessageProducer producer = session.createProducer(queue);
-         MessageConsumer consumer = session.createConsumer(queue);
-
-         // Step 7. Send some messages to server #1, the live server
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session.createTextMessage("This is text message " + i);
-            producer.send(message);
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 8. Receive and acknowledge a third of the sent messages
-         TextMessage message0 = null;
-         for (int i = 0; i < numMessages / 3; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-         message0.acknowledge();
-
-         // Step 9. Receive the rest third of the sent messages but *do not* acknowledge them yet
-         for (int i = numMessages / 3; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-
-         // Step 10. Crash server #0, the live server, and wait a little while to make sure
-         // it has really crashed
-         ServerUtil.killServer(server0);
-         Thread.sleep(5000);
-
-         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
-         // backup server has occurred
-         try {
-            message0.acknowledge();
-         }
-         catch (JMSException e) {
-            System.err.println("Got exception while acknowledging message: " + e.getMessage());
-         }
-
-         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
-         for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
-         }
-         message0.acknowledge();
-
-         ServerUtil.killServer(processes[ServerUtil.getServer(connection)]);
-
-         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
-         // backup server has occurred
-         try {
-            message0.acknowledge();
-         }
-         catch (JMSException e) {
-            System.err.println("Got exception while acknowledging message: " + e.getMessage());
-         }
-
-         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
-         for (int i = (numMessages / 3) * 2; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
-         }
-         message0.acknowledge();
-      }
-      finally {
-         // Step 13. Be sure to close our resources!
-
-         if (connection != null) {
-            connection.close();
-         }
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-
-         ServerUtil.killServer(server0);
-         ServerUtil.killServer(server1);
-         ServerUtil.killServer(server2);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 43f1693..0000000
--- a/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?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>
-
-      <ha-policy>
-         <replication>
-            <master/>
-         </replication>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 7f17fb8..0000000
--- a/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?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>
-
-      <ha-policy>
-         <replication>
-            <slave/>
-         </replication>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml b/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml
deleted file mode 100644
index c5f06cc..0000000
--- a/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?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>
-
-      <ha-policy>
-         <replication>
-            <slave/>
-         </replication>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61618</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/jndi.properties b/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/jndi.properties
deleted file mode 100644
index 7f7a19f..0000000
--- a/examples/broker-features/ha/replicated-multiple-failover/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/ha/replicated-transaction-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/replicated-transaction-failover/pom.xml b/examples/broker-features/ha/replicated-transaction-failover/pom.xml
deleted file mode 100644
index 4c1839e..0000000
--- a/examples/broker-features/ha/replicated-transaction-failover/pom.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>replicated-transaction-failover</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Replicated Transaction Failover Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedTransactionFailoverExample
-                     </clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                        <param>${basedir}/target/server1</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>replicated-transaction-failover</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-</project>


[40/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/perf/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/perf/pom.xml b/examples/broker-features/perf/perf/pom.xml
deleted file mode 100644
index bcab911..0000000
--- a/examples/broker-features/perf/perf/pom.xml
+++ /dev/null
@@ -1,156 +0,0 @@
-<?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.soak</groupId>
-      <artifactId>perf-root</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>perf</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS PerfExample Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-server</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-jms-server</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-core-client</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-commons</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>io.netty</groupId>
-         <artifactId>netty-all</artifactId>
-         <version>${netty.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-jms-client</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-   </dependencies>
-
-   <profiles>
-      <profile>
-         <id>server</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                     <executions>
-                        <execution>
-                           <id>create</id>
-                           <goals>
-                              <goal>create</goal>
-                           </goals>
-                        </execution>
-                        <execution>
-                           <id>runClient</id>
-                           <goals>
-                              <goal>runClient</goal>
-                           </goals>
-                           <configuration>
-                              <clientClass>org.apache.activemq.artemis.jms.example.Server</clientClass>
-                           </configuration>
-                        </execution>
-                     </executions>
-                     <dependencies>
-                        <dependency>
-                           <groupId>org.apache.activemq.examples.soak</groupId>
-                           <artifactId>perf</artifactId>
-                           <version>${project.version}</version>
-                        </dependency>
-                     </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-      <profile>
-         <id>listener</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.codehaus.mojo</groupId>
-                  <artifactId>exec-maven-plugin</artifactId>
-                  <version>1.1</version>
-                  <executions>
-                     <execution>
-                        <phase>package</phase>
-                        <goals>
-                           <goal>java</goal>
-                        </goals>
-                     </execution>
-                  </executions>
-                  <configuration>
-                     <mainClass>org.apache.activemq.artemis.jms.example.PerfListener</mainClass>
-                  </configuration>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-      <profile>
-         <id>sender</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.codehaus.mojo</groupId>
-                  <artifactId>exec-maven-plugin</artifactId>
-                  <version>1.1</version>
-                  <executions>
-                     <execution>
-                        <phase>package</phase>
-                        <goals>
-                           <goal>java</goal>
-                        </goals>
-                     </execution>
-                  </executions>
-                  <configuration>
-                     <mainClass>org.apache.activemq.artemis.jms.example.PerfSender</mainClass>
-                  </configuration>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
-
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/perf/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/perf/readme.html b/examples/broker-features/perf/perf/readme.html
deleted file mode 100644
index aa42266..0000000
--- a/examples/broker-features/perf/perf/readme.html
+++ /dev/null
@@ -1,39 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Queue Selector 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 Simple Performance</h1>
-
-    <p>To start the server run <code>mvn verify -Pexample</code></p>
-
-    <p>To start the listener run <code>mvn -Plistener package</code></p>
-
-    <p>To start the sender run <code>mvn -Psender package</code></p>
-
-    <p>To configure the clients simply edit the <code>perf.properties</code> or <code>client.jndi.properties</code> in the
-        <code>src/main/resources</code> directory</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfBase.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfBase.java b/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfBase.java
deleted file mode 100644
index bf18077..0000000
--- a/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfBase.java
+++ /dev/null
@@ -1,409 +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.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-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.Session;
-import javax.naming.InitialContext;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.Properties;
-import java.util.Random;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.logging.Logger;
-
-import org.apache.activemq.artemis.utils.TokenBucketLimiter;
-import org.apache.activemq.artemis.utils.TokenBucketLimiterImpl;
-
-public abstract class PerfBase {
-
-   private static final Logger log = Logger.getLogger(PerfSender.class.getName());
-
-   private static final String DEFAULT_PERF_PROPERTIES_FILE_NAME = "target/classes/perf.properties";
-
-   private static byte[] randomByteArray(final int length) {
-      byte[] bytes = new byte[length];
-
-      Random random = new Random();
-
-      for (int i = 0; i < length; i++) {
-         bytes[i] = Integer.valueOf(random.nextInt()).byteValue();
-      }
-
-      return bytes;
-   }
-
-   protected static String getPerfFileName(final String[] args) {
-      String fileName;
-
-      if (args.length > 0) {
-         fileName = args[0];
-      }
-      else {
-         fileName = PerfBase.DEFAULT_PERF_PROPERTIES_FILE_NAME;
-      }
-
-      return fileName;
-   }
-
-   protected static PerfParams getParams(final String fileName) throws Exception {
-      Properties props = null;
-
-      InputStream is = null;
-
-      try {
-         is = new FileInputStream(fileName);
-
-         props = new Properties();
-
-         props.load(is);
-      }
-      finally {
-         if (is != null) {
-            is.close();
-         }
-      }
-
-      int noOfMessages = Integer.valueOf(props.getProperty("num-messages"));
-      int noOfWarmupMessages = Integer.valueOf(props.getProperty("num-warmup-messages"));
-      int messageSize = Integer.valueOf(props.getProperty("message-size"));
-      boolean durable = Boolean.valueOf(props.getProperty("durable"));
-      boolean transacted = Boolean.valueOf(props.getProperty("transacted"));
-      int batchSize = Integer.valueOf(props.getProperty("batch-size"));
-      boolean drainQueue = Boolean.valueOf(props.getProperty("drain-queue"));
-      String destinationLookup = props.getProperty("destination-lookup");
-      String connectionFactoryLookup = props.getProperty("connection-factory-lookup");
-      int throttleRate = Integer.valueOf(props.getProperty("throttle-rate"));
-      boolean dupsOK = Boolean.valueOf(props.getProperty("dups-ok-acknowlege"));
-      boolean disableMessageID = Boolean.valueOf(props.getProperty("disable-message-id"));
-      boolean disableTimestamp = Boolean.valueOf(props.getProperty("disable-message-timestamp"));
-
-      PerfBase.log.info("num-messages: " + noOfMessages);
-      PerfBase.log.info("num-warmup-messages: " + noOfWarmupMessages);
-      PerfBase.log.info("message-size: " + messageSize);
-      PerfBase.log.info("durable: " + durable);
-      PerfBase.log.info("transacted: " + transacted);
-      PerfBase.log.info("batch-size: " + batchSize);
-      PerfBase.log.info("drain-queue: " + drainQueue);
-      PerfBase.log.info("throttle-rate: " + throttleRate);
-      PerfBase.log.info("connection-factory-lookup: " + connectionFactoryLookup);
-      PerfBase.log.info("destination-lookup: " + destinationLookup);
-      PerfBase.log.info("disable-message-id: " + disableMessageID);
-      PerfBase.log.info("disable-message-timestamp: " + disableTimestamp);
-      PerfBase.log.info("dups-ok-acknowledge: " + dupsOK);
-
-      PerfParams perfParams = new PerfParams();
-      perfParams.setNoOfMessagesToSend(noOfMessages);
-      perfParams.setNoOfWarmupMessages(noOfWarmupMessages);
-      perfParams.setMessageSize(messageSize);
-      perfParams.setDurable(durable);
-      perfParams.setSessionTransacted(transacted);
-      perfParams.setBatchSize(batchSize);
-      perfParams.setDrainQueue(drainQueue);
-      perfParams.setConnectionFactoryLookup(connectionFactoryLookup);
-      perfParams.setDestinationLookup(destinationLookup);
-      perfParams.setThrottleRate(throttleRate);
-      perfParams.setDisableMessageID(disableMessageID);
-      perfParams.setDisableTimestamp(disableTimestamp);
-      perfParams.setDupsOK(dupsOK);
-
-      return perfParams;
-   }
-
-   private final PerfParams perfParams;
-
-   protected PerfBase(final PerfParams perfParams) {
-      this.perfParams = perfParams;
-   }
-
-   private ConnectionFactory factory;
-
-   private Connection connection;
-
-   private Session session;
-
-   private Destination destination;
-
-   private long start;
-
-   private void init() throws Exception {
-      InitialContext ic = new InitialContext();
-      System.out.println("ic = " + ic);
-      factory = (ConnectionFactory) ic.lookup(perfParams.getConnectionFactoryLookup());
-
-      destination = (Destination) ic.lookup(perfParams.getDestinationLookup());
-
-      connection = factory.createConnection();
-
-      session = connection.createSession(perfParams.isSessionTransacted(), perfParams.isDupsOK() ? Session.DUPS_OK_ACKNOWLEDGE : Session.AUTO_ACKNOWLEDGE);
-
-      ic.close();
-   }
-
-   private void displayAverage(final long numberOfMessages, final long start, final long end) {
-      double duration = (1.0 * end - start) / 1000; // in seconds
-      double average = 1.0 * numberOfMessages / duration;
-      PerfBase.log.info(String.format("average: %.2f msg/s (%d messages in %2.2fs)", average, numberOfMessages, duration));
-   }
-
-   protected void runSender() {
-      try {
-         init();
-
-         if (perfParams.isDrainQueue()) {
-            drainQueue();
-         }
-
-         start = System.currentTimeMillis();
-         PerfBase.log.info("warming up by sending " + perfParams.getNoOfWarmupMessages() + " messages");
-         sendMessages(perfParams.getNoOfWarmupMessages(), perfParams.getBatchSize(), perfParams.isDurable(), perfParams.isSessionTransacted(), false, perfParams.getThrottleRate(), perfParams.getMessageSize());
-         PerfBase.log.info("warmed up");
-         start = System.currentTimeMillis();
-         sendMessages(perfParams.getNoOfMessagesToSend(), perfParams.getBatchSize(), perfParams.isDurable(), perfParams.isSessionTransacted(), true, perfParams.getThrottleRate(), perfParams.getMessageSize());
-         long end = System.currentTimeMillis();
-         displayAverage(perfParams.getNoOfMessagesToSend(), start, end);
-      }
-      catch (Exception e) {
-         e.printStackTrace();
-      }
-      finally {
-         if (session != null) {
-            try {
-               session.close();
-            }
-            catch (Exception e) {
-               e.printStackTrace();
-            }
-         }
-         if (connection != null) {
-            try {
-               connection.close();
-            }
-            catch (JMSException e) {
-               e.printStackTrace();
-            }
-         }
-      }
-   }
-
-   protected void runListener() {
-      try {
-         init();
-
-         if (perfParams.isDrainQueue()) {
-            drainQueue();
-         }
-
-         MessageConsumer consumer = session.createConsumer(destination);
-
-         connection.start();
-
-         PerfBase.log.info("READY!!!");
-
-         CountDownLatch countDownLatch = new CountDownLatch(1);
-         consumer.setMessageListener(new PerfListener(countDownLatch, perfParams));
-         countDownLatch.await();
-         long end = System.currentTimeMillis();
-         // start was set on the first received message
-         displayAverage(perfParams.getNoOfMessagesToSend(), start, end);
-      }
-      catch (Exception e) {
-         e.printStackTrace();
-      }
-      finally {
-         if (session != null) {
-            try {
-               session.close();
-            }
-            catch (Exception e) {
-               e.printStackTrace();
-            }
-         }
-         if (connection != null) {
-            try {
-               connection.close();
-            }
-            catch (JMSException e) {
-               e.printStackTrace();
-            }
-         }
-      }
-   }
-
-   private void drainQueue() throws Exception {
-      PerfBase.log.info("Draining queue");
-
-      Session drainSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-      MessageConsumer consumer = drainSession.createConsumer(destination);
-
-      connection.start();
-
-      Message message = null;
-
-      int count = 0;
-      do {
-         message = consumer.receive(3000);
-
-         if (message != null) {
-            message.acknowledge();
-
-            count++;
-         }
-      } while (message != null);
-
-      drainSession.close();
-
-      PerfBase.log.info("Drained " + count + " messages");
-   }
-
-   private void sendMessages(final int numberOfMessages,
-                             final int txBatchSize,
-                             final boolean durable,
-                             final boolean transacted,
-                             final boolean display,
-                             final int throttleRate,
-                             final int messageSize) throws Exception {
-      MessageProducer producer = session.createProducer(destination);
-
-      producer.setDeliveryMode(perfParams.isDurable() ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
-
-      producer.setDisableMessageID(perfParams.isDisableMessageID());
-
-      producer.setDisableMessageTimestamp(perfParams.isDisableTimestamp());
-
-      BytesMessage message = session.createBytesMessage();
-
-      byte[] payload = PerfBase.randomByteArray(messageSize);
-
-      message.writeBytes(payload);
-
-      final int modulo = 2000;
-
-      TokenBucketLimiter tbl = throttleRate != -1 ? new TokenBucketLimiterImpl(throttleRate, false) : null;
-
-      boolean committed = false;
-      for (int i = 1; i <= numberOfMessages; i++) {
-         producer.send(message);
-
-         if (transacted) {
-            if (i % txBatchSize == 0) {
-               session.commit();
-               committed = true;
-            }
-            else {
-               committed = false;
-            }
-         }
-
-         if (display && i % modulo == 0) {
-            double duration = (1.0 * System.currentTimeMillis() - start) / 1000;
-            PerfBase.log.info(String.format("sent %6d messages in %2.2fs", i, duration));
-         }
-
-         if (tbl != null) {
-            tbl.limit();
-         }
-      }
-      if (transacted && !committed) {
-         session.commit();
-      }
-   }
-
-   private class PerfListener implements MessageListener {
-
-      private final CountDownLatch countDownLatch;
-
-      private final PerfParams perfParams;
-
-      private boolean warmingUp = true;
-
-      private boolean started = false;
-
-      private final int modulo;
-
-      private final AtomicLong count = new AtomicLong(0);
-
-      public PerfListener(final CountDownLatch countDownLatch, final PerfParams perfParams) {
-         this.countDownLatch = countDownLatch;
-         this.perfParams = perfParams;
-         warmingUp = perfParams.getNoOfWarmupMessages() > 0;
-         modulo = 2000;
-      }
-
-      public void onMessage(final Message message) {
-         try {
-            if (warmingUp) {
-               boolean committed = checkCommit();
-               if (count.incrementAndGet() == perfParams.getNoOfWarmupMessages()) {
-                  PerfBase.log.info("warmed up after receiving " + count.longValue() + " msgs");
-                  if (!committed) {
-                     checkCommit();
-                  }
-                  warmingUp = false;
-               }
-               return;
-            }
-
-            if (!started) {
-               started = true;
-               // reset count to take stats
-               count.set(0);
-               start = System.currentTimeMillis();
-            }
-
-            long currentCount = count.incrementAndGet();
-            boolean committed = checkCommit();
-            if (currentCount == perfParams.getNoOfMessagesToSend()) {
-               if (!committed) {
-                  checkCommit();
-               }
-               countDownLatch.countDown();
-            }
-            if (currentCount % modulo == 0) {
-               double duration = (1.0 * System.currentTimeMillis() - start) / 1000;
-               PerfBase.log.info(String.format("received %6d messages in %2.2fs", currentCount, duration));
-            }
-         }
-         catch (Exception e) {
-            e.printStackTrace();
-         }
-      }
-
-      private boolean checkCommit() throws Exception {
-         if (perfParams.isSessionTransacted()) {
-            if (count.longValue() % perfParams.getBatchSize() == 0) {
-               session.commit();
-
-               return true;
-            }
-         }
-         return false;
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfListener.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfListener.java b/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfListener.java
deleted file mode 100644
index 3f2c478..0000000
--- a/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfListener.java
+++ /dev/null
@@ -1,46 +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.logging.Logger;
-
-public class PerfListener extends PerfBase {
-
-   private static final Logger log = Logger.getLogger(PerfListener.class.getName());
-
-   public static void main(final String[] args) {
-      try {
-         String fileName = PerfBase.getPerfFileName(args);
-
-         PerfParams params = PerfBase.getParams(fileName);
-
-         new PerfListener(params).run();
-      }
-      catch (Exception e) {
-         e.printStackTrace();
-      }
-   }
-
-   private PerfListener(final PerfParams perfParams) {
-      super(perfParams);
-   }
-
-   public void run() throws Exception {
-      runListener();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfParams.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfParams.java b/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfParams.java
deleted file mode 100644
index c358171..0000000
--- a/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfParams.java
+++ /dev/null
@@ -1,158 +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.io.Serializable;
-
-/**
- * Class that holds the parameters used in the performance examples
- */
-public class PerfParams implements Serializable {
-
-   private static final long serialVersionUID = -4336539641012356002L;
-
-   private int noOfMessagesToSend = 1000;
-
-   private int noOfWarmupMessages;
-
-   private int messageSize = 1024; // in bytes
-
-   private boolean durable = false;
-
-   private boolean isSessionTransacted = false;
-
-   private int batchSize = 5000;
-
-   private boolean drainQueue = true;
-
-   private String connectionFactoryLookup;
-
-   private String destinationLookup;
-
-   private int throttleRate;
-
-   private boolean disableMessageID;
-
-   private boolean disableTimestamp;
-
-   private boolean dupsOK;
-
-   public synchronized int getNoOfMessagesToSend() {
-      return noOfMessagesToSend;
-   }
-
-   public synchronized void setNoOfMessagesToSend(final int noOfMessagesToSend) {
-      this.noOfMessagesToSend = noOfMessagesToSend;
-   }
-
-   public synchronized int getNoOfWarmupMessages() {
-      return noOfWarmupMessages;
-   }
-
-   public synchronized void setNoOfWarmupMessages(final int noOfWarmupMessages) {
-      this.noOfWarmupMessages = noOfWarmupMessages;
-   }
-
-   public synchronized int getMessageSize() {
-      return messageSize;
-   }
-
-   public synchronized void setMessageSize(final int messageSize) {
-      this.messageSize = messageSize;
-   }
-
-   public synchronized boolean isDurable() {
-      return durable;
-   }
-
-   public synchronized void setDurable(final boolean durable) {
-      this.durable = durable;
-   }
-
-   public synchronized boolean isSessionTransacted() {
-      return isSessionTransacted;
-   }
-
-   public synchronized void setSessionTransacted(final boolean isSessionTransacted) {
-      this.isSessionTransacted = isSessionTransacted;
-   }
-
-   public synchronized int getBatchSize() {
-      return batchSize;
-   }
-
-   public synchronized void setBatchSize(final int batchSize) {
-      this.batchSize = batchSize;
-   }
-
-   public synchronized boolean isDrainQueue() {
-      return drainQueue;
-   }
-
-   public synchronized void setDrainQueue(final boolean drainQueue) {
-      this.drainQueue = drainQueue;
-   }
-
-   public synchronized String getConnectionFactoryLookup() {
-      return connectionFactoryLookup;
-   }
-
-   public synchronized void setConnectionFactoryLookup(final String connectionFactoryLookup) {
-      this.connectionFactoryLookup = connectionFactoryLookup;
-   }
-
-   public synchronized String getDestinationLookup() {
-      return destinationLookup;
-   }
-
-   public synchronized void setDestinationLookup(final String destinationLookup) {
-      this.destinationLookup = destinationLookup;
-   }
-
-   public synchronized int getThrottleRate() {
-      return throttleRate;
-   }
-
-   public synchronized void setThrottleRate(final int throttleRate) {
-      this.throttleRate = throttleRate;
-   }
-
-   public synchronized boolean isDisableMessageID() {
-      return disableMessageID;
-   }
-
-   public synchronized void setDisableMessageID(final boolean disableMessageID) {
-      this.disableMessageID = disableMessageID;
-   }
-
-   public synchronized boolean isDisableTimestamp() {
-      return disableTimestamp;
-   }
-
-   public synchronized void setDisableTimestamp(final boolean disableTimestamp) {
-      this.disableTimestamp = disableTimestamp;
-   }
-
-   public synchronized boolean isDupsOK() {
-      return dupsOK;
-   }
-
-   public synchronized void setDupsOK(final boolean dupsOK) {
-      this.dupsOK = dupsOK;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfSender.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfSender.java b/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfSender.java
deleted file mode 100644
index 6649bfa..0000000
--- a/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfSender.java
+++ /dev/null
@@ -1,46 +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.logging.Logger;
-
-public class PerfSender extends PerfBase {
-
-   private static final Logger log = Logger.getLogger(PerfSender.class.getName());
-
-   public static void main(final String[] args) {
-      try {
-         String fileName = PerfBase.getPerfFileName(args);
-
-         PerfParams params = PerfBase.getParams(fileName);
-
-         new PerfSender(params).run();
-      }
-      catch (Exception e) {
-         e.printStackTrace();
-      }
-   }
-
-   private PerfSender(final PerfParams perfParams) {
-      super(perfParams);
-   }
-
-   public void run() throws Exception {
-      runSender();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java b/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java
deleted file mode 100644
index 33ccd0e..0000000
--- a/examples/broker-features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java
+++ /dev/null
@@ -1,27 +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;
-
-public class Server {
-
-   public static void main(String[] arg) {
-      System.out.println("***********************************************************************************");
-      System.out.println("You need to start manually under ./target/server/bin just run ./artemis run");
-      System.out.println("***********************************************************************************");
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/perf/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/perf/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/perf/perf/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index a642ac5..0000000
--- a/examples/broker-features/perf/perf/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?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">
-      <queue name="perfQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <security-enabled>false</security-enabled>
-      <persistence-enabled>true</persistence-enabled>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
-      </acceptors>
-
-      <queues>
-         <queue name="perfQueue">
-            <address>perfAddress</address>
-         </queue>
-      </queues>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/perf/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/perf/src/main/resources/jndi.properties b/examples/broker-features/perf/perf/src/main/resources/jndi.properties
deleted file mode 100644
index bcf6926..0000000
--- a/examples/broker-features/perf/perf/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616?tcp-no-delay=false&tcp-send-buffer-size=1048576&tcp-receive-buffer-size=1048576
-queue.perfQueue=perfQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/perf/src/main/resources/perf.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/perf/src/main/resources/perf.properties b/examples/broker-features/perf/perf/src/main/resources/perf.properties
deleted file mode 100644
index f5ca7be..0000000
--- a/examples/broker-features/perf/perf/src/main/resources/perf.properties
+++ /dev/null
@@ -1,30 +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.
-
-num-messages=100000
-num-warmup-messages=1000
-message-size=1024
-durable=false
-transacted=false
-batch-size=1000
-drain-queue=false
-destination-lookup=perfQueue
-connection-factory-lookup=ConnectionFactory
-throttle-rate=-1
-dups-ok-acknowledge=false
-disable-message-id=true
-disable-message-timestamp=true

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/pom.xml b/examples/broker-features/perf/pom.xml
deleted file mode 100644
index eaafdaf..0000000
--- a/examples/broker-features/perf/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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</groupId>
-      <artifactId>artemis-examples</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <groupId>org.apache.activemq.examples.soak</groupId>
-   <artifactId>perf-root</artifactId>
-   <packaging>pom</packaging>
-   <name>ActiveMQ Artemis Performance Examples</name>
-
-   <!-- Properties -->
-   <properties>
-      <!--
-      Explicitly declaring the source encoding eliminates the following
-      message: [WARNING] Using platform encoding (UTF-8 actually) to copy
-      filtered resources, i.e. build is platform dependent!
-      -->
-      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-      <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
-   </properties>
-
-   <modules>
-      <module>perf</module>
-      <module>soak</module>
-   </modules>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/soak/README
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/soak/README b/examples/broker-features/perf/soak/README
deleted file mode 100644
index b69a1ac..0000000
--- a/examples/broker-features/perf/soak/README
+++ /dev/null
@@ -1,85 +0,0 @@
-****************************************************
-* Soak Test For Manual Reconnection of JMS Clients *
-****************************************************
-
-Running the Soak Tests
-=======================
-
-Run The Server Standalone
-==========================
-
-Use the Profile server
-   mvn -Pserver verify
-
-That will create a server under ./target/server0
-
-
-You can define the property server.dir under the same Profile to create other servers. or you could do it manually if desired using the regular ./artemis create
-
-   $ mvn -Dserver.dir=server1 -Pserver verify
-
-server1 should contain a copy of configuration equivalent to that found under the server0 director with different
-settings.
-
-To run a server with the same configuration but on a different host.  Check out this source on the host machine and
-change:
-* activemq.remoting.netty.host property in broker.xml
-* bindAddress and rmiBindAddress properties in activemq-beans.xml
-
-  $ mvn verify -P server
-
-
-To run the server just start it manually
-
-Configure Server Dump
-=====================
-
-The server can "dump" info at regular interval. In broker.xml, set
-
-   <server-dump-interval>10000</server-dump-interval>
-
-to have infos every 10s:
-
-**** Server Dump ****
-date:            Mon Aug 17 18:19:07 CEST 2009
-free memory:      500,79 MiB
-max memory:       1,95 GiB
-total memory:     507,13 MiB
-available memory: 99,68%
-total paging memory:   0,00 B
-# of thread:     19
-# of conns:      0
-********************
-
-Run The Clients
-===============
-
-The clients can be run separate from the server using:
-
-  $ mvn verify -Premote
-
-Parameters are specified in soak.properties.
-
-The duration of the tests is configured by duration-in-minutes (defaults to 2 minutes, set to
--1 to run the test indefinitely).
-
-To configure the soak properties different to the defaults for the clients, use the system property
-To specify the JNDI server to connect to, use the system property jndi.address
-
-  $ mvn verify -Premote -Dsoak.props=<path to properties> -Pjndi.address=jnp:remote.host:1099
-
-Every 1000th message, the clients will display their recent activity:
-
-INFO: received 10000 messages in 5,71s (total: 55s)
-
-At the end of the run, the sender and receiver will sum up their activity:
-
-INFO: Received 223364 messages in 2,01 minutes
-
-Kill The Server And Check Manual Reconnection
-==============================================
-
-You can kill the server (ctl+c or kill -9), the clients are configured to reconnect
-indefinitely to the same single server (even in case of clean shutdown)
-Once the server restarts, all the clients will resume their activities after reconnecting
-to the server.

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/soak/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/soak/pom.xml b/examples/broker-features/perf/soak/pom.xml
deleted file mode 100644
index eb07b0b..0000000
--- a/examples/broker-features/perf/soak/pom.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-<?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>
-   <artifactId>artemis-jms-soak-example</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis Soak Normal Example</name>
-
-   <parent>
-      <groupId>org.apache.activemq.examples.soak</groupId>
-      <artifactId>perf-root</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-jms-client</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-   </dependencies>
-
-   <properties>
-      <server.dir>${basedir}/server0/</server.dir>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <profiles>
-      <profile>
-         <id>server</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/server0</configuration>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.soak</groupId>
-                        <artifactId>artemis-jms-soak-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-      <profile>
-         <id>local</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>runConsumer</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.soak.example.SoakReceiver</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runProducer</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.soak.example.SoakSender</clientClass>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.soak</groupId>
-                        <artifactId>artemis-jms-soak-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-      <profile>
-         <id>remote</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>runConsumer</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.soak.example.SoakReceiver</clientClass>
-                           <args>
-                              <param>tcp://localhost:61616</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runProducer</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.soak.example.SoakSender</clientClass>
-                           <args>
-                              <param>tcp://localhost:61616</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.soak</groupId>
-                        <artifactId>artemis-jms-soak-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-
-   </profiles>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/soak/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/soak/server0/broker.xml b/examples/broker-features/perf/soak/server0/broker.xml
deleted file mode 100644
index 76df21f..0000000
--- a/examples/broker-features/perf/soak/server0/broker.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?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">
-      <queue name="soakQueue"/>
-   </jms>
-   <core xmlns="urn:activemq:core">
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
-      </acceptors>
-
-      <security-enabled>false</security-enabled>
-
-      <persistence-enabled>false</persistence-enabled>
-
-      <server-dump-interval>30000</server-dump-interval>
-
-      <queues>
-         <queue name="soakQueue">
-            <address>soakAddress</address>
-         </queue>
-      </queues>
-   </core>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/soak/soak.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/soak/soak.properties b/examples/broker-features/perf/soak/soak.properties
deleted file mode 100644
index 2ccff7d..0000000
--- a/examples/broker-features/perf/soak/soak.properties
+++ /dev/null
@@ -1,30 +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.
-
-duration-in-minutes=2
-num-warmup-messages=100
-message-size=1024
-durable=true
-transacted=false
-batch-size=1000
-drain-queue=false
-destination-lookup=soakQueue
-connection-factory-lookup=/ConnectionFactory
-throttle-rate=-1
-dups-ok-acknowledge=false
-disable-message-id=true
-disable-message-timestamp=true

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakBase.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakBase.java b/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakBase.java
deleted file mode 100644
index ce5b9bc..0000000
--- a/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakBase.java
+++ /dev/null
@@ -1,116 +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.soak.example;
-
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.Properties;
-import java.util.Random;
-import java.util.logging.Logger;
-
-public class SoakBase {
-
-   private static final Logger log = Logger.getLogger(SoakBase.class.getName());
-
-   private static final String DEFAULT_SOAK_PROPERTIES_FILE_NAME = "soak.properties";
-
-   public static final int TO_MILLIS = 60 * 1000; // from minute to milliseconds
-
-   public static byte[] randomByteArray(final int length) {
-      byte[] bytes = new byte[length];
-
-      Random random = new Random();
-
-      for (int i = 0; i < length; i++) {
-         bytes[i] = Integer.valueOf(random.nextInt()).byteValue();
-      }
-
-      return bytes;
-   }
-
-   protected static String getPerfFileName() {
-      String fileName = System.getProperty("soak.props");
-      if (fileName == null) {
-         fileName = SoakBase.DEFAULT_SOAK_PROPERTIES_FILE_NAME;
-      }
-      return fileName;
-   }
-
-   protected static SoakParams getParams(final String fileName) throws Exception {
-      Properties props = null;
-
-      InputStream is = null;
-
-      try {
-         is = new FileInputStream(fileName);
-
-         props = new Properties();
-
-         props.load(is);
-      }
-      finally {
-         if (is != null) {
-            is.close();
-         }
-      }
-
-      int durationInMinutes = Integer.valueOf(props.getProperty("duration-in-minutes"));
-      int noOfWarmupMessages = Integer.valueOf(props.getProperty("num-warmup-messages"));
-      int messageSize = Integer.valueOf(props.getProperty("message-size"));
-      boolean durable = Boolean.valueOf(props.getProperty("durable"));
-      boolean transacted = Boolean.valueOf(props.getProperty("transacted"));
-      int batchSize = Integer.valueOf(props.getProperty("batch-size"));
-      boolean drainQueue = Boolean.valueOf(props.getProperty("drain-queue"));
-      String destinationLookup = props.getProperty("destination-lookup");
-      String connectionFactoryLookup = props.getProperty("connection-factory-lookup");
-      int throttleRate = Integer.valueOf(props.getProperty("throttle-rate"));
-      boolean dupsOK = Boolean.valueOf(props.getProperty("dups-ok-acknowlege"));
-      boolean disableMessageID = Boolean.valueOf(props.getProperty("disable-message-id"));
-      boolean disableTimestamp = Boolean.valueOf(props.getProperty("disable-message-timestamp"));
-
-      SoakBase.log.info("duration-in-minutes: " + durationInMinutes);
-      SoakBase.log.info("num-warmup-messages: " + noOfWarmupMessages);
-      SoakBase.log.info("message-size: " + messageSize);
-      SoakBase.log.info("durable: " + durable);
-      SoakBase.log.info("transacted: " + transacted);
-      SoakBase.log.info("batch-size: " + batchSize);
-      SoakBase.log.info("drain-queue: " + drainQueue);
-      SoakBase.log.info("throttle-rate: " + throttleRate);
-      SoakBase.log.info("connection-factory-lookup: " + connectionFactoryLookup);
-      SoakBase.log.info("destination-lookup: " + destinationLookup);
-      SoakBase.log.info("disable-message-id: " + disableMessageID);
-      SoakBase.log.info("disable-message-timestamp: " + disableTimestamp);
-      SoakBase.log.info("dups-ok-acknowledge: " + dupsOK);
-
-      SoakParams soakParams = new SoakParams();
-      soakParams.setDurationInMinutes(durationInMinutes);
-      soakParams.setNoOfWarmupMessages(noOfWarmupMessages);
-      soakParams.setMessageSize(messageSize);
-      soakParams.setDurable(durable);
-      soakParams.setSessionTransacted(transacted);
-      soakParams.setBatchSize(batchSize);
-      soakParams.setDrainQueue(drainQueue);
-      soakParams.setConnectionFactoryLookup(connectionFactoryLookup);
-      soakParams.setDestinationLookup(destinationLookup);
-      soakParams.setThrottleRate(throttleRate);
-      soakParams.setDisableMessageID(disableMessageID);
-      soakParams.setDisableTimestamp(disableTimestamp);
-      soakParams.setDupsOK(dupsOK);
-
-      return soakParams;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakParams.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakParams.java b/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakParams.java
deleted file mode 100644
index dda2ac1..0000000
--- a/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakParams.java
+++ /dev/null
@@ -1,158 +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.soak.example;
-
-import java.io.Serializable;
-
-/**
- * Class that holds the parameters used in the performance examples
- */
-public class SoakParams implements Serializable {
-
-   private static final long serialVersionUID = -4336539641012356002L;
-
-   private int durationInMinutes = 60;
-
-   private int noOfWarmupMessages;
-
-   private int messageSize = 1024; // in bytes
-
-   private boolean durable = false;
-
-   private boolean isSessionTransacted = false;
-
-   private int batchSize = 5000;
-
-   private boolean drainQueue = true;
-
-   private String connectionFactoryLookup;
-
-   private String destinationLookup;
-
-   private int throttleRate;
-
-   private boolean disableMessageID;
-
-   private boolean disableTimestamp;
-
-   private boolean dupsOK;
-
-   public synchronized int getDurationInMinutes() {
-      return durationInMinutes;
-   }
-
-   public synchronized void setDurationInMinutes(final int durationInMinutes) {
-      this.durationInMinutes = durationInMinutes;
-   }
-
-   public synchronized int getNoOfWarmupMessages() {
-      return noOfWarmupMessages;
-   }
-
-   public synchronized void setNoOfWarmupMessages(final int noOfWarmupMessages) {
-      this.noOfWarmupMessages = noOfWarmupMessages;
-   }
-
-   public synchronized int getMessageSize() {
-      return messageSize;
-   }
-
-   public synchronized void setMessageSize(final int messageSize) {
-      this.messageSize = messageSize;
-   }
-
-   public synchronized boolean isDurable() {
-      return durable;
-   }
-
-   public synchronized void setDurable(final boolean durable) {
-      this.durable = durable;
-   }
-
-   public synchronized boolean isSessionTransacted() {
-      return isSessionTransacted;
-   }
-
-   public synchronized void setSessionTransacted(final boolean isSessionTransacted) {
-      this.isSessionTransacted = isSessionTransacted;
-   }
-
-   public synchronized int getBatchSize() {
-      return batchSize;
-   }
-
-   public synchronized void setBatchSize(final int batchSize) {
-      this.batchSize = batchSize;
-   }
-
-   public synchronized boolean isDrainQueue() {
-      return drainQueue;
-   }
-
-   public synchronized void setDrainQueue(final boolean drainQueue) {
-      this.drainQueue = drainQueue;
-   }
-
-   public synchronized String getConnectionFactoryLookup() {
-      return connectionFactoryLookup;
-   }
-
-   public synchronized void setConnectionFactoryLookup(final String connectionFactoryLookup) {
-      this.connectionFactoryLookup = connectionFactoryLookup;
-   }
-
-   public synchronized String getDestinationLookup() {
-      return destinationLookup;
-   }
-
-   public synchronized void setDestinationLookup(final String destinationLookup) {
-      this.destinationLookup = destinationLookup;
-   }
-
-   public synchronized int getThrottleRate() {
-      return throttleRate;
-   }
-
-   public synchronized void setThrottleRate(final int throttleRate) {
-      this.throttleRate = throttleRate;
-   }
-
-   public synchronized boolean isDisableMessageID() {
-      return disableMessageID;
-   }
-
-   public synchronized void setDisableMessageID(final boolean disableMessageID) {
-      this.disableMessageID = disableMessageID;
-   }
-
-   public synchronized boolean isDisableTimestamp() {
-      return disableTimestamp;
-   }
-
-   public synchronized void setDisableTimestamp(final boolean disableTimestamp) {
-      this.disableTimestamp = disableTimestamp;
-   }
-
-   public synchronized boolean isDupsOK() {
-      return dupsOK;
-   }
-
-   public synchronized void setDupsOK(final boolean dupsOK) {
-      this.dupsOK = dupsOK;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakReceiver.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakReceiver.java b/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakReceiver.java
deleted file mode 100644
index ce39968..0000000
--- a/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakReceiver.java
+++ /dev/null
@@ -1,190 +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.soak.example;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.Session;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.util.UUID;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.logging.Logger;
-
-public class SoakReceiver {
-
-   private static final Logger log = Logger.getLogger(SoakReceiver.class.getName());
-
-   private static final String EOF = UUID.randomUUID().toString();
-
-   public static void main(final String[] args) {
-      Runnable runnable = new Runnable() {
-         @Override
-         public void run() {
-
-            try {
-               String fileName = SoakBase.getPerfFileName();
-
-               SoakParams params = SoakBase.getParams(fileName);
-
-               final SoakReceiver receiver = new SoakReceiver(params);
-
-               Runtime.getRuntime().addShutdownHook(new Thread() {
-                  @Override
-                  public void run() {
-                     receiver.disconnect();
-                  }
-               });
-
-               receiver.run();
-            }
-            catch (Exception e) {
-               e.printStackTrace();
-            }
-         }
-      };
-
-      Thread t = new Thread(runnable);
-      t.start();
-   }
-
-   private final SoakParams perfParams;
-
-   private final ExceptionListener exceptionListener = new ExceptionListener() {
-      public void onException(final JMSException e) {
-         disconnect();
-         connect();
-      }
-   };
-
-   private final MessageListener listener = new MessageListener() {
-      int modulo = 10000;
-
-      private final AtomicLong count = new AtomicLong(0);
-
-      private final long start = System.currentTimeMillis();
-
-      long moduloStart = start;
-
-      public void onMessage(final Message msg) {
-         long totalDuration = System.currentTimeMillis() - start;
-
-         try {
-            if (SoakReceiver.EOF.equals(msg.getStringProperty("eof"))) {
-               SoakReceiver.log.info(String.format("Received %s messages in %.2f minutes", count, 1.0 * totalDuration / SoakBase.TO_MILLIS));
-               SoakReceiver.log.info("END OF RUN");
-
-               return;
-            }
-         }
-         catch (JMSException e1) {
-            e1.printStackTrace();
-         }
-         if (count.incrementAndGet() % modulo == 0) {
-            double duration = (1.0 * System.currentTimeMillis() - moduloStart) / 1000;
-            moduloStart = System.currentTimeMillis();
-            SoakReceiver.log.info(String.format("received %s messages in %2.2fs (total: %.0fs)", modulo, duration, totalDuration / 1000.0));
-         }
-      }
-   };
-
-   private Session session;
-
-   private Connection connection;
-
-   private SoakReceiver(final SoakParams perfParams) {
-      this.perfParams = perfParams;
-   }
-
-   public void run() throws Exception {
-      connect();
-
-      boolean runInfinitely = perfParams.getDurationInMinutes() == -1;
-
-      if (!runInfinitely) {
-         Thread.sleep(perfParams.getDurationInMinutes() * SoakBase.TO_MILLIS);
-
-         // send EOF message
-         Message eof = session.createMessage();
-         eof.setStringProperty("eof", SoakReceiver.EOF);
-         listener.onMessage(eof);
-
-         if (connection != null) {
-            connection.close();
-            connection = null;
-         }
-      }
-      else {
-         while (true) {
-            Thread.sleep(500);
-         }
-      }
-   }
-
-   private void disconnect() {
-      if (connection != null) {
-         try {
-            connection.setExceptionListener(null);
-            connection.close();
-         }
-         catch (JMSException e) {
-            e.printStackTrace();
-         }
-         finally {
-            connection = null;
-         }
-      }
-   }
-
-   private void connect() {
-      InitialContext ic = null;
-      try {
-         ic = new InitialContext();
-
-         ConnectionFactory factory = (ConnectionFactory) ic.lookup(perfParams.getConnectionFactoryLookup());
-
-         Destination destination = (Destination) ic.lookup(perfParams.getDestinationLookup());
-
-         connection = factory.createConnection();
-         connection.setExceptionListener(exceptionListener);
-
-         session = connection.createSession(perfParams.isSessionTransacted(), perfParams.isDupsOK() ? Session.DUPS_OK_ACKNOWLEDGE : Session.AUTO_ACKNOWLEDGE);
-
-         MessageConsumer messageConsumer = session.createConsumer(destination);
-         messageConsumer.setMessageListener(listener);
-
-         connection.start();
-      }
-      catch (Exception e) {
-         e.printStackTrace();
-      }
-      finally {
-         try {
-            ic.close();
-         }
-         catch (NamingException e) {
-            e.printStackTrace();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakSender.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakSender.java b/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakSender.java
deleted file mode 100644
index 10fbbd8..0000000
--- a/examples/broker-features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakSender.java
+++ /dev/null
@@ -1,195 +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.soak.example;
-
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.logging.Logger;
-
-import org.apache.activemq.artemis.utils.TokenBucketLimiter;
-import org.apache.activemq.artemis.utils.TokenBucketLimiterImpl;
-
-public class SoakSender {
-
-   private static final Logger log = Logger.getLogger(SoakSender.class.getName());
-
-   public static void main(final String[] args) {
-      try {
-         String fileName = SoakBase.getPerfFileName();
-
-         SoakParams params = SoakBase.getParams(fileName);
-         final SoakSender sender = new SoakSender(params);
-
-         Runtime.getRuntime().addShutdownHook(new Thread() {
-            @Override
-            public void run() {
-               sender.disconnect();
-            }
-         });
-
-         sender.run();
-      }
-      catch (Exception e) {
-         e.printStackTrace();
-      }
-   }
-
-   private final SoakParams perfParams;
-
-   private Connection connection;
-
-   private Session session;
-
-   private MessageProducer producer;
-
-   private final ExceptionListener exceptionListener = new ExceptionListener() {
-      public void onException(final JMSException e) {
-         System.out.println("SoakReconnectableSender.exceptionListener.new ExceptionListener() {...}.onException()");
-         disconnect();
-         connect();
-      }
-
-   };
-
-   private SoakSender(final SoakParams perfParams) {
-      this.perfParams = perfParams;
-   }
-
-   public void run() throws Exception {
-      connect();
-
-      boolean runInfinitely = perfParams.getDurationInMinutes() == -1;
-
-      BytesMessage message = session.createBytesMessage();
-
-      byte[] payload = SoakBase.randomByteArray(perfParams.getMessageSize());
-
-      message.writeBytes(payload);
-
-      final int modulo = 10000;
-
-      TokenBucketLimiter tbl = perfParams.getThrottleRate() != -1 ? new TokenBucketLimiterImpl(perfParams.getThrottleRate(), false) : null;
-
-      boolean transacted = perfParams.isSessionTransacted();
-      int txBatchSize = perfParams.getBatchSize();
-      boolean display = true;
-
-      long start = System.currentTimeMillis();
-      long moduleStart = start;
-      AtomicLong count = new AtomicLong(0);
-      while (true) {
-         try {
-            producer.send(message);
-            count.incrementAndGet();
-
-            if (transacted) {
-               if (count.longValue() % txBatchSize == 0) {
-                  session.commit();
-               }
-            }
-
-            long totalDuration = System.currentTimeMillis() - start;
-
-            if (display && count.longValue() % modulo == 0) {
-               double duration = (1.0 * System.currentTimeMillis() - moduleStart) / 1000;
-               moduleStart = System.currentTimeMillis();
-               SoakSender.log.info(String.format("sent %s messages in %2.2fs (time: %.0fs)", modulo, duration, totalDuration / 1000.0));
-            }
-
-            if (tbl != null) {
-               tbl.limit();
-            }
-
-            if (!runInfinitely && totalDuration > perfParams.getDurationInMinutes() * SoakBase.TO_MILLIS) {
-               break;
-            }
-         }
-         catch (Exception e) {
-            e.printStackTrace();
-         }
-      }
-
-      SoakSender.log.info(String.format("Sent %s messages in %s minutes", count, perfParams.getDurationInMinutes()));
-      SoakSender.log.info("END OF RUN");
-
-      if (connection != null) {
-         connection.close();
-         connection = null;
-      }
-   }
-
-   private synchronized void disconnect() {
-      if (connection != null) {
-         try {
-            connection.setExceptionListener(null);
-            connection.close();
-         }
-         catch (JMSException e) {
-            e.printStackTrace();
-         }
-         finally {
-            connection = null;
-         }
-      }
-   }
-
-   private void connect() {
-      InitialContext ic = null;
-      try {
-         ic = new InitialContext();
-
-         ConnectionFactory factory = (ConnectionFactory) ic.lookup(perfParams.getConnectionFactoryLookup());
-
-         Destination destination = (Destination) ic.lookup(perfParams.getDestinationLookup());
-
-         connection = factory.createConnection();
-
-         session = connection.createSession(perfParams.isSessionTransacted(), perfParams.isDupsOK() ? Session.DUPS_OK_ACKNOWLEDGE : Session.AUTO_ACKNOWLEDGE);
-
-         producer = session.createProducer(destination);
-
-         producer.setDeliveryMode(perfParams.isDurable() ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
-
-         producer.setDisableMessageID(perfParams.isDisableMessageID());
-
-         producer.setDisableMessageTimestamp(perfParams.isDisableTimestamp());
-
-         connection.setExceptionListener(exceptionListener);
-      }
-      catch (Exception e) {
-         e.printStackTrace();
-      }
-      finally {
-         try {
-            ic.close();
-         }
-         catch (NamingException e) {
-            e.printStackTrace();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/perf/soak/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/perf/soak/src/main/resources/jndi.properties b/examples/broker-features/perf/soak/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/perf/soak/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/pom.xml b/examples/broker-features/pom.xml
deleted file mode 100644
index f5afbee..0000000
--- a/examples/broker-features/pom.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?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</groupId>
-      <artifactId>artemis-examples</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <groupId>org.apache.activemq.examples.clustered</groupId>
-   <artifactId>broker-features</artifactId>
-   <packaging>pom</packaging>
-   <name>ActiveMQ Artemis Clustered Examples</name>
-
-   <!-- Properties -->
-   <properties>
-      <!--
-      Explicitly declaring the source encoding eliminates the following
-      message: [WARNING] Using platform encoding (UTF-8 actually) to copy
-      filtered resources, i.e. build is platform dependent!
-      -->
-      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-      <activemq.basedir>${project.basedir}/../..</activemq.basedir>
-   </properties>
-
-   <profiles>
-      <profile>
-         <id>examples</id>
-         <modules>
-            <module>clustered</module>
-            <module>ha</module>
-            <module>standard</module>
-            <module>sub-modules</module>
-            <module>perf</module>
-         </modules>
-      </profile>
-      <profile>
-         <id>release</id>
-         <modules>
-            <module>clustered</module>
-            <module>ha</module>
-            <module>standard</module>
-            <module>sub-modules</module>
-            <module>perf</module>
-         </modules>
-      </profile>
-   </profiles>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/README.md
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/README.md b/examples/broker-features/standard/README.md
deleted file mode 100644
index e9d9e36..0000000
--- a/examples/broker-features/standard/README.md
+++ /dev/null
@@ -1,32 +0,0 @@
-Running the ActiveMQ Artemis Examples
-============================
-
-To run an individual example firstly cd into the example directory and run
-
-```sh
-mvn verify
-```
-
-Most examples offer a way to start them without creating and starting the server (say if you want to do it manually)
-
-```sh
-mvn verify -PnoServer
-```
-
-If you are running against an un released version, i.e. from master branch, you will have to run `mvn install` on the root
-pom.xml and the example/activemq-jms-examples-common/pom.xml first.
-
-If you want to run all the examples (except those that need to be run standalone) you can run `mvn verify -Pexamples` in the examples
-directory but before you do you will need to up the memory used by running:
-
-```
-export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m"
-```
-### Recreating the examples
-
-If you are trying to copy the examples somewhere else and modifying them. Consider asking Maven to explicitly list all the dependencies:
-
-```
-# if trying to modify the 'topic' example:
-cd examples/jms/topic && mvn dependency:list
-```


[19/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java b/examples/features/ha/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java
new file mode 100644
index 0000000..ab0baec
--- /dev/null
+++ b/examples/features/ha/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java
@@ -0,0 +1,142 @@
+/*
+ * 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 org.apache.activemq.artemis.util.ServerUtil;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+public class MultipleFailoverFailbackExample {
+
+   public static void main(final String[] args) throws Exception {
+      final int numMessages = 30;
+
+      Connection connection = null;
+
+      InitialContext initialContext = null;
+
+      Process[] servers = new Process[3];
+
+      try {
+         for (int i = 0; i < args.length; i++) {
+            servers[i] = ServerUtil.startServer(args[i], MultipleFailoverFailbackExample.class.getSimpleName() + i, i, 5000);
+         }
+
+         // Step 1. Get an initial context for looking up JNDI from the server #1
+         initialContext = new InitialContext();
+
+         // Step 2. Look up the JMS resources from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 3. Create a JMS Connection
+         connection = connectionFactory.createConnection();
+
+         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
+         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+         // Step 5. Start the connection to ensure delivery occurs
+         connection.start();
+
+         // Step 6. Create a JMS MessageProducer and a MessageConsumer
+         MessageProducer producer = session.createProducer(queue);
+         MessageConsumer consumer = session.createConsumer(queue);
+
+         // Step 7. Send some messages to server #1, the live server
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session.createTextMessage("This is text message " + i);
+            producer.send(message);
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 8. Receive and acknowledge a third of the sent messages
+         TextMessage message0 = null;
+         for (int i = 0; i < numMessages / 3; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+         message0.acknowledge();
+
+         // Step 9. Receive the rest third of the sent messages but *do not* acknowledge them yet
+         for (int i = numMessages / 3; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+
+         // Step 10. Crash server #1, the live server, and wait a little while to make sure
+         // it has really crashed
+         ServerUtil.killServer(servers[0]);
+
+         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
+         // backup server has occurred
+         try {
+            message0.acknowledge();
+         }
+         catch (JMSException e) {
+            System.err.println("Got exception while acknowledging message: " + e.getMessage());
+         }
+
+         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
+         for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
+         }
+         message0.acknowledge();
+
+         servers[0] = ServerUtil.startServer(args[0], MultipleFailoverFailbackExample.class.getSimpleName() + 0, 0, 5000);
+
+         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
+         // backup server has occurred
+         try {
+            message0.acknowledge();
+         }
+         catch (JMSException e) {
+            System.err.println("Got exception while acknowledging message: " + e.getMessage());
+         }
+
+         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
+         for (int i = (numMessages / 3) * 2; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
+         }
+         message0.acknowledge();
+      }
+      finally {
+         // Step 13. Be sure to close our resources!
+
+         if (connection != null) {
+            connection.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+
+         for (int i = 0; i < args.length; i++) {
+            ServerUtil.killServer(servers[i]);
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/multiple-failover-failback/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/ha/multiple-failover-failback/src/main/resources/jndi.properties b/examples/features/ha/multiple-failover-failback/src/main/resources/jndi.properties
new file mode 100644
index 0000000..7f7a19f
--- /dev/null
+++ b/examples/features/ha/multiple-failover-failback/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/6b17d966/examples/features/ha/multiple-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/multiple-failover/pom.xml b/examples/features/ha/multiple-failover/pom.xml
new file mode 100644
index 0000000..a9a0b03
--- /dev/null
+++ b/examples/features/ha/multiple-failover/pom.xml
@@ -0,0 +1,121 @@
+<?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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>multiple-failover</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Multiple Failover Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.geronimo.specs</groupId>
+         <artifactId>geronimo-jms_2.0_spec</artifactId>
+      </dependency>
+   </dependencies>
+
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>false</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>true</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server2</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>true</slave>
+                     <dataFolder>../data</dataFolder>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.MultipleFailoverExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                        <param>${basedir}/target/server2</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>multiple-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java b/examples/features/ha/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java
new file mode 100644
index 0000000..41d9e52
--- /dev/null
+++ b/examples/features/ha/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java
@@ -0,0 +1,142 @@
+/*
+ * 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 org.apache.activemq.artemis.util.ServerUtil;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+public class MultipleFailoverExample {
+
+   public static void main(final String[] args) throws Exception {
+      final int numMessages = 30;
+
+      Connection connection = null;
+
+      InitialContext initialContext = null;
+
+      Process[] servers = new Process[3];
+
+      try {
+         for (int i = 0; i < args.length; i++) {
+            servers[i] = ServerUtil.startServer(args[i], MultipleFailoverExample.class.getSimpleName() + i, i, 5000);
+         }
+
+         // Step 1. Get an initial context for looking up JNDI from the server #1
+         initialContext = new InitialContext();
+
+         // Step 2. Look up the JMS resources from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 3. Create a JMS Connection
+         connection = connectionFactory.createConnection();
+
+         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
+         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+         // Step 5. Start the connection to ensure delivery occurs
+         connection.start();
+
+         // Step 6. Create a JMS MessageProducer and a MessageConsumer
+         MessageProducer producer = session.createProducer(queue);
+         MessageConsumer consumer = session.createConsumer(queue);
+
+         // Step 7. Send some messages to server #1, the live server
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session.createTextMessage("This is text message " + i);
+            producer.send(message);
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 8. Receive and acknowledge a third of the sent messages
+         TextMessage message0 = null;
+         for (int i = 0; i < numMessages / 3; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+         message0.acknowledge();
+
+         // Step 9. Receive the rest third of the sent messages but *do not* acknowledge them yet
+         for (int i = numMessages / 3; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+
+         // Step 10. Crash server #1, the live server, and wait a little while to make sure
+         // it has really crashed
+         ServerUtil.killServer(servers[0]);
+
+         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
+         // backup server has occurred
+         try {
+            message0.acknowledge();
+         }
+         catch (JMSException e) {
+            System.err.println("Got exception while acknowledging message: " + e.getMessage());
+         }
+
+         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
+         for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
+         }
+         message0.acknowledge();
+
+         ServerUtil.killServer(servers[ServerUtil.getServer(connection)]);
+
+         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
+         // backup server has occurred
+         try {
+            message0.acknowledge();
+         }
+         catch (JMSException e) {
+            throw new IllegalStateException("Got exception while acknowledging message: " + e.getMessage());
+         }
+
+         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
+         for (int i = (numMessages / 3) * 2; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
+         }
+         message0.acknowledge();
+      }
+      finally {
+         // Step 13. Be sure to close our resources!
+
+         if (connection != null) {
+            connection.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+
+         for (int i = 0; i < args.length; i++) {
+            ServerUtil.killServer(servers[i]);
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/multiple-failover/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/ha/multiple-failover/src/main/resources/jndi.properties b/examples/features/ha/multiple-failover/src/main/resources/jndi.properties
new file mode 100644
index 0000000..7f7a19f
--- /dev/null
+++ b/examples/features/ha/multiple-failover/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/6b17d966/examples/features/ha/non-transaction-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/non-transaction-failover/pom.xml b/examples/features/ha/non-transaction-failover/pom.xml
new file mode 100644
index 0000000..1b5a600
--- /dev/null
+++ b/examples/features/ha/non-transaction-failover/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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>non-transaction-failover</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Non Transaction Failover Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>false</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>true</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.NonTransactionFailoverExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>non-transaction-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/non-transaction-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/ha/non-transaction-failover/readme.html b/examples/features/ha/non-transaction-failover/readme.html
new file mode 100644
index 0000000..647e7b8
--- /dev/null
+++ b/examples/features/ha/non-transaction-failover/readme.html
@@ -0,0 +1,157 @@
+<!--
+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 Failover Without Transactions 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 Failover Without Transactions Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
+
+
+     <p>This example demonstrates two servers coupled as a live-backup pair for high availability (HA), and a client
+     connection failing over from live to backup when the live server is crashed.</p>
+     <p>Failover behavior differs whether the JMS session is transacted or not.</p>
+     <p>When a <em>non-transacted</em> JMS session is used, once and only once delivery is not guaranteed
+        and it is possible some messages will be lost or delivered twice, depending when the failover to the backup server occurs.</p>
+     <p>It is up to the client to deal with such cases. To ensure once and only once delivery, the client must
+        use transacted JMS sessions (as shown in the example for <a href="../transaction-failover/readme.html">failover with transactions</a>).</p>
+     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
+     section of the user manual.</p>
+
+     <h2>Example step-by-step</h2>
+     <p>In this example, the live server is server 1, and the backup server is server 0</p>
+     <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
+     seamlessly on server 0, the backup server.</p>
+     <ol>
+        <li>Get an initial context for looking up JNDI from server #1.</li>
+        <pre class="prettyprint">
+           initialContext = getContext(1);
+        </pre>
+
+        <li>Look up the JMS resources from JNDI on server #1.</li>
+        <pre class="prettyprint">
+           Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
+           ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
+        </pre>
+
+        <li>Create a JMS Connection</li>
+        <pre class="prettyprint">
+           connection = connectionFactory.createConnection();
+        </pre>
+
+        <li>Create a JMS <em>non-transacted</em> Session with client acknowledgement</li>
+        <pre class="prettyprint">
+           Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+        </pre>
+
+        <li>Start the connection to ensure delivery occurs</li>
+        <pre class="prettyprint">
+           connection.start();
+        </pre>
+
+        <li>Create a JMS MessageProducer and MessageConsumer</li>
+        <pre class="prettyprint">
+           MessageProducer producer = session.createProducer(queue);
+           MessageConsumer consumer = session.createConsumer(queue);
+        </pre>
+
+        <li>Send some messages to server #1</li>
+        <pre class="prettyprint">
+           for (int i = 0; i &lt; numMessages; i++)
+           {
+              TextMessage message = session.createTextMessage("This is text message " + i);
+              producer.send(message);
+              System.out.println("Sent message: " + message.getText());
+           }
+        </pre>
+
+        <li>Receive and acknowledge half of the sent messages</li>
+        <pre class="prettyprint">
+           TextMessage message0 = null;
+           for (int i = 0; i &lt; numMessages / 2; i++)
+           {
+              message0 = (TextMessage)consumer.receive(5000);
+              System.out.println("Got message: " + message0.getText());
+           }
+           message0.acknowledge();
+        </pre>
+
+        <li>Receive the second half of the sent messages but <em>do not acknowledge them yet</em></li>
+        <pre class="prettyprint">
+           for (int i = numMessages / 2; i &lt; numMessages; i++)
+           {
+              message0 = (TextMessage)consumer.receive(5000);
+              System.out.println("Got message: " + message0.getText());
+           }
+        </pre>
+
+        <li>Crash server #1, the live server, and wait a little while to make sure it has really crashed.</li>
+        <pre class="prettyprint">
+           killServer(1);
+           Thread.sleep(2000);
+        </pre>
+
+        <li>Acknowledging the second half of the sent messages will fail as failover to the backup server has occurred</li>
+        <pre class="prettyprint">
+           try
+           {
+              message0.acknowledge();
+           }
+           catch (JMSException e)
+           {
+              System.err.println("Got exception while acknowledging message: " + e.getMessage());
+           }
+        </pre>
+
+         <li>Consume again the second half of the messages againg. Note that they are not considered as redelivered</li>
+        <pre class="prettyprint">
+           for (int i = numMessages / 2; i &lt; numMessages; i++)
+           {
+              message0 = (TextMessage)consumer.receive(5000);
+              System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
+           }
+           message0.acknowledge();
+        </pre>
+
+        <li>And finally, <strong>always</strong> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
+
+        <pre class="prettyprint">
+           finally
+           {
+              if (connection != null)
+              {
+                 connection.close();
+              }
+
+              if (initialContext != null)
+              {
+                 initialContext.close();
+              }
+           }
+        </pre>
+
+     </ol>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java b/examples/features/ha/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java
new file mode 100644
index 0000000..9352ac5
--- /dev/null
+++ b/examples/features/ha/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java
@@ -0,0 +1,128 @@
+/*
+ * 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 org.apache.activemq.artemis.util.ServerUtil;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+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 example that demonstrates failover of the JMS connection from one node to another
+ * when the live server crashes using a JMS <em>non-transacted</em> session.
+ */
+public class NonTransactionFailoverExample {
+
+   public static void main(final String[] args) throws Exception {
+      final int numMessages = 10;
+
+      Connection connection = null;
+
+      InitialContext initialContext = null;
+
+      Process[] servers = new Process[2];
+
+      try {
+         for (int i = 0; i < args.length; i++) {
+            servers[i] = ServerUtil.startServer(args[i], NonTransactionFailoverExample.class.getSimpleName() + i, i, 5000);
+         }
+
+         // Step 1. Get an initial context for looking up JNDI from the server #1
+         initialContext = new InitialContext();
+
+         // Step 2. Look up the JMS resources from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 3. Create a JMS Connection
+         connection = connectionFactory.createConnection();
+
+         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
+         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+         // Step 5. Start the connection to ensure delivery occurs
+         connection.start();
+
+         // Step 6. Create a JMS MessageProducer and a MessageConsumer
+         MessageProducer producer = session.createProducer(queue);
+         MessageConsumer consumer = session.createConsumer(queue);
+
+         // Step 7. Send some messages to server #1, the live server
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session.createTextMessage("This is text message " + i);
+            producer.send(message);
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 8. Receive and acknowledge half of the sent messages
+         TextMessage message0 = null;
+         for (int i = 0; i < numMessages / 2; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+         message0.acknowledge();
+
+         // Step 9. Receive the 2nd half of the sent messages but *do not* acknowledge them yet
+         for (int i = numMessages / 2; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+
+         // Step 10. Crash server #1, the live server, and wait a little while to make sure
+         // pending Acks are on the server's side
+         ServerUtil.killServer(servers[0]);
+
+         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
+         // backup server has occurred
+         try {
+            message0.acknowledge();
+         }
+         catch (JMSException e) {
+            System.err.println("Got exception while acknowledging message: " + e.getMessage());
+         }
+
+         // Step 12. Consume again the 2nd half of the messages again. Note that they are not considered as redelivered.
+         for (int i = numMessages / 2; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
+         }
+         message0.acknowledge();
+      }
+      finally {
+         // Step 13. Be sure to close our resources!
+
+         if (connection != null) {
+            connection.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+
+         for (int i = 0; i < args.length; i++) {
+            ServerUtil.killServer(servers[i]);
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/non-transaction-failover/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/ha/non-transaction-failover/src/main/resources/jndi.properties b/examples/features/ha/non-transaction-failover/src/main/resources/jndi.properties
new file mode 100644
index 0000000..7f7a19f
--- /dev/null
+++ b/examples/features/ha/non-transaction-failover/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/6b17d966/examples/features/ha/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/pom.xml b/examples/features/ha/pom.xml
new file mode 100644
index 0000000..016d9b1
--- /dev/null
+++ b/examples/features/ha/pom.xml
@@ -0,0 +1,95 @@
+<?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.clustered</groupId>
+      <artifactId>broker-features</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <groupId>org.apache.activemq.examples.failover</groupId>
+   <artifactId>broker-failover</artifactId>
+   <packaging>pom</packaging>
+   <name>ActiveMQ Artemis Failover Examples</name>
+
+   <!-- Properties -->
+   <properties>
+      <!--
+      Explicitly declaring the source encoding eliminates the following
+      message: [WARNING] Using platform encoding (UTF-8 actually) to copy
+      filtered resources, i.e. build is platform dependent!
+      -->
+      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+      <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
+   </properties>
+
+   <profiles>
+      <profile>
+         <id>release</id>
+         <modules>
+            <module>application-layer-failover</module>
+            <module>client-side-failoverlistener</module>
+            <module>colocated-failover</module>
+            <module>colocated-failover-scale-down</module>
+            <module>ha-policy-autobackup</module>
+            <module>multiple-failover</module>
+            <module>multiple-failover-failback</module>
+            <module>non-transaction-failover</module>
+            <module>replicated-failback</module>
+            <module>replicated-failback-static</module>
+            <module>replicated-multiple-failover</module>
+            <module>replicated-transaction-failover</module>
+            <module>scale-down</module>
+            <module>stop-server-failover</module>
+            <module>transaction-failover</module>
+         </modules>
+      </profile>
+      <profile>
+         <id>examples</id>
+         <modules>
+            <module>application-layer-failover</module>
+            <module>client-side-failoverlistener</module>
+
+            <!-- ARTEMIS-197 FIX ME:
+            <module>colocated-failover</module>
+            <module>colocated-failover-scale-down</module> -->
+
+            <module>ha-policy-autobackup</module>
+            <module>multiple-failover</module>
+            <module>multiple-failover-failback</module>
+            <module>non-transaction-failover</module>
+
+            <!-- ARTEMIS-197 FIX ME:
+            <module>replicated-failback</module>
+            <module>replicated-failback-static</module> -->
+
+            <module>replicated-multiple-failover</module>
+            <module>replicated-transaction-failover</module>
+            <module>scale-down</module>
+            <module>transaction-failover</module>
+         </modules>
+      </profile>
+   </profiles>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-failback-static/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback-static/pom.xml b/examples/features/ha/replicated-failback-static/pom.xml
new file mode 100644
index 0000000..91bb01e
--- /dev/null
+++ b/examples/features/ha/replicated-failback-static/pom.xml
@@ -0,0 +1,104 @@
+<?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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>replicated-failback-static</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Replicated Failback Static Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedFailbackStaticExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>replicated-failback-static</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-failback-static/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback-static/readme.html b/examples/features/ha/replicated-failback-static/readme.html
new file mode 100644
index 0000000..cab789a
--- /dev/null
+++ b/examples/features/ha/replicated-failback-static/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 Failback using Static selectors 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 Multiple Failover using Replication Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
+
+     <p>This example demonstrates three servers coupled as a live-backup-backup group for high availability (HA) using replication, and a client
+     connection failing over from live to backup when the live server is crashed and then to the second backup once the new live fails.</p>
+
+     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
+     section of the user manual.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java b/examples/features/ha/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java
new file mode 100644
index 0000000..d2f74ba
--- /dev/null
+++ b/examples/features/ha/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java
@@ -0,0 +1,149 @@
+/*
+ * 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 org.apache.activemq.artemis.util.ServerUtil;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+/**
+ * Example of live and replicating backup pair.
+ * <p>
+ * After both servers are started, the live server is killed and the backup becomes active ("fails-over").
+ * <p>
+ * Later the live server is restarted and takes back its position by asking the backup to stop ("fail-back").
+ */
+public class ReplicatedFailbackStaticExample {
+
+   private static Process server0;
+
+   private static Process server1;
+
+   public static void main(final String[] args) throws Exception {
+      final int numMessages = 30;
+
+      Connection connection = null;
+
+      InitialContext initialContext = null;
+
+      try {
+         server0 = ServerUtil.startServer(args[0], ReplicatedFailbackStaticExample.class.getSimpleName() + "0", 0, 30000);
+         server1 = ServerUtil.startServer(args[1], ReplicatedFailbackStaticExample.class.getSimpleName() + "1", 1, 10000);
+
+         // Step 1. Get an initial context for looking up JNDI from the server #1
+         initialContext = new InitialContext();
+
+         // Step 2. Look up the JMS resources from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 3. Create a JMS Connection
+         connection = connectionFactory.createConnection();
+
+         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
+         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+         // Step 5. Start the connection to ensure delivery occurs
+         connection.start();
+
+         // Step 6. Create a JMS MessageProducer and a MessageConsumer
+         MessageProducer producer = session.createProducer(queue);
+         MessageConsumer consumer = session.createConsumer(queue);
+
+         // Step 7. Send some messages to server #1, the live server
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session.createTextMessage("This is text message " + i);
+            producer.send(message);
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 8. Receive and acknowledge a third of the sent messages
+         TextMessage message0 = null;
+         for (int i = 0; i < numMessages / 3; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+         message0.acknowledge();
+
+         // Step 9. Receive the rest third of the sent messages but *do not* acknowledge them yet
+         for (int i = numMessages / 3; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+
+         // Step 10. Crash server #0, the live server, and wait a little while to make sure
+         // it has really crashed
+         ServerUtil.killServer(server0);
+
+         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
+         // backup server has occurred
+         try {
+            message0.acknowledge();
+         }
+         catch (JMSException e) {
+            System.out.println("Got (the expected) exception while acknowledging message: " + e.getMessage());
+         }
+
+         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
+         for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
+         }
+         message0.acknowledge();
+
+         server0 = ServerUtil.startServer(args[0], ReplicatedFailbackStaticExample.class.getSimpleName() + "0", 0, 10000);
+
+         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
+         // backup server has occurred
+         try {
+            message0.acknowledge();
+         }
+         catch (JMSException e) {
+            System.err.println("Got exception while acknowledging message: " + e.getMessage());
+         }
+
+         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
+         for (int i = (numMessages / 3) * 2; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
+         }
+         message0.acknowledge();
+      }
+      finally {
+         // Step 13. Be sure to close our resources!
+
+         if (connection != null) {
+            connection.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..f6fa349
--- /dev/null
+++ b/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,87 @@
+<?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>
+
+      <cluster-user>exampleUser</cluster-user>
+
+      <cluster-password>secret</cluster-password>
+
+      <ha-policy>
+         <replication>
+            <master>
+               <!--we need this for auto failback-->
+               <check-for-live-server>true</check-for-live-server>
+            </master>
+         </replication>
+      </ha-policy>
+
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+         <connector name="netty-backup-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <static-connectors>
+               <connector-ref>netty-backup-connector</connector-ref>
+            </static-connectors>
+         </cluster-connection>
+      </cluster-connections>
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..9b89d80
--- /dev/null
+++ b/examples/features/ha/replicated-failback-static/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,89 @@
+<?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>
+
+      <cluster-user>exampleUser</cluster-user>
+
+      <cluster-password>secret</cluster-password>
+
+      <ha-policy>
+         <replication>
+            <slave>
+               <allow-failback>true</allow-failback>
+               <!-- not needed but tells the backup not to restart after failback as there will be > 0 backups saved -->
+               <max-saved-replicated-journals-size>0</max-saved-replicated-journals-size>
+            </slave>
+         </replication>
+      </ha-policy>
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-live-connector">tcp://localhost:61616</connector>
+         <connector name="netty-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <static-connectors>
+               <connector-ref>netty-live-connector</connector-ref>
+            </static-connectors>
+         </cluster-connection>
+      </cluster-connections>
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-failback-static/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback-static/src/main/resources/jndi.properties b/examples/features/ha/replicated-failback-static/src/main/resources/jndi.properties
new file mode 100644
index 0000000..7f7a19f
--- /dev/null
+++ b/examples/features/ha/replicated-failback-static/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/6b17d966/examples/features/ha/replicated-failback/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback/pom.xml b/examples/features/ha/replicated-failback/pom.xml
new file mode 100644
index 0000000..d996718
--- /dev/null
+++ b/examples/features/ha/replicated-failback/pom.xml
@@ -0,0 +1,103 @@
+<?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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>replicated-failback</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Replicated Failback Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.geronimo.specs</groupId>
+         <artifactId>geronimo-jms_2.0_spec</artifactId>
+      </dependency>
+   </dependencies>
+
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedFailbackExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>replicated-failback</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-failback/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback/readme.html b/examples/features/ha/replicated-failback/readme.html
new file mode 100644
index 0000000..4e53739
--- /dev/null
+++ b/examples/features/ha/replicated-failback/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 Multiple Failover using Replication 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 Multiple Failover using Replication Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
+
+     <p>This example demonstrates three servers coupled as a live-backup-backup group for high availability (HA) using replication, and a client
+     connection failing over from live to backup when the live server is crashed and then to the second backup once the new live fails.</p>
+
+     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
+     section of the user manual.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java b/examples/features/ha/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java
new file mode 100644
index 0000000..29ae381
--- /dev/null
+++ b/examples/features/ha/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java
@@ -0,0 +1,149 @@
+/*
+ * 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 org.apache.activemq.artemis.util.ServerUtil;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+/**
+ * Example of live and replicating backup pair.
+ * <p>
+ * After both servers are started, the live server is killed and the backup becomes active ("fails-over").
+ * <p>
+ * Later the live server is restarted and takes back its position by asking the backup to stop ("fail-back").
+ */
+public class ReplicatedFailbackExample {
+
+   private static Process server0;
+
+   private static Process server1;
+
+   public static void main(final String[] args) throws Exception {
+      final int numMessages = 30;
+
+      Connection connection = null;
+
+      InitialContext initialContext = null;
+
+      try {
+         server0 = ServerUtil.startServer(args[0], ReplicatedFailbackExample.class.getSimpleName() + "0", 0, 30000);
+         server1 = ServerUtil.startServer(args[1], ReplicatedFailbackExample.class.getSimpleName() + "1", 1, 10000);
+
+         // Step 1. Get an initial context for looking up JNDI from the server #1
+         initialContext = new InitialContext();
+
+         // Step 2. Look up the JMS resources from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 3. Create a JMS Connection
+         connection = connectionFactory.createConnection();
+
+         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
+         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+         // Step 5. Start the connection to ensure delivery occurs
+         connection.start();
+
+         // Step 6. Create a JMS MessageProducer and a MessageConsumer
+         MessageProducer producer = session.createProducer(queue);
+         MessageConsumer consumer = session.createConsumer(queue);
+
+         // Step 7. Send some messages to server #1, the live server
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session.createTextMessage("This is text message " + i);
+            producer.send(message);
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 8. Receive and acknowledge a third of the sent messages
+         TextMessage message0 = null;
+         for (int i = 0; i < numMessages / 3; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+         message0.acknowledge();
+
+         // Step 9. Receive the rest third of the sent messages but *do not* acknowledge them yet
+         for (int i = numMessages / 3; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+
+         // Step 10. Crash server #0, the live server, and wait a little while to make sure
+         // it has really crashed
+         ServerUtil.killServer(server0);
+
+         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
+         // backup server has occurred
+         try {
+            message0.acknowledge();
+         }
+         catch (JMSException e) {
+            System.out.println("Got (the expected) exception while acknowledging message: " + e.getMessage());
+         }
+
+         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
+         for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
+         }
+         message0.acknowledge();
+
+         server0 = ServerUtil.startServer(args[0], ReplicatedFailbackExample.class.getSimpleName() + "0", 0, 10000);
+
+         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
+         // backup server has occurred
+         try {
+            message0.acknowledge();
+         }
+         catch (JMSException e) {
+            System.err.println("Got exception while acknowledging message: " + e.getMessage());
+         }
+
+         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
+         for (int i = (numMessages / 3) * 2; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
+         }
+         message0.acknowledge();
+      }
+      finally {
+         // Step 13. Be sure to close our resources!
+
+         if (connection != null) {
+            connection.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/replicated-failback/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/replicated-failback/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/replicated-failback/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..c7f4783
--- /dev/null
+++ b/examples/features/ha/replicated-failback/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,101 @@
+<?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>
+
+      <cluster-user>exampleUser</cluster-user>
+
+      <cluster-password>secret</cluster-password>
+
+      <ha-policy>
+         <replication>
+            <master>
+               <!--we need this for auto failback-->
+               <check-for-live-server>true</check-for-live-server>
+            </master>
+         </replication>
+      </ha-policy>
+
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <broadcast-groups>
+         <broadcast-group name="bg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>1000</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="dg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>5000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <discovery-group-ref discovery-group-name="dg-group1"/>
+         </cluster-connection>
+      </cluster-connections>
+      <!-- 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-settings>
+
+   </core>
+</configuration>


[03/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic-hierarchies/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-hierarchies/pom.xml b/examples/features/standard/topic-hierarchies/pom.xml
new file mode 100644
index 0000000..e3fe3f8
--- /dev/null
+++ b/examples/features/standard/topic-hierarchies/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>topic-hierarchies</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Topic Hierarchies 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>
+                     <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.TopicHierarchyExample</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>topic-hierarchies</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic-hierarchies/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-hierarchies/readme.html b/examples/features/standard/topic-hierarchies/readme.html
new file mode 100644
index 0000000..0aa16ca
--- /dev/null
+++ b/examples/features/standard/topic-hierarchies/readme.html
@@ -0,0 +1,42 @@
+<!--
+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 Topic Hierarchy 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>Topic Hierarchy 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>ActiveMQ Artemis supports topic hierarchies. With a topic hierarchy you can register a subscriber with a wild-card
+     and that subscriber will receive any messages routed to an address that match the wildcard.</p>
+     <p>ActiveMQ Artemis wild-cards can use the character '#' which means "match any number of words", and
+     the character '*' which means "match a single word". Words are delimited by the character "."</p>
+     <p>For example if I subscribe using the wild-card "news.europe.#", then that would match messages sent to the addresses
+     "news.europe", "news.europe.sport" and "news.europe.entertainment", but it does not match messages sent to the
+     address "news.usa.wrestling"</p>
+     <p>For more information on the wild-card syntax please consult the user manual.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java b/examples/features/standard/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java
new file mode 100644
index 0000000..0a720da
--- /dev/null
+++ b/examples/features/standard/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java
@@ -0,0 +1,121 @@
+/*
+ * 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.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.naming.InitialContext;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+
+/**
+ * This example demonstrates how a JMS TopicSubscriber can be created to subscribe to a wild-card Topic.
+ *
+ * For more information please see the readme.html
+ */
+public class TopicHierarchyExample {
+
+   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 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. Instantiate a topic representing the wildcard we're going to subscribe to
+         Topic topicSubscribe = ActiveMQJMSClient.createTopic("news.europe.#");
+
+         // Step 7. Create a consumer (topic subscriber) that will consume using that wildcard
+         // The consumer will receive any messages sent to any topic that starts with news.europe
+         MessageConsumer messageConsumer = session.createConsumer(topicSubscribe);
+
+         // Step 8. Create an anonymous producer
+         MessageProducer producer = session.createProducer(null);
+
+         // Step 9. Instantiate some more topic objects corresponding to the individual topics
+         // we're going to send messages to
+         Topic topicNewsUsaWrestling = ActiveMQJMSClient.createTopic("news.usa.wrestling");
+
+         Topic topicNewsEuropeSport = ActiveMQJMSClient.createTopic("news.europe.sport");
+
+         Topic topicNewsEuropeEntertainment = ActiveMQJMSClient.createTopic("news.europe.entertainment");
+
+         // Step 10. Send a message destined for the usa wrestling topic
+         TextMessage messageWrestlingNews = session.createTextMessage("Hulk Hogan starts ballet classes");
+
+         producer.send(topicNewsUsaWrestling, messageWrestlingNews);
+
+         // Step 11. Send a message destined for the europe sport topic
+         TextMessage messageEuropeSport = session.createTextMessage("Lewis Hamilton joins European synchronized swimming team");
+
+         producer.send(topicNewsEuropeSport, messageEuropeSport);
+
+         // Step 12. Send a message destined for the europe entertainment topic
+         TextMessage messageEuropeEntertainment = session.createTextMessage("John Lennon resurrected from dead");
+
+         producer.send(topicNewsEuropeEntertainment, messageEuropeEntertainment);
+
+         // Step 9. Start the connection
+
+         connection.start();
+
+         // Step 10. We don't receive the usa wrestling message since we subscribed to news.europe.# and
+         // that doesn't match news.usa.wrestling. However we do receive the Europe sport message, and the
+         // europe entertainment message, since these match the wildcard.
+
+         TextMessage messageReceived1 = (TextMessage) messageConsumer.receive(5000);
+
+         System.out.println("Received message: " + messageReceived1.getText());
+
+         TextMessage messageReceived2 = (TextMessage) messageConsumer.receive(5000);
+
+         System.out.println("Received message: " + messageReceived2.getText());
+
+         Message message = messageConsumer.receive(1000);
+
+         if (message != null) {
+            throw new IllegalStateException("Message was not null.");
+         }
+
+         System.out.println("Didn't received any more message: " + message);
+      }
+      finally {
+         // Step 12. Be sure to close our resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..9ec66c6
--- /dev/null
+++ b/examples/features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,71 @@
+<?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 topics used by the example-->
+
+      <topic name="news"/>
+
+      <topic name="news.usa"/>
+
+      <topic name="news.usa.wrestling"/>
+
+      <topic name="news.europe"/>
+
+      <topic name="news.europe.sport"/>
+
+      <topic name="news.europe.entertainment"/>
+   </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>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.#">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic-hierarchies/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-hierarchies/src/main/resources/jndi.properties b/examples/features/standard/topic-hierarchies/src/main/resources/jndi.properties
new file mode 100644
index 0000000..5cbe72c
--- /dev/null
+++ b/examples/features/standard/topic-hierarchies/src/main/resources/jndi.properties
@@ -0,0 +1,19 @@
+# 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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic-selector-example1/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-selector-example1/pom.xml b/examples/features/standard/topic-selector-example1/pom.xml
new file mode 100644
index 0000000..f883759
--- /dev/null
+++ b/examples/features/standard/topic-selector-example1/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>topic-selector1</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Topic Selector Example 1</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>
+                     <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.TopicSelectorExample1</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>topic-selector1</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic-selector-example1/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-selector-example1/readme.html b/examples/features/standard/topic-selector-example1/readme.html
new file mode 100644
index 0000000..f03f4f5
--- /dev/null
+++ b/examples/features/standard/topic-selector-example1/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 Topic Selector Example 1</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 Topic Selector Example 1</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 how messages can be consumed from a topic using Message Selectors.</p>
+     <p>Consumers (or Subscribers) will only consume messages routed to a topic that match the provided selector</p>
+     <p>Topics and selectors are a standard part of JMS, please consult the JMS 1.1 specification for full details.</p>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java b/examples/features/standard/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java
new file mode 100644
index 0000000..53aee12
--- /dev/null
+++ b/examples/features/standard/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java
@@ -0,0 +1,145 @@
+/*
+ * 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.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.naming.InitialContext;
+
+/**
+ * A simple JMS Topic example that creates a producer and consumer on a queue and sends and receives a message.
+ */
+public class TopicSelectorExample1 {
+
+   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. Look-up the JMS topic
+         Topic topic = (Topic) initialContext.lookup("topic/exampleTopic");
+
+         // Step 3. Look-up the JMS 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(topic);
+
+         // Step 7. Create one subscription with a specific Filter for someID=1
+         MessageConsumer messageConsumer1 = session.createConsumer(topic, "someID=1", false);
+
+         // Step 8. Create another subscription with a specific Filter for someID=2
+         MessageConsumer messageConsumer2 = session.createConsumer(topic, "someID=2", false);
+
+         // Step 9. Create another subscription with no filters, which will receive every message sent to the topic
+         MessageConsumer messageConsumer3 = session.createConsumer(topic);
+
+         // Step 10. Send 20 messages, 10 with someID=1, 10 with someID=2
+
+         for (int i = 1; i < 10; i++) {
+            for (int someID = 1; someID <= 2; someID++) {
+               // Step 10.1 Create a text message
+               TextMessage message1 = session.createTextMessage("This is a text message " + i +
+                                                                   " sent for someID=" +
+                                                                   someID);
+
+               // Step 10.1 Set a property
+               message1.setIntProperty("someID", someID);
+
+               // Step 10.2 Send the message
+               producer.send(message1);
+
+               System.out.println("Sent message: " + message1.getText());
+            }
+         }
+
+         // Step 11. Start the JMS Connection. This step will activate the subscribers to receive messages.
+         connection.start();
+
+         // Step 12. Consume the messages from MessageConsumer1, filtering out someID=2
+
+         System.out.println("*************************************************************");
+         System.out.println("MessageConsumer1 will only receive messages where someID=1:");
+         for (;;) {
+            TextMessage messageReceivedA = (TextMessage) messageConsumer1.receive(1000);
+            if (messageReceivedA == null) {
+               break;
+            }
+
+            System.out.println("messageConsumer1 received " + messageReceivedA.getText() +
+                                  " someID = " +
+                                  messageReceivedA.getIntProperty("someID"));
+         }
+
+         // Step 13. Consume the messages from MessageConsumer2, filtering out someID=2
+         System.out.println("*************************************************************");
+         System.out.println("MessageConsumer2 will only receive messages where someID=2:");
+         for (;;) {
+            TextMessage messageReceivedB = (TextMessage) messageConsumer2.receive(1000);
+            if (messageReceivedB == null) {
+               break;
+            }
+
+            System.out.println("messageConsumer2 received " + messageReceivedB.getText() +
+                                  " someID = " +
+                                  messageReceivedB.getIntProperty("someID"));
+         }
+
+         // Step 14. Consume the messages from MessageConsumer3, receiving the complete set of messages
+         System.out.println("*************************************************************");
+         System.out.println("MessageConsumer3 will receive every message:");
+         for (;;) {
+            TextMessage messageReceivedC = (TextMessage) messageConsumer3.receive(1000);
+            if (messageReceivedC == null) {
+               break;
+            }
+            System.out.println("messageConsumer3 received " + messageReceivedC.getText() +
+                                  " someID = " +
+                                  messageReceivedC.getIntProperty("someID"));
+         }
+
+         // Step 15. Close the subscribers
+         messageConsumer1.close();
+         messageConsumer2.close();
+         messageConsumer3.close();
+      }
+      finally {
+         // Step 15. 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/6b17d966/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..d45eb5d
--- /dev/null
+++ b/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,60 @@
+<?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 topic used by the example-->
+      <topic name="exampleTopic"/>
+   </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>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example topic-->
+         <security-setting match="jms.topic.exampleTopic">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic-selector-example1/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-selector-example1/src/main/resources/jndi.properties b/examples/features/standard/topic-selector-example1/src/main/resources/jndi.properties
new file mode 100644
index 0000000..54bed6d
--- /dev/null
+++ b/examples/features/standard/topic-selector-example1/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
+topic.topic/exampleTopic=exampleTopic

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic-selector-example2/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-selector-example2/pom.xml b/examples/features/standard/topic-selector-example2/pom.xml
new file mode 100644
index 0000000..d5f88c6
--- /dev/null
+++ b/examples/features/standard/topic-selector-example2/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>topic-selector2</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Topic Selector Example 2</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>
+                     <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.TopicSelectorExample2</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>topic-selector2</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic-selector-example2/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-selector-example2/readme.html b/examples/features/standard/topic-selector-example2/readme.html
new file mode 100644
index 0000000..608e3d8
--- /dev/null
+++ b/examples/features/standard/topic-selector-example2/readme.html
@@ -0,0 +1,47 @@
+<!--
+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 Topic Selector Example 2</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 Topic Selector Example 2</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
+     <p>This example shows you how to selectively consume messages using message selectors with topic consumers.</p>
+
+     <p>Message selectors are strings with special syntax that can be used in creating consumers. Message consumers
+     that are thus created only receive messages that match its selector. On message delivering, the ActiveMQ
+     Server evaluates the corresponding message headers of the messages against each selector, if any, and then delivers
+     the 'matched' messages to its consumer. Please consult the JMS 1.1 specification for full details.</p>
+
+     <p>In this example, three message consumers are created on a topic. The first consumer is created with selector
+     <code>'color=red'</code>, it only receives messages that
+     have a 'color' string property of 'red' value; the second is created with selector <code>'color=green'</code>, it
+     only receives messages who have a 'color' string property of
+     'green' value; and the third without a selector, which means it receives all messages. To illustrate, three messages
+     with different 'color' property values are created and sent.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java b/examples/features/standard/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java
new file mode 100644
index 0000000..464b21b
--- /dev/null
+++ b/examples/features/standard/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java
@@ -0,0 +1,145 @@
+/*
+ * 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.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.naming.InitialContext;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * A simple JMS example that consumes messages using selectors.
+ */
+public class TopicSelectorExample2 {
+
+   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. perform a lookup on the topic
+         Topic topic = (Topic) initialContext.lookup("topic/exampleTopic");
+
+         // 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. Start the Connection
+         connection.start();
+
+         // Step 6. Create a JMS Session
+         Session producerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 7. Create a Message Producer
+         MessageProducer producer = producerSession.createProducer(topic);
+
+         // 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(topic, 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(topic, greenSelector);
+         greenConsumer.setMessageListener(new SimpleMessageListener("green", result));
+
+         // Step 11. Create another JMS message consumer that receives all messages.
+         Session allSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer allConsumer = allSession.createConsumer(topic);
+         allConsumer.setMessageListener(new SimpleMessageListener("all", result));
+
+         // Step 12. Create three messages, each has a color property
+         TextMessage redMessage = producerSession.createTextMessage("Red");
+         redMessage.setStringProperty("color", "red");
+         TextMessage greenMessage = producerSession.createTextMessage("Green");
+         greenMessage.setStringProperty("color", "green");
+         TextMessage blueMessage = producerSession.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 14. Be sure to close our JMS resources!
+         if (connection != null) {
+            connection.close();
+         }
+
+         // Also the initialContext
+         if (initialContext != null) {
+            initialContext.close();
+         }
+      }
+   }
+}
+
+class SimpleMessageListener implements MessageListener {
+
+   private final String name;
+   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("all")) {
+            result.set(false);
+         }
+      }
+      catch (JMSException e) {
+         e.printStackTrace();
+         result.set(false);
+      }
+   }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..d45eb5d
--- /dev/null
+++ b/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,60 @@
+<?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 topic used by the example-->
+      <topic name="exampleTopic"/>
+   </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>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example topic-->
+         <security-setting match="jms.topic.exampleTopic">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic-selector-example2/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic-selector-example2/src/main/resources/jndi.properties b/examples/features/standard/topic-selector-example2/src/main/resources/jndi.properties
new file mode 100644
index 0000000..54bed6d
--- /dev/null
+++ b/examples/features/standard/topic-selector-example2/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
+topic.topic/exampleTopic=exampleTopic

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic/pom.xml b/examples/features/standard/topic/pom.xml
new file mode 100644
index 0000000..7cc643e
--- /dev/null
+++ b/examples/features/standard/topic/pom.xml
@@ -0,0 +1,108 @@
+<?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>topic</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Topic 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>
+                     <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.TopicExample</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>topic</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic/readme.html b/examples/features/standard/topic/readme.html
new file mode 100644
index 0000000..8bfa903
--- /dev/null
+++ b/examples/features/standard/topic/readme.html
@@ -0,0 +1,36 @@
+<!--
+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 Topic 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 Topic 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 Topic with ActiveMQ Artemis.</p>
+     <p>Topics are a standard part of JMS, please consult the JMS 1.1 specification for full details.</p>
+     <p>A Topic is used to send messages using the publish-subscribe model, from a producer to 1 or more consumers.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic/src/main/java/org/apache/activemq/artemis/jms/example/TopicExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic/src/main/java/org/apache/activemq/artemis/jms/example/TopicExample.java b/examples/features/standard/topic/src/main/java/org/apache/activemq/artemis/jms/example/TopicExample.java
new file mode 100644
index 0000000..1c8695b
--- /dev/null
+++ b/examples/features/standard/topic/src/main/java/org/apache/activemq/artemis/jms/example/TopicExample.java
@@ -0,0 +1,94 @@
+/*
+ * 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.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.naming.InitialContext;
+
+/**
+ * A simple JMS Topic example that creates a producer and consumer on a queue and sends and receives a message.
+ */
+public class TopicExample {
+
+   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 topic
+         Topic topic = (Topic) initialContext.lookup("topic/exampleTopic");
+
+         // 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 Message Producer
+         MessageProducer producer = session.createProducer(topic);
+
+         // Step 7. Create a JMS Message Consumer
+         MessageConsumer messageConsumer1 = session.createConsumer(topic);
+
+         // Step 8. Create a JMS Message Consumer
+         MessageConsumer messageConsumer2 = session.createConsumer(topic);
+
+         // Step 9. Create a Text Message
+         TextMessage message = session.createTextMessage("This is a text message");
+
+         System.out.println("Sent message: " + message.getText());
+
+         // Step 10. Send the Message
+         producer.send(message);
+
+         // Step 11. Start the Connection
+         connection.start();
+
+         // Step 12. Receive the message
+         TextMessage messageReceived = (TextMessage) messageConsumer1.receive();
+
+         System.out.println("Consumer 1 Received message: " + messageReceived.getText());
+
+         // Step 13. Receive the message
+         messageReceived = (TextMessage) messageConsumer2.receive();
+
+         System.out.println("Consumer 2 Received message: " + messageReceived.getText());
+      }
+      finally {
+         // Step 14. Be sure to close our JMS resources!
+         if (connection != null) {
+            connection.close();
+         }
+
+         // Also the initialContext
+         if (initialContext != null) {
+            initialContext.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/topic/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..fd6671c
--- /dev/null
+++ b/examples/features/standard/topic/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,59 @@
+<?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 topic used by the example-->
+      <topic name="exampleTopic"/>
+   </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>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+      <security-settings>
+         <!--security for example topic-->
+         <security-setting match="jms.topic.exampleTopic">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/topic/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/topic/src/main/resources/jndi.properties b/examples/features/standard/topic/src/main/resources/jndi.properties
new file mode 100644
index 0000000..54bed6d
--- /dev/null
+++ b/examples/features/standard/topic/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
+topic.topic/exampleTopic=exampleTopic

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/transactional/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/transactional/pom.xml b/examples/features/standard/transactional/pom.xml
new file mode 100644
index 0000000..660d262
--- /dev/null
+++ b/examples/features/standard/transactional/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>transactional</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Transactional 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>
+                     <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.TransactionalExample</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>transactional</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/transactional/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/transactional/readme.html b/examples/features/standard/transactional/readme.html
new file mode 100644
index 0000000..b171c0a
--- /dev/null
+++ b/examples/features/standard/transactional/readme.html
@@ -0,0 +1,40 @@
+<!--
+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 Transactional Session 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 Transactional Session Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
+     <p>This example shows you how to use a transacted Session with ActiveMQ Artemis.</p>
+     <p>Firstly 2 messages are sent via the transacted sending session before being committed. This ensures that both message
+     are sent</p>
+     <p>Secondly the receiving session receives the messages firstly demonstrating a message being redelivered after the session
+     being rolled back and then acknowledging receipt of the messages via the commit method.</p>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/transactional/src/main/java/org/apache/activemq/artemis/jms/example/TransactionalExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/transactional/src/main/java/org/apache/activemq/artemis/jms/example/TransactionalExample.java b/examples/features/standard/transactional/src/main/java/org/apache/activemq/artemis/jms/example/TransactionalExample.java
new file mode 100644
index 0000000..09c2a3d
--- /dev/null
+++ b/examples/features/standard/transactional/src/main/java/org/apache/activemq/artemis/jms/example/TransactionalExample.java
@@ -0,0 +1,126 @@
+/*
+ * 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 example that sends and consume message transactionally.
+ */
+public class TransactionalExample {
+
+   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. Look-up the JMS topic
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+
+         // Step 3. Look-up the JMS connection factory
+         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 4. Create a JMS connection
+         connection = cf.createConnection();
+
+         // Step 5. Start the connection
+         connection.start();
+
+         // Step 6. Create a transactional JMS session
+         Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
+
+         // Step 7. Create a JMS message producer
+         MessageProducer messageProducer = session.createProducer(queue);
+
+         // Step 8. Create a message consumer
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         // Step 9. Create 2 text messages
+         TextMessage message1 = session.createTextMessage("This is a text message1");
+         TextMessage message2 = session.createTextMessage("This is a text message2");
+
+         // Step 10. Send the text messages to the queue
+         messageProducer.send(message1);
+         messageProducer.send(message2);
+
+         System.out.println("Sent message: " + message1.getText());
+         System.out.println("Sent message: " + message2.getText());
+
+         // Step 11. Receive the message, it will return null as the transaction is not committed.
+         TextMessage receivedMessage = (TextMessage) messageConsumer.receive(5000);
+
+         System.out.println("Message received before send commit: " + receivedMessage);
+
+         // Step 12. Commit the session
+         session.commit();
+
+         // Step 13. Receive the messages again
+         receivedMessage = (TextMessage) messageConsumer.receive(5000);
+
+         System.out.println("Message received after send commit: " + receivedMessage.getText());
+
+         // Step 14. Roll back the session, this will cause the received message canceled and redelivered again.
+         session.rollback();
+
+         // Step 15. Receive the message again, we will get two messages
+         receivedMessage = (TextMessage) messageConsumer.receive(5000);
+
+         System.out.println("Message1 received after receive rollback: " + receivedMessage.getText());
+
+         receivedMessage = (TextMessage) messageConsumer.receive(5000);
+
+         System.out.println("Message2 received after receive rollback: " + receivedMessage.getText());
+
+         receivedMessage = (TextMessage) messageConsumer.receive(5000);
+
+         System.out.println("Message3 received after receive rollback: " + receivedMessage);
+
+         // Step 16. Commit the session
+         session.commit();
+
+         // Step 17. Receive the message again. Nothing should be received.
+         receivedMessage = (TextMessage) messageConsumer.receive(5000);
+
+         if (receivedMessage != null) {
+            // This was not supposed to happen
+            throw new IllegalStateException("Message is not null.");
+         }
+
+         System.out.println("Message received after receive commit: " + receivedMessage);
+
+      }
+      finally {
+         if (connection != null) {
+            // Step 18. Be sure to close our JMS resources!
+            connection.close();
+         }
+         if (initialContext != null) {
+            // Step 19. Also close initial context!
+            initialContext.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/transactional/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/transactional/src/main/resources/jndi.properties b/examples/features/standard/transactional/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/transactional/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/6b17d966/examples/features/standard/xa-heuristic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-heuristic/pom.xml b/examples/features/standard/xa-heuristic/pom.xml
new file mode 100644
index 0000000..6f4025b
--- /dev/null
+++ b/examples/features/standard/xa-heuristic/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>xa-heuristic</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS XAHeuristicExample 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>
+                     <javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3001 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
+                     </javaOptions>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.XAHeuristicExample</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>xa-heuristic</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>


[38/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/dead-letter/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/dead-letter/src/main/resources/activemq/server0/artemis-roles.properties b/examples/broker-features/standard/dead-letter/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/broker-features/standard/dead-letter/src/main/resources/activemq/server0/artemis-roles.properties
+++ /dev/null
@@ -1,17 +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.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/dead-letter/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/dead-letter/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/dead-letter/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index fdf88cc..0000000
--- a/examples/broker-features/standard/dead-letter/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?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"/>
-
-      <!-- the dead letter queue where dead messages will be sent-->
-      <queue name="deadLetterQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.#">
-            <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-settings>
-
-      <address-settings>
-         <!--override the max-delivery-attempts and dead letter address for the example queue-->
-         <address-setting match="jms.queue.exampleQueue">
-            <dead-letter-address>jms.queue.deadLetterQueue</dead-letter-address>
-            <max-delivery-attempts>3</max-delivery-attempts>
-         </address-setting>
-      </address-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/dead-letter/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/dead-letter/src/main/resources/jndi.properties b/examples/broker-features/standard/dead-letter/src/main/resources/jndi.properties
deleted file mode 100644
index 3e1a366..0000000
--- a/examples/broker-features/standard/dead-letter/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,21 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-queue.queue/exampleQueue=exampleQueue
-queue.queue/deadLetterQueue=deadLetterQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/delayed-redelivery/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/delayed-redelivery/pom.xml b/examples/broker-features/standard/delayed-redelivery/pom.xml
deleted file mode 100644
index e82469c..0000000
--- a/examples/broker-features/standard/delayed-redelivery/pom.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?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>delayed-redelivery</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Delayed Redelivery 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>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                     <ignore>${noServer}</ignore>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.DelayedRedeliveryExample</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>delayed-redelivery</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/delayed-redelivery/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/delayed-redelivery/readme.html b/examples/broker-features/standard/delayed-redelivery/readme.html
deleted file mode 100644
index e535c47..0000000
--- a/examples/broker-features/standard/delayed-redelivery/readme.html
+++ /dev/null
@@ -1,56 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Delayed Redelivery 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>Delayed Redelivery 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 can be configured to provide a delayed redelivery in the case
-     where a message needs to be redelivered.</p>
-     <p>Delaying redelivery can often be useful in the case that clients regularly fail or roll-back. Without a delayed
-     redelivery, the system can get into a "thrashing" state, with delivery being attempted, the client rolling back, and
-     delivery being re-attempted ad infinitum in quick succession, using up valuable CPU and network resources.</p>
-     <p>Re-delivery occurs when the session is closed with unacknowledged messages. The unacknowledged messages will
-     be redelivered.</p>
-     <p>By providing a redelivery delay, it can be specified that a delay of, say, 10 seconds is implemented between rollback
-     and redelivery. The specific delay is configurable on both a global and per destination level, by using wild-card
-     matching on the address settings.</p>
-
-     <h2>Example setup</h2>
-     <p>Redelivery delay is specified in the configuration file <a href="src/main/resources/activemq/server0/broker.xml">broker.xml</a>:</p>
-     <p>In this example we set the redelivery delay to 5 seconds for the specific example queue. We could set redelivery delay on
-     on multiple queues by specifying a wild-card in the match, e.g. <code>match="jms.#"</code> would apply the settings
-     to all JMS queues and topics.</p>
-     <p>We then consume a message in a transacted session, and rollback, and note that the message is not redelivered until
-     after 5 seconds.</p>
-     <pre class="prettyprint">
-         <code>&lt;address-setting match="jms.queue.exampleQueue"&gt;
-            &lt;redelivery-delay&gt;5000&lt;/redelivery-delay&gt;
-         &lt;/address-setting&gt;
-         </code>
-     </pre>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/delayed-redelivery/src/main/java/org/apache/activemq/artemis/jms/example/DelayedRedeliveryExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/delayed-redelivery/src/main/java/org/apache/activemq/artemis/jms/example/DelayedRedeliveryExample.java b/examples/broker-features/standard/delayed-redelivery/src/main/java/org/apache/activemq/artemis/jms/example/DelayedRedeliveryExample.java
deleted file mode 100644
index afa538f..0000000
--- a/examples/broker-features/standard/delayed-redelivery/src/main/java/org/apache/activemq/artemis/jms/example/DelayedRedeliveryExample.java
+++ /dev/null
@@ -1,126 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-/**
- * This example demonstrates how ActiveMQ Artemis can be configured with a redelivery delay in the event a message
- * is redelivered.
- *
- * Please see the readme.html for more information
- */
-public class DelayedRedeliveryExample {
-
-   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 transacted JMS Session
-         Session session = connection.createSession(true, 0);
-
-         // 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");
-
-         // Step 8. Send the Message
-         producer.send(message);
-
-         System.out.println("Sent message to " + queue.getQueueName() + ": " + message.getText());
-
-         // Step 9. Commit the session to effectively send the message
-         session.commit();
-
-         // Step 10. Create a JMS Message Consumer for the queue
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-
-         // Step 11. Start the Connection
-         connection.start();
-
-         // Step 12. We receive a message...
-         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-         System.out.println("1st delivery from " + queue.getQueueName() + ": " + messageReceived.getText());
-
-         // Step 13. ... but we roll back the session. the message returns to the queue, but only after a
-         // 5 second delay
-         session.rollback();
-
-         // Step 14. We try to receive the message but it's being delayed
-         messageReceived = (TextMessage) messageConsumer.receive(3000);
-
-         if (messageReceived != null) {
-            throw new IllegalStateException("Expected to recieve message.");
-         }
-
-         System.out.println("Redelivery has been delayed so received message is " + messageReceived);
-
-         // Step 15. We try and receive the message again, this time we should get it
-
-         messageReceived = (TextMessage) messageConsumer.receive(3000);
-
-         System.out.println("2nd delivery from " + queue.getQueueName() + ": " + messageReceived.getText());
-
-         // Step 16. We rollback the session again to cause another redelivery, and we time how long this one takes
-
-         long start = System.currentTimeMillis();
-
-         session.rollback();
-
-         messageReceived = (TextMessage) messageConsumer.receive(8000);
-
-         long end = System.currentTimeMillis();
-
-         System.out.println("3nd delivery from " + queue.getQueueName() +
-                               ": " +
-                               messageReceived.getText() +
-                               " after " +
-                               (end - start) +
-                               " milliseconds.");
-      }
-      finally {
-         // Step 17. 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/6b17d966/examples/broker-features/standard/delayed-redelivery/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/delayed-redelivery/src/main/resources/activemq/server0/artemis-roles.properties b/examples/broker-features/standard/delayed-redelivery/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/broker-features/standard/delayed-redelivery/src/main/resources/activemq/server0/artemis-roles.properties
+++ /dev/null
@@ -1,17 +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.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/delayed-redelivery/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/delayed-redelivery/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/delayed-redelivery/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 3e41664..0000000
--- a/examples/broker-features/standard/delayed-redelivery/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?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"/>
-
-      <!-- the dead letter queue where dead messages will be sent-->
-      <queue name="deadLetterQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.#">
-            <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-settings>
-
-      <address-settings>
-         <!--override the redelivery-delay  for the example queue-->
-         <address-setting match="jms.queue.exampleQueue">
-            <redelivery-delay>5000</redelivery-delay>
-         </address-setting>
-      </address-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/delayed-redelivery/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/delayed-redelivery/src/main/resources/jndi.properties b/examples/broker-features/standard/delayed-redelivery/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/delayed-redelivery/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/divert/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/divert/pom.xml b/examples/broker-features/standard/divert/pom.xml
deleted file mode 100644
index 69a7f98..0000000
--- a/examples/broker-features/standard/divert/pom.xml
+++ /dev/null
@@ -1,159 +0,0 @@
-<?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>divert</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Divert Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <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>
-   </dependencies>
-
-   <build>
-      <plugins>
-         <plugin>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-maven-plugin</artifactId>
-            <executions>
-               <execution>
-                  <id>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <libList><arg>org.apache.activemq.examples.broker:divert:${project.version}</arg></libList>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <libList><arg>org.apache.activemq.examples.broker:divert:${project.version}</arg></libList>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server1</location>
-                     <testURI>tcp://localhost:61617</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server1</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.DivertExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server1</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.broker</groupId>
-                  <artifactId>divert</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/divert/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/divert/readme.html b/examples/broker-features/standard/divert/readme.html
deleted file mode 100644
index 63fb710..0000000
--- a/examples/broker-features/standard/divert/readme.html
+++ /dev/null
@@ -1,119 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Divert 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>Divert 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>ActiveMQ Artemis diverts allow messages to be transparently "diverted" from one address to another
-     with just some simple configuration defined on the server side.</p>
-     <p>Diverts can be defined to be <b>exclusive</b> or <b>non-exclusive</b>.</p>
-     <p>With an <b>exclusive</b> divert the message is intercepted and does not get sent to the queues originally
-     bound to that address - it only gets diverted.</p>
-     <p>With a <b>non-exclusive</b> divert the message continues to go to the queues bound to the address,
-     but also a <b>copy</b> of the message gets sent to the address specified in the divert. Consequently non-exclusive
-     diverts can be used to "snoop" on another address</p>
-     <p>Diverts can also be configured to have an optional filter. If specified then only matching messages
-     will be diverted.</p>
-     <p>Diverts can be configured to apply a Transformer. If specified, all diverted messages will have the
-     opportunity of being transformed by the Transformer.</p>
-     <p>Diverts are a very sophisticated concept, which when combined with bridges can be used to create
-     interesting and complex routings. The set of diverts can be thought of as a type of <i>routing table</i>
-     for messages.</p>
-
-     <h2>Example step-by-step</h2>
-     <p>In this example we will imagine a fictitious company which has two offices; one in London and another in New York.</p>
-     <p>The company accepts orders for it's products only at it's London office, and also generates price-updates
-     for it's products, also only from it's London office. However only the New York office is interested in receiving
-     price updates for New York products. Any prices for New York products need to be forwarded to the New York office.</p>
-     <p>There is an unreliable WAN linking the London and New York offices.</p>
-     <p>The company also requires a copy of any order received to be available to be inspected by management.</p>
-     <p>In order to achieve this, we will create a queue <code>orderQueue</code> on the London server in to which orders arrive.</p>
-     <p>We will create a topic, <code>spyTopic</code> on the London server, and there will be two subscribers both in London.</p>
-     <p>We will create a <i>non-exclusive</i> divert on the London server which will siphon off a copy of each order
-     received to the topic <code>spyTopic</code>.</p>
-     <p>Here's the xml config for that divert, from <code>broker.xml</code></p>
-     <pre class="prettyprint">
-        <code>
-     &lt;divert name="order-divert"&gt;
-         &lt;address&gt;jms.queue.orders&lt;/address&gt;
-         &lt;forwarding-address&gt;jms.topic.spyTopic&lt;/forwarding-address&gt;
-         &lt;exclusive&gt;false&lt;/exclusive&gt;
-      &lt;/divert&gt;
-         </code>
-     </pre>
-     <p>For the prices we will create a topic on the London server, <code>priceUpdates</code> to which all price updates
-     are sent. We will create another topic on the New York server <code>newYorkPriceUpdates</code> to which all New York
-     price updates need to be forwarded.</p>
-     <p>Diverts can only be used to divert messages from one <b>local</b> address to another <b>local</b> address
-     so we cannot divert directly to an address on another server.</p>
-     <p>Instead we divert to a local <i>store and forward queue</i> they we define in the configuration. This is just a normal queue
-     that we use for storing messages before forwarding to another node.</p>
-     <p>Here's the configuration for it:</p>
-     <pre class="prettyprint">
-        <code>
-     &lt;queues&gt;
-        &lt;queue name="jms.queue.priceForwarding"&gt;
-           &lt;address&gt;jms.queue.priceForwarding&lt;/address&gt;
-        &lt;/queue&gt;
-     &lt;/queues&gt;
-         </code>
-      </pre>
-     <p>Here's the configuration for the divert:</p>
-     <pre class="prettyprint">
-        <code>
-     &lt;divert name="prices-divert"&gt;
-	     &lt;address&gt;jms.topic.priceUpdates&lt;/address&gt;
-	     &lt;forwarding-address&gt;jms.queue.priceForwarding&lt;/forwarding-address&gt;
-	     &lt;filter string="office='New York'"/&gt;
-	     &lt;transformer-class-name&gt;org.apache.activemq.artemis.jms.example.AddForwardingTimeTransformer&lt;/transformer-class-name&gt;
-	     &lt;exclusive&gt;true&lt;/exclusive&gt;
-	  &lt;/divert&gt;
-	     </code>
-	  </pre>
-	  <p>Note we specify a filter in the divert, so only New York prices get diverted. We also specify a Transformer class
-	  since we are going to insert a header in the message at divert time, recording the time the diversion happened.</p>
-	  <p>And finally we define a bridge that moves messages from the local queue to the address on the New York server.
-	  Bridges move messages from queues to remote addresses and are ideal to use when the target server may be stopped and
-	  started independently, and/or the network might be unreliable. Bridges guarantee once and only once delivery
-	  of messages from their source queues to their target addresses.</p>
-	  <p>Here is the bridge configuration: </p>
-	  <pre class="prettyprint">
-	     <code>
-	  &lt;bridges&gt;
-	     &lt;bridge name="price-forward-bridge"&gt;
-	        &lt;queue-name&gt;jms.queue.priceForwarding&lt;/queue-name&gt;
-	        &lt;forwarding-address&gt;jms.topic.newYorkPriceUpdates&lt;/forwarding-address&gt;
-	        &lt;reconnect-attempts&gt;-1&lt;/reconnect-attempts&gt;
-          &lt;static-connectors>
-             &lt;connector-ref>newyork-connector&lt;/connector-ref>
-          &lt;/static-connectors>
-	     &lt;/bridge&gt;
-      &lt;/bridges&gt;
-         </code>
-     </pre>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/AddForwardingTimeTransformer.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/AddForwardingTimeTransformer.java b/examples/broker-features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/AddForwardingTimeTransformer.java
deleted file mode 100644
index 15d8e65..0000000
--- a/examples/broker-features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/AddForwardingTimeTransformer.java
+++ /dev/null
@@ -1,31 +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 org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.core.server.ServerMessage;
-import org.apache.activemq.artemis.core.server.cluster.Transformer;
-
-public class AddForwardingTimeTransformer implements Transformer {
-
-   public ServerMessage transform(final ServerMessage message) {
-      message.putLongProperty(new SimpleString("time_of_forward"), System.currentTimeMillis());
-
-      return message;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java b/examples/broker-features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java
deleted file mode 100644
index e014693..0000000
--- a/examples/broker-features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java
+++ /dev/null
@@ -1,212 +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.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * This examples demonstrates the use of ActiveMQ Artemis "Diverts" to transparently divert or copy messages
- * from one address to another.
- *
- * Please see the readme.html for more information.
- */
-public class DivertExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection connectionLondon = null;
-
-      Connection connectionNewYork = null;
-      try {
-         // Step 2. Look-up the queue orderQueue on the London server - this is the queue any orders are sent to
-         Queue orderQueue = ActiveMQJMSClient.createQueue("orders");
-
-         // Step 3. Look-up the topic priceUpdates on the London server- this is the topic that any price updates are
-         // sent to
-         Topic priceUpdates = ActiveMQJMSClient.createTopic("priceUpdates");
-
-         // Step 4. Look-up the spy topic on the London server- this is what we will use to snoop on any orders
-         Topic spyTopic = ActiveMQJMSClient.createTopic("spyTopic");
-
-         // Step 7. Look-up the topic newYorkPriceUpdates on the New York server - any price updates sent to
-         // priceUpdates on the London server will
-         // be diverted to the queue priceForward on the London server, and a bridge will consume from that queue and
-         // forward
-         // them to the address newYorkPriceUpdates on the New York server where they will be distributed to the topic
-         // subscribers on
-         // the New York server
-         Topic newYorkPriceUpdates = ActiveMQJMSClient.createTopic("newYorkPriceUpdates");
-
-         // Step 8. Perform a lookup on the Connection Factory on the London server
-         ConnectionFactory cfLondon = new ActiveMQConnectionFactory("tcp://localhost:61616");
-
-         // Step 9. Perform a lookup on the Connection Factory on the New York server
-         ConnectionFactory cfNewYork = new ActiveMQConnectionFactory("tcp://localhost:61617");
-
-         // Step 10. Create a JMS Connection on the London server
-         connectionLondon = cfLondon.createConnection();
-
-         // Step 11. Create a JMS Connection on the New York server
-         connectionNewYork = cfNewYork.createConnection();
-
-         // Step 12. Create a JMS Session on the London server
-         Session sessionLondon = connectionLondon.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 13. Create a JMS Session on the New York server
-         Session sessionNewYork = connectionNewYork.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 14. Create a JMS MessageProducer orderProducer that sends to the queue orderQueue on the London server
-         MessageProducer orderProducer = sessionLondon.createProducer(orderQueue);
-
-         // Step 15. Create a JMS MessageProducer priceProducer that sends to the topic priceUpdates on the London
-         // server
-         MessageProducer priceProducer = sessionLondon.createProducer(priceUpdates);
-
-         // Step 15. Create a JMS subscriber which subscribes to the spyTopic on the London server
-         MessageConsumer spySubscriberA = sessionLondon.createConsumer(spyTopic);
-
-         // Step 16. Create another JMS subscriber which also subscribes to the spyTopic on the London server
-         MessageConsumer spySubscriberB = sessionLondon.createConsumer(spyTopic);
-
-         // Step 17. Create a JMS MessageConsumer which consumes orders from the order queue on the London server
-         MessageConsumer orderConsumer = sessionLondon.createConsumer(orderQueue);
-
-         // Step 18. Create a JMS subscriber which subscribes to the priceUpdates topic on the London server
-         MessageConsumer priceUpdatesSubscriberLondon = sessionLondon.createConsumer(priceUpdates);
-
-         // Step 19. Create a JMS subscriber which subscribes to the newYorkPriceUpdates topic on the New York server
-         MessageConsumer newYorkPriceUpdatesSubscriberA = sessionNewYork.createConsumer(newYorkPriceUpdates);
-
-         // Step 20. Create another JMS subscriber which also subscribes to the newYorkPriceUpdates topic on the New
-         // York server
-         MessageConsumer newYorkPriceUpdatesSubscriberB = sessionNewYork.createConsumer(newYorkPriceUpdates);
-
-         // Step 21. Start the connections
-
-         connectionLondon.start();
-
-         connectionNewYork.start();
-
-         // Step 22. Create an order message
-         TextMessage orderMessage = sessionLondon.createTextMessage("This is an order");
-
-         // Step 23. Send the order message to the order queue on the London server
-         orderProducer.send(orderMessage);
-
-         System.out.println("Sent message: " + orderMessage.getText());
-
-         // Step 24. The order message is consumed by the orderConsumer on the London server
-         TextMessage receivedOrder = (TextMessage) orderConsumer.receive(5000);
-
-         System.out.println("Received order: " + receivedOrder.getText());
-
-         // Step 25. A copy of the order is also received by the spyTopic subscribers on the London server
-         TextMessage spiedOrder1 = (TextMessage) spySubscriberA.receive(5000);
-
-         System.out.println("Snooped on order: " + spiedOrder1.getText());
-
-         TextMessage spiedOrder2 = (TextMessage) spySubscriberB.receive(5000);
-
-         System.out.println("Snooped on order: " + spiedOrder2.getText());
-
-         // Step 26. Create and send a price update message, destined for London
-         TextMessage priceUpdateMessageLondon = sessionLondon.createTextMessage("This is a price update for London");
-
-         priceUpdateMessageLondon.setStringProperty("office", "London");
-
-         priceProducer.send(priceUpdateMessageLondon);
-
-         // Step 27. The price update *should* be received by the local subscriber since we only divert messages
-         // where office = New York
-         TextMessage receivedUpdate = (TextMessage) priceUpdatesSubscriberLondon.receive(2000);
-
-         System.out.println("Received price update locally: " + receivedUpdate.getText());
-
-         // Step 28. The price update *should not* be received in New York
-
-         TextMessage priceUpdate1 = (TextMessage) newYorkPriceUpdatesSubscriberA.receive(1000);
-
-         if (priceUpdate1 != null) {
-            throw new IllegalStateException("Message is not null");
-         }
-
-         System.out.println("Did not received price update in New York, look it's: " + priceUpdate1);
-
-         TextMessage priceUpdate2 = (TextMessage) newYorkPriceUpdatesSubscriberB.receive(1000);
-
-         if (priceUpdate2 != null) {
-            throw new IllegalStateException("Message is not null");
-         }
-
-         System.out.println("Did not received price update in New York, look it's: " + priceUpdate2);
-
-         // Step 29. Create a price update message, destined for New York
-
-         TextMessage priceUpdateMessageNewYork = sessionLondon.createTextMessage("This is a price update for New York");
-
-         priceUpdateMessageNewYork.setStringProperty("office", "New York");
-
-         // Step 30. Send the price update message to the priceUpdates topic on the London server
-         priceProducer.send(priceUpdateMessageNewYork);
-
-         // Step 31. The price update *should not* be received by the local subscriber to the priceUpdates topic
-         // since it has been *exclusively* diverted to the priceForward queue, because it has a header saying
-         // it is destined for the New York office
-         Message message = priceUpdatesSubscriberLondon.receive(1000);
-
-         if (message != null) {
-            throw new IllegalStateException("Message is not null");
-         }
-
-         System.out.println("Didn't receive local price update, look, it's: " + message);
-
-         // Step 32. The remote subscribers on server 1 *should* receive a copy of the price update since
-         // it has been diverted to a local priceForward queue which has a bridge consuming from it and which
-         // forwards it to the same address on server 1.
-         // We notice how the forwarded messages have had a special header added by our custom transformer that
-         // we told the divert to use
-
-         priceUpdate1 = (TextMessage) newYorkPriceUpdatesSubscriberA.receive(5000);
-
-         System.out.println("Received forwarded price update on server 1: " + priceUpdate1.getText());
-         System.out.println("Time of forward: " + priceUpdate1.getLongProperty("time_of_forward"));
-
-         priceUpdate2 = (TextMessage) newYorkPriceUpdatesSubscriberB.receive(5000);
-
-         System.out.println("Received forwarded price update on server 2: " + priceUpdate2.getText());
-         System.out.println("Time of forward: " + priceUpdate2.getLongProperty("time_of_forward"));
-      }
-      finally {
-         if (connectionLondon != null) {
-            connectionLondon.close();
-         }
-         if (connectionNewYork != null) {
-            connectionNewYork.close();
-         }
-      }
-   }
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/divert/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/divert/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/divert/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7ce362a..0000000
--- a/examples/broker-features/standard/divert/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?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">
-      <!-- Destinations used by the example -->
-
-      <!-- The order queue -->
-      <queue name="orders"/>
-
-      <!-- The queue that prices are forwarded to before being bridged to the New York server -->
-      <queue name="priceForwarding"/>
-
-      <!-- The topic for price updates -->
-      <topic name="priceUpdates"/>
-
-      <!-- The spy topic for snooping on orders -->
-      <topic name="spyTopic"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-
-      <!-- Connectors -->
-
-      <connectors>
-         <!-- This connector corresponds to the New York server -->
-         <connector name="newyork-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Divert configuration -->
-
-      <!-- We need to create a core queue for the JMS queue explicitly because the bridge will be deployed
-      before the JMS queue is deployed, so the first time, it otherwise won't find the queue -->
-      <queues>
-         <queue name="jms.queue.priceForwarding">
-            <address>jms.queue.priceForwarding</address>
-         </queue>
-      </queues>
-
-      <diverts>
-         <divert name="order-divert">
-            <routing-name>order-divert</routing-name>
-            <address>jms.queue.orders</address>
-            <forwarding-address>jms.topic.spyTopic</forwarding-address>
-            <exclusive>false</exclusive>
-         </divert>
-
-         <divert name="prices-divert">
-            <routing-name>prices-divert</routing-name>
-            <address>jms.topic.priceUpdates</address>
-            <forwarding-address>jms.queue.priceForwarding</forwarding-address>
-            <filter string="office='New York'"/>
-            <transformer-class-name>org.apache.activemq.artemis.jms.example.AddForwardingTimeTransformer
-            </transformer-class-name>
-            <exclusive>true</exclusive>
-         </divert>
-      </diverts>
-
-      <!-- Bridge configuration -->
-
-      <bridges>
-         <bridge name="price-forward-bridge">
-            <queue-name>jms.queue.priceForwarding</queue-name>
-            <forwarding-address>jms.topic.newYorkPriceUpdates</forwarding-address>
-            <reconnect-attempts>-1</reconnect-attempts>
-            <static-connectors>
-               <connector-ref>newyork-connector</connector-ref>
-            </static-connectors>
-         </bridge>
-      </bridges>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example -->
-         <security-setting match="jms.#">
-            <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-settings>
-
-   </core>
-</configuration>

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/divert/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/divert/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/standard/divert/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 315d13b..0000000
--- a/examples/broker-features/standard/divert/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?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">
-      <!-- Destinations used by the example -->
-
-      <!-- The topic for New York price updates -->
-
-      <topic name="newYorkPriceUpdates"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-
-      <!-- Acceptors -->
-
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.#">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/durable-subscription/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/durable-subscription/pom.xml b/examples/broker-features/standard/durable-subscription/pom.xml
deleted file mode 100644
index a502fff..0000000
--- a/examples/broker-features/standard/durable-subscription/pom.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?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>durable-subscription</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Durable Subscription 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>${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.DurableSubscriptionExample</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>durable-subscription</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/durable-subscription/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/durable-subscription/readme.html b/examples/broker-features/standard/durable-subscription/readme.html
deleted file mode 100644
index 61b591f..0000000
--- a/examples/broker-features/standard/durable-subscription/readme.html
+++ /dev/null
@@ -1,39 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Durable Subscription 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 Durable Subscription 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 to use a durable subscription with ActiveMQ Artemis.</p>
-     <p>Durable subscriptions are a standard part of JMS, please consult the JMS 1.1 specification for full details.</p>
-     <p>Unlike non durable subscriptions, the key function of durable subscriptions is that the messages contained in them
-         persist longer than the lifetime of the subscriber - i.e. they will accumulate messages sent to the topic even
-         if the subscriber is not currently connected. They will also survive server restarts. Note that for the messages to
-         be persisted, the messages sent to them must be marked as persistent messages.</p>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/DurableSubscriptionExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/DurableSubscriptionExample.java b/examples/broker-features/standard/durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/DurableSubscriptionExample.java
deleted file mode 100644
index 46cd94c..0000000
--- a/examples/broker-features/standard/durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/DurableSubscriptionExample.java
+++ /dev/null
@@ -1,116 +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.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.TopicSubscriber;
-import javax.naming.InitialContext;
-
-/**
- * A simple JMS example that shows how to use a durable subscription.
- */
-public class DurableSubscriptionExample {
-
-   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. Look-up the JMS topic
-         Topic topic = (Topic) initialContext.lookup("topic/exampleTopic");
-
-         // Step 3. Look-up the JMS connection factory
-         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 4. Create a JMS connection
-         connection = cf.createConnection();
-
-         // Step 5. Set the client-id on the connection
-         connection.setClientID("durable-client");
-
-         // 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
-         MessageProducer messageProducer = session.createProducer(topic);
-
-         // Step 9. Create the subscription and the subscriber.
-         TopicSubscriber subscriber = session.createDurableSubscriber(topic, "subscriber-1");
-
-         // Step 10. Create a text message
-         TextMessage message1 = session.createTextMessage("This is a text message 1");
-
-         // Step 11. Send the text message to the topic
-         messageProducer.send(message1);
-
-         System.out.println("Sent message: " + message1.getText());
-
-         // Step 12. Consume the message from the durable subscription
-
-         TextMessage messageReceived = (TextMessage) subscriber.receive();
-
-         System.out.println("Received message: " + messageReceived.getText());
-
-         // Step 13. Create and send another message
-
-         TextMessage message2 = session.createTextMessage("This is a text message 2");
-
-         messageProducer.send(message2);
-
-         System.out.println("Sent message: " + message2.getText());
-
-         // Step 14. Close the subscriber - the server could even be stopped at this point!
-         subscriber.close();
-
-         // Step 15. Create a new subscriber on the *same* durable subscription.
-
-         subscriber = session.createDurableSubscriber(topic, "subscriber-1");
-
-         // Step 16. Consume the message
-
-         messageReceived = (TextMessage) subscriber.receive();
-
-         System.out.println("Received message: " + messageReceived.getText());
-
-         // Step 17. Close the subscriber
-         subscriber.close();
-
-         // Step 18. Delete the durable subscription
-         session.unsubscribe("subscriber-1");
-      }
-      finally {
-         if (connection != null) {
-            // Step 19. Be sure to close our JMS resources!
-            connection.close();
-         }
-         if (initialContext != null) {
-            // Step 20. Also close the initialContext!
-            initialContext.close();
-         }
-      }
-   }
-}

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

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


[02/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/xa-heuristic/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-heuristic/readme.html b/examples/features/standard/xa-heuristic/readme.html
new file mode 100644
index 0000000..bf44937
--- /dev/null
+++ b/examples/features/standard/xa-heuristic/readme.html
@@ -0,0 +1,48 @@
+<!--
+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 XA Heuristic 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 XA Heuristic 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 make an XA heuristic decision through the ActiveMQ Artemis Management Interface.</p>
+
+     <p>A heuristic decision is a unilateral decision to commit or rollback an XA transaction branch after it has
+     been prepared. </p>
+
+     <p>In this example we simulate a transaction manager to control the transactions. First we create an XASession
+     and enlist it in a transaction through its XAResource. We then send a text message, 'hello' and end/prepare the transaction
+     on the XAResource, but neither commit nor roll back the transaction. Another transaction is created and
+     associated with the same XAResource, and a second message, 'world' is sent on behalf of the second transaction. Again we leave
+     the second transaction in prepare state.
+     Then we get the MBeanServerConnection object to manipulate the prepared transactions. To illustrate, we roll back the first
+     transaction but commit the second. This will result in that only the message 'world' is received. </p>
+
+     <p>This example uses JMX to manipulate transactions in a ActiveMQ Artemis Server. For details on JMX facilities with ActiveMQ Artemis,
+     please look at the JMX Example.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java b/examples/features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
new file mode 100644
index 0000000..8b6be80
--- /dev/null
+++ b/examples/features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
@@ -0,0 +1,184 @@
+/*
+ * 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.transaction.xa.Xid;
+
+import org.apache.activemq.artemis.utils.Base64;
+
+public class DummyXid implements Xid {
+
+   private static final long serialVersionUID = 407053232840068514L;
+
+   private final byte[] branchQualifier;
+
+   private final int formatId;
+
+   private final byte[] globalTransactionId;
+
+   private int hash;
+
+   private boolean hashCalculated;
+
+   // Static --------------------------------------------------------
+
+   public static String toBase64String(final Xid xid) {
+      return Base64.encodeBytes(DummyXid.toByteArray(xid));
+   }
+
+   private static byte[] toByteArray(final Xid xid) {
+      byte[] branchQualifier = xid.getBranchQualifier();
+      byte[] globalTransactionId = xid.getGlobalTransactionId();
+      int formatId = xid.getFormatId();
+
+      byte[] hashBytes = new byte[branchQualifier.length + globalTransactionId.length + 4];
+      System.arraycopy(branchQualifier, 0, hashBytes, 0, branchQualifier.length);
+      System.arraycopy(globalTransactionId, 0, hashBytes, branchQualifier.length, globalTransactionId.length);
+      byte[] intBytes = new byte[4];
+      for (int i = 0; i < 4; i++) {
+         intBytes[i] = (byte) ((formatId >> i * 8) % 0xFF);
+      }
+      System.arraycopy(intBytes, 0, hashBytes, branchQualifier.length + globalTransactionId.length, 4);
+      return hashBytes;
+   }
+
+   // Constructors --------------------------------------------------
+
+   /**
+    * Standard constructor
+    *
+    * @param branchQualifier
+    * @param formatId
+    * @param globalTransactionId
+    */
+   public DummyXid(final byte[] branchQualifier, final int formatId, final byte[] globalTransactionId) {
+      this.branchQualifier = branchQualifier;
+      this.formatId = formatId;
+      this.globalTransactionId = globalTransactionId;
+   }
+
+   /**
+    * Copy constructor
+    *
+    * @param other
+    */
+   public DummyXid(final Xid other) {
+      branchQualifier = copyBytes(other.getBranchQualifier());
+      formatId = other.getFormatId();
+      globalTransactionId = copyBytes(other.getGlobalTransactionId());
+   }
+
+   // Xid implementation ------------------------------------------------------------------
+
+   public byte[] getBranchQualifier() {
+      return branchQualifier;
+   }
+
+   public int getFormatId() {
+      return formatId;
+   }
+
+   public byte[] getGlobalTransactionId() {
+      return globalTransactionId;
+   }
+
+   // Public -------------------------------------------------------------------------------
+
+   @Override
+   public int hashCode() {
+      if (!hashCalculated) {
+         calcHash();
+      }
+      return hash;
+   }
+
+   @Override
+   public boolean equals(final Object other) {
+      if (this == other) {
+         return true;
+      }
+      if (!(other instanceof Xid)) {
+         return false;
+      }
+      Xid xother = (Xid) other;
+      if (xother.getFormatId() != formatId) {
+         return false;
+      }
+      if (xother.getBranchQualifier().length != branchQualifier.length) {
+         return false;
+      }
+      if (xother.getGlobalTransactionId().length != globalTransactionId.length) {
+         return false;
+      }
+      for (int i = 0; i < branchQualifier.length; i++) {
+         byte[] otherBQ = xother.getBranchQualifier();
+         if (branchQualifier[i] != otherBQ[i]) {
+            return false;
+         }
+      }
+      for (int i = 0; i < globalTransactionId.length; i++) {
+         byte[] otherGtx = xother.getGlobalTransactionId();
+         if (globalTransactionId[i] != otherGtx[i]) {
+            return false;
+         }
+      }
+      return true;
+   }
+
+   @Override
+   public String toString() {
+      return "XidImpl (" + System.identityHashCode(this) +
+         " bq:" +
+         stringRep(branchQualifier) +
+         " formatID:" +
+         formatId +
+         " gtxid:" +
+         stringRep(globalTransactionId);
+   }
+
+   // Private -------------------------------------------------------------------------------
+
+   private String stringRep(final byte[] bytes) {
+      StringBuilder buff = new StringBuilder();
+      for (int i = 0; i < bytes.length; i++) {
+         byte b = bytes[i];
+
+         buff.append(b);
+
+         if (i != bytes.length - 1) {
+            buff.append('.');
+         }
+      }
+
+      return buff.toString();
+   }
+
+   private void calcHash() {
+      byte[] hashBytes = org.apache.activemq.artemis.jms.example.DummyXid.toByteArray(this);
+      String s = new String(hashBytes);
+      hash = s.hashCode();
+      hashCalculated = true;
+   }
+
+   private byte[] copyBytes(final byte[] other) {
+      byte[] bytes = new byte[other.length];
+
+      System.arraycopy(other, 0, bytes, 0, other.length);
+
+      return bytes;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java b/examples/features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java
new file mode 100644
index 0000000..d233731
--- /dev/null
+++ b/examples/features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java
@@ -0,0 +1,219 @@
+/*
+ * 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.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.jms.XAConnection;
+import javax.jms.XAConnectionFactory;
+import javax.jms.XASession;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+import javax.naming.InitialContext;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
+import org.apache.activemq.artemis.utils.UUIDGenerator;
+
+/**
+ * A simple JMS example showing how to administer un-finished transactions.
+ */
+public class XAHeuristicExample {
+
+   private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3001/jmxrmi";
+
+   public static void main(final String[] args) throws Exception {
+      Boolean result = true;
+      final ArrayList<String> receiveHolder = new ArrayList<String>();
+      XAConnection connection = null;
+      InitialContext initialContext = null;
+      try {
+         // Step 1. Create an initial context to perform the JNDI lookup.
+         initialContext = new InitialContext();
+
+         // Step 2. Lookup on the queue
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+
+         // Step 3. Perform a lookup on the XA Connection Factory
+         XAConnectionFactory cf = (XAConnectionFactory) initialContext.lookup("XAConnectionFactory");
+
+         // Step 4.Create a JMS XAConnection
+         connection = cf.createXAConnection();
+
+         // Step 5. Start the connection
+         connection.start();
+
+         // Step 6. Create a JMS XASession
+         XASession xaSession = connection.createXASession();
+
+         // Step 7. Create a normal session
+         Session normalSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 8. Create a normal Message Consumer
+         MessageConsumer normalConsumer = normalSession.createConsumer(queue);
+         normalConsumer.setMessageListener(new SimpleMessageListener(receiveHolder, result));
+
+         // Step 9. Get the JMS Session
+         Session session = xaSession.getSession();
+
+         // Step 10. Create a message producer
+         MessageProducer producer = session.createProducer(queue);
+
+         // Step 11. Create two Text Messages
+         TextMessage helloMessage = session.createTextMessage("hello");
+         TextMessage worldMessage = session.createTextMessage("world");
+
+         // Step 12. create a transaction
+         Xid xid1 = new DummyXid("xa-example1".getBytes(StandardCharsets.ISO_8859_1), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
+
+         // Step 13. Get the JMS XAResource
+         XAResource xaRes = xaSession.getXAResource();
+
+         // Step 14. Begin the Transaction work
+         xaRes.start(xid1, XAResource.TMNOFLAGS);
+
+         // Step 15. do work, sending hello message.
+         producer.send(helloMessage);
+
+         System.out.println("Sent message " + helloMessage.getText());
+
+         // Step 16. Stop the work for xid1
+         xaRes.end(xid1, XAResource.TMSUCCESS);
+
+         // Step 17. Prepare xid1
+         xaRes.prepare(xid1);
+
+         // Step 18. Check none should be received
+         checkNoMessageReceived(receiveHolder);
+
+         // Step 19. Create another transaction.
+         Xid xid2 = new DummyXid("xa-example2".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
+
+         // Step 20. Begin the transaction work
+         xaRes.start(xid2, XAResource.TMNOFLAGS);
+
+         // Step 21. Send the second message
+         producer.send(worldMessage);
+
+         System.out.println("Sent message " + worldMessage.getText());
+
+         // Step 22. Stop the work for xid2
+         xaRes.end(xid2, XAResource.TMSUCCESS);
+
+         // Step 23. prepare xid2
+         xaRes.prepare(xid2);
+
+         // Step 24. Again, no messages should be received!
+         checkNoMessageReceived(receiveHolder);
+
+         // Step 25. Create JMX Connector to connect to the server's MBeanServer
+         JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, String>());
+
+         // Step 26. Retrieve the MBeanServerConnection
+         MBeanServerConnection mbsc = connector.getMBeanServerConnection();
+
+         // Step 27. List the prepared transactions
+         ObjectName serverObject = ObjectNameBuilder.DEFAULT.getActiveMQServerObjectName();
+         String[] infos = (String[]) mbsc.invoke(serverObject, "listPreparedTransactions", null, null);
+
+         System.out.println("Prepared transactions: ");
+         for (String i : infos) {
+            System.out.println(i);
+         }
+
+         // Step 28. Roll back the first transaction
+         mbsc.invoke(serverObject, "rollbackPreparedTransaction", new String[]{DummyXid.toBase64String(xid1)}, new String[]{"java.lang.String"});
+
+         // Step 29. Commit the second one
+         mbsc.invoke(serverObject, "commitPreparedTransaction", new String[]{DummyXid.toBase64String(xid2)}, new String[]{"java.lang.String"});
+
+         Thread.sleep(2000);
+
+         // Step 30. Check the result, only the 'world' message received
+         checkMessageReceived("world", receiveHolder);
+
+         // Step 31. Check the prepared transaction again, should have none.
+         infos = (String[]) mbsc.invoke(serverObject, "listPreparedTransactions", null, null);
+         System.out.println("No. of prepared transactions now: " + infos.length);
+
+         // Step 32. Close the JMX Connector
+         connector.close();
+      }
+      finally {
+         // Step 32. Be sure to close our JMS resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+
+   private static void checkMessageReceived(final String value, ArrayList<String> receiveHolder) {
+      if (receiveHolder.size() != 1) {
+         throw new IllegalStateException("Number of messages received not correct ! -- " + receiveHolder.size());
+      }
+      String msg = receiveHolder.get(0);
+      if (!msg.equals(value)) {
+         throw new IllegalStateException("Received message [" + msg + "], but we expect [" + value + "]");
+      }
+      receiveHolder.clear();
+   }
+
+   private static void checkNoMessageReceived(ArrayList<String> receiveHolder) {
+      if (receiveHolder.size() > 0) {
+         throw new IllegalStateException("Message received, wrong!");
+      }
+      receiveHolder.clear();
+   }
+}
+
+class SimpleMessageListener implements MessageListener {
+
+   ArrayList<String> receiveHolder;
+   Boolean result;
+
+   SimpleMessageListener(ArrayList<String> receiveHolder, Boolean result) {
+      this.receiveHolder = receiveHolder;
+      this.result = result;
+   }
+
+   public void onMessage(final Message message) {
+      try {
+         System.out.println("Message received: " + ((TextMessage) message).getText());
+         receiveHolder.add(((TextMessage) message).getText());
+      }
+      catch (JMSException e) {
+         result = false;
+         e.printStackTrace();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/xa-heuristic/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-heuristic/src/main/resources/jndi.properties b/examples/features/standard/xa-heuristic/src/main/resources/jndi.properties
new file mode 100644
index 0000000..77561f7
--- /dev/null
+++ b/examples/features/standard/xa-heuristic/src/main/resources/jndi.properties
@@ -0,0 +1,21 @@
+# 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
+connectionFactory.XAConnectionFactory=tcp://localhost:61616?type=XA_CF
+queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/xa-receive/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-receive/pom.xml b/examples/features/standard/xa-receive/pom.xml
new file mode 100644
index 0000000..f421aaf
--- /dev/null
+++ b/examples/features/standard/xa-receive/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>xa-receive</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS XA Receive 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>
+                     <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.XAReceiveExample</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>xa-receive</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/xa-receive/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-receive/readme.html b/examples/features/standard/xa-receive/readme.html
new file mode 100644
index 0000000..ab6d7d7
--- /dev/null
+++ b/examples/features/standard/xa-receive/readme.html
@@ -0,0 +1,48 @@
+<!--
+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 XA Receive 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 XA Receive 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 receiving a message within the scope of an XA transaction. When using an XA transaction
+         the message will only be acknowledged and removed from the queue when the transaction is committed.
+     If the transaction is not committed the message maybe redelivered after rollback or during XA recovery.</p>
+
+     <p>ActiveMQ Artemis is JTA aware, meaning you can use ActiveMQ Artemis in an XA transactional environment
+     and participate in XA transactions. It provides the javax.transaction.xa.XAResource interface for that
+     purpose. Users can get a XAConnectionFactory to create XAConnections and XASessions.</p>
+
+     <p>In this example we simulate a transaction manager to control the transactions. First we create an XASession
+      for receiving and a normal session for sending. Then we start a new xa transaction and enlist the receiving
+      XASession through its XAResource. We then send two words, 'hello' and 'world', receive them, and let the
+      transaction roll back. The received messages are cancelled back to the queue. Next we start
+      a new transaction with the same XAResource enlisted, but this time we commit the transaction after receiving the
+      messages. Then we check that no more messages are to be received.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java b/examples/features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
new file mode 100644
index 0000000..4dbe2f8
--- /dev/null
+++ b/examples/features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
@@ -0,0 +1,184 @@
+/*
+ * 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 org.apache.activemq.artemis.utils.Base64;
+
+import javax.transaction.xa.Xid;
+
+public class DummyXid implements Xid {
+
+   private static final long serialVersionUID = 407053232840068514L;
+
+   private final byte[] branchQualifier;
+
+   private final int formatId;
+
+   private final byte[] globalTransactionId;
+
+   private int hash;
+
+   private boolean hashCalculated;
+
+   // Static --------------------------------------------------------
+
+   public static String toBase64String(final Xid xid) {
+      return Base64.encodeBytes(DummyXid.toByteArray(xid));
+   }
+
+   private static byte[] toByteArray(final Xid xid) {
+      byte[] branchQualifier = xid.getBranchQualifier();
+      byte[] globalTransactionId = xid.getGlobalTransactionId();
+      int formatId = xid.getFormatId();
+
+      byte[] hashBytes = new byte[branchQualifier.length + globalTransactionId.length + 4];
+      System.arraycopy(branchQualifier, 0, hashBytes, 0, branchQualifier.length);
+      System.arraycopy(globalTransactionId, 0, hashBytes, branchQualifier.length, globalTransactionId.length);
+      byte[] intBytes = new byte[4];
+      for (int i = 0; i < 4; i++) {
+         intBytes[i] = (byte) ((formatId >> i * 8) % 0xFF);
+      }
+      System.arraycopy(intBytes, 0, hashBytes, branchQualifier.length + globalTransactionId.length, 4);
+      return hashBytes;
+   }
+
+   // Constructors --------------------------------------------------
+
+   /**
+    * Standard constructor
+    *
+    * @param branchQualifier
+    * @param formatId
+    * @param globalTransactionId
+    */
+   public DummyXid(final byte[] branchQualifier, final int formatId, final byte[] globalTransactionId) {
+      this.branchQualifier = branchQualifier;
+      this.formatId = formatId;
+      this.globalTransactionId = globalTransactionId;
+   }
+
+   /**
+    * Copy constructor
+    *
+    * @param other
+    */
+   public DummyXid(final Xid other) {
+      branchQualifier = copyBytes(other.getBranchQualifier());
+      formatId = other.getFormatId();
+      globalTransactionId = copyBytes(other.getGlobalTransactionId());
+   }
+
+   // Xid implementation ------------------------------------------------------------------
+
+   public byte[] getBranchQualifier() {
+      return branchQualifier;
+   }
+
+   public int getFormatId() {
+      return formatId;
+   }
+
+   public byte[] getGlobalTransactionId() {
+      return globalTransactionId;
+   }
+
+   // Public -------------------------------------------------------------------------------
+
+   @Override
+   public int hashCode() {
+      if (!hashCalculated) {
+         calcHash();
+      }
+      return hash;
+   }
+
+   @Override
+   public boolean equals(final Object other) {
+      if (this == other) {
+         return true;
+      }
+      if (!(other instanceof Xid)) {
+         return false;
+      }
+      Xid xother = (Xid) other;
+      if (xother.getFormatId() != formatId) {
+         return false;
+      }
+      if (xother.getBranchQualifier().length != branchQualifier.length) {
+         return false;
+      }
+      if (xother.getGlobalTransactionId().length != globalTransactionId.length) {
+         return false;
+      }
+      for (int i = 0; i < branchQualifier.length; i++) {
+         byte[] otherBQ = xother.getBranchQualifier();
+         if (branchQualifier[i] != otherBQ[i]) {
+            return false;
+         }
+      }
+      for (int i = 0; i < globalTransactionId.length; i++) {
+         byte[] otherGtx = xother.getGlobalTransactionId();
+         if (globalTransactionId[i] != otherGtx[i]) {
+            return false;
+         }
+      }
+      return true;
+   }
+
+   @Override
+   public String toString() {
+      return "XidImpl (" + System.identityHashCode(this) +
+         " bq:" +
+         stringRep(branchQualifier) +
+         " formatID:" +
+         formatId +
+         " gtxid:" +
+         stringRep(globalTransactionId);
+   }
+
+   // Private -------------------------------------------------------------------------------
+
+   private String stringRep(final byte[] bytes) {
+      StringBuilder buff = new StringBuilder();
+      for (int i = 0; i < bytes.length; i++) {
+         byte b = bytes[i];
+
+         buff.append(b);
+
+         if (i != bytes.length - 1) {
+            buff.append('.');
+         }
+      }
+
+      return buff.toString();
+   }
+
+   private void calcHash() {
+      byte[] hashBytes = DummyXid.toByteArray(this);
+      String s = new String(hashBytes);
+      hash = s.hashCode();
+      hashCalculated = true;
+   }
+
+   private byte[] copyBytes(final byte[] other) {
+      byte[] bytes = new byte[other.length];
+
+      System.arraycopy(other, 0, bytes, 0, other.length);
+
+      return bytes;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java b/examples/features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java
new file mode 100644
index 0000000..4c4448d
--- /dev/null
+++ b/examples/features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java
@@ -0,0 +1,145 @@
+/*
+ * 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.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.XAConnection;
+import javax.jms.XAConnectionFactory;
+import javax.jms.XASession;
+import javax.naming.InitialContext;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import java.nio.charset.StandardCharsets;
+
+import org.apache.activemq.artemis.utils.UUIDGenerator;
+
+/**
+ * A simple JMS example showing the usage of XA support in JMS.
+ */
+public class XAReceiveExample {
+
+   public static void main(final String[] args) throws Exception {
+      XAConnection connection = null;
+      InitialContext initialContext = null;
+      try {
+         // Step 1. Create an initial context to perform the JNDI lookup.
+         initialContext = new InitialContext();
+
+         // Step 2. Lookup on the queue
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+
+         // Step 3. Perform a lookup on the XA Connection Factory
+         XAConnectionFactory cf = (XAConnectionFactory) initialContext.lookup("XAConnectionFactory");
+
+         // Step 4.Create a JMS XAConnection
+         connection = cf.createXAConnection();
+
+         // Step 5. Start the connection
+         connection.start();
+
+         // Step 6. Create a JMS XASession
+         XASession xaSession = connection.createXASession();
+
+         // Step 7. Create a normal session
+         Session normalSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 8. Create a normal Message Producer
+         MessageProducer normalProducer = normalSession.createProducer(queue);
+
+         // Step 9. Get the JMS Session
+         Session session = xaSession.getSession();
+
+         // Step 10. Create a message consumer
+         MessageConsumer xaConsumer = session.createConsumer(queue);
+
+         // Step 11. Create two Text Messages
+         TextMessage helloMessage = session.createTextMessage("hello");
+         TextMessage worldMessage = session.createTextMessage("world");
+
+         // Step 12. create a transaction
+         Xid xid1 = new DummyXid("xa-example1".getBytes(StandardCharsets.US_ASCII), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
+
+         // Step 13. Get the JMS XAResource
+         XAResource xaRes = xaSession.getXAResource();
+
+         // Step 14. Begin the Transaction work
+         xaRes.start(xid1, XAResource.TMNOFLAGS);
+
+         // Step 15. Send two messages.
+         normalProducer.send(helloMessage);
+         normalProducer.send(worldMessage);
+
+         // Step 16. Receive the message
+         TextMessage rm1 = (TextMessage) xaConsumer.receive();
+         System.out.println("Message received: " + rm1.getText());
+         TextMessage rm2 = (TextMessage) xaConsumer.receive();
+         System.out.println("Message received: " + rm2.getText());
+
+         // Step 17. Stop the work
+         xaRes.end(xid1, XAResource.TMSUCCESS);
+
+         // Step 18. Prepare
+         xaRes.prepare(xid1);
+
+         // Step 19. Roll back the transaction
+         xaRes.rollback(xid1);
+
+         // Step 20. Create another transaction
+         Xid xid2 = new DummyXid("xa-example2".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
+
+         // Step 21. Start the transaction
+         xaRes.start(xid2, XAResource.TMNOFLAGS);
+
+         // Step 22. receive those messages again
+         rm1 = (TextMessage) xaConsumer.receive();
+         System.out.println("Message received again: " + rm1.getText());
+         rm2 = (TextMessage) xaConsumer.receive();
+         System.out.println("Message received again: " + rm2.getText());
+
+         // Step 23. Stop the work
+         xaRes.end(xid2, XAResource.TMSUCCESS);
+
+         // Step 24. Prepare
+         xaRes.prepare(xid2);
+
+         // Step 25. Commit!
+         xaRes.commit(xid2, false);
+
+         // Step 26. Check no more messages are received.
+         TextMessage rm3 = (TextMessage) xaConsumer.receive(2000);
+         if (rm3 == null) {
+            System.out.println("No message received after commit.");
+         }
+         else {
+            throw new IllegalStateException();
+         }
+      }
+      finally {
+         // Step 27. 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/6b17d966/examples/features/standard/xa-receive/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-receive/src/main/resources/jndi.properties b/examples/features/standard/xa-receive/src/main/resources/jndi.properties
new file mode 100644
index 0000000..77561f7
--- /dev/null
+++ b/examples/features/standard/xa-receive/src/main/resources/jndi.properties
@@ -0,0 +1,21 @@
+# 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
+connectionFactory.XAConnectionFactory=tcp://localhost:61616?type=XA_CF
+queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/xa-send/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-send/pom.xml b/examples/features/standard/xa-send/pom.xml
new file mode 100644
index 0000000..b4dfdf4
--- /dev/null
+++ b/examples/features/standard/xa-send/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>xa-send</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS XA Send 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>
+                     <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.XASendExample</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>xa-send</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/xa-send/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-send/readme.html b/examples/features/standard/xa-send/readme.html
new file mode 100644
index 0000000..fb3db4c
--- /dev/null
+++ b/examples/features/standard/xa-send/readme.html
@@ -0,0 +1,215 @@
+<!--
+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 XA Send 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 XA Send Example</h1>
+     <p>This example shows you how message sending behaves in an XA transaction in ActiveMQ Artemis. When a message is sent within
+         the scope of an XA transaction, it will only reach the queue once the transaction is committed.
+     If the transaction is rolled back the sent messages will be discarded by the server.</p>
+
+     <p>ActiveMQ Artemis is JTA aware, meaning you can use ActiveMQ Artemis in a XA transactional environment
+     and participate in XA transactions. It provides the javax.transaction.xa.XAResource interface for that
+     purpose. Users can get a XAConnectionFactory to create XAConnections and XASessions.</p>
+
+     <p>In this example we simulate a transaction manager to control the transactions. First we create an XASession
+     and enlist it in a transaction through its XAResource. We then send two words, 'hello' and 'world', with
+     the session, let the transaction roll back. The messages are discarded and never be received. Next we start
+     a new transaction with the same XAResource, but this time we commit the transaction. Both messages are received.</p>
+
+     <h2>Example step-by-step</h2>
+     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
+
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
+        <pre class="prettyprint">
+           <code>InitialContext initialContext = getContext(0);</code>
+        </pre>
+
+        <li>We look-up the JMS queue object from JNDI</li>
+        <pre class="prettyprint">
+           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>We perform a lookup on the XA Connection Factory</li>
+        <pre class="prettyprint">
+           <code>XAConnectionFactory cf = (XAConnectionFactory) initialContext.lookup("/XAConnectionFactory");</code>
+        </pre>
+
+        <li>We create a JMS XAConnection</li>
+        <pre class="prettyprint">
+           <code>connection = cf.createXAConnection();</code>
+        </pre>
+
+        <li>We Start the connection</li>
+        <pre class="prettyprint">
+           <code>connection.start();</code>
+        </pre>
+
+        <li>We create a JMS XASession</li>
+        <pre class="prettyprint">
+          <code>XASession xaSession = connection.createXASession();</code>
+       </pre>
+
+        <li>We create a normal session</li>
+        <pre class="prettyprint">
+          <code>Session normalSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
+       </pre>
+
+        <li>We create a normal Message Consumer</li>
+        <pre class="prettyprint">
+           <code>
+           MessageConsumer normalConsumer = normalSession.createConsumer(queue);
+           normalConsumer.setMessageListener(new SimpleMessageListener());
+           </code>
+       </pre>
+
+        <li>We get the JMS Session</li>
+        <pre class="prettyprint">
+          <code>Session session = xaSession.getSession();</code>
+       </pre>
+
+        <li>We create a message producer</li>
+        <pre class="prettyprint">
+          <code>MessageProducer producer = session.createProducer(queue);</code>
+       </pre>
+
+        <li>We create two Text Messages</li>
+        <pre class="prettyprint">
+          <code>
+          TextMessage helloMessage = session.createTextMessage("hello");
+          TextMessage worldMessage = session.createTextMessage("world");
+          </code>
+       </pre>
+
+        <li>We create a transaction</li>
+        <pre class="prettyprint">
+          <code>Xid xid1 = new XidImpl("xa-example1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());</code>
+       </pre>
+
+        <li>We get the JMS XAResource</li>
+        <pre class="prettyprint">
+          <code>XAResource xaRes = xaSession.getXAResource();</code>
+       </pre>
+
+        <li>We begin the Transaction work</li>
+        <pre class="prettyprint">
+          <code>xaRes.start(xid1, XAResource.TMNOFLAGS);</code>
+       </pre>
+
+        <li>We do work, sending two messages.</li>
+        <pre class="prettyprint">
+          <code>
+          producer.send(helloMessage);
+          producer.send(worldMessage);
+          </code>
+       </pre>
+
+        <li>We check the result, it should receive none!</li>
+        <pre class="prettyprint">
+          <code>checkNoMessageReceived();</code>
+       </pre>
+
+        <li>We stop the work</li>
+        <pre class="prettyprint">
+          <code>xaRes.end(xid1, XAResource.TMSUCCESS);</code>
+       </pre>
+
+        <li>We prepare</li>
+        <pre class="prettyprint">
+          <code>xaRes.prepare(xid1);</code>
+       </pre>
+
+        <li>We roll back the transaction </li>
+        <pre class="prettyprint">
+          <code>xaRes.rollback(xid1);</code>
+       </pre>
+
+        <li>We check no messages should be received! </li>
+        <pre class="prettyprint">
+          <code>checkNoMessageReceived();</code>
+       </pre>
+
+        <li>We create another transaction</li>
+        <pre class="prettyprint">
+          <code>Xid xid2 = new XidImpl("xa-example2".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());</code>
+       </pre>
+
+        <li>We start the transaction</li>
+        <pre class="prettyprint">
+          <code>xaRes.start(xid2, XAResource.TMNOFLAGS);</code>
+       </pre>
+
+        <li>We re-send those messages</li>
+        <pre class="prettyprint">
+           <code>
+           producer.send(helloMessage);
+           producer.send(worldMessage);
+           </code>
+       </pre>
+
+        <li>We stop the work</li>
+        <pre class="prettyprint">
+          <code>xaRes.end(xid2, XAResource.TMSUCCESS);</code>
+       </pre>
+
+        <li>We prepare</li>
+        <pre class="prettyprint">
+          <code>xaRes.prepare(xid2);</code>
+       </pre>
+
+        <li>We check that no messages should be received at this moment</li>
+        <pre class="prettyprint">
+          <code>checkNoMessageReceived();</code>
+       </pre>
+
+        <li>We commit!</li>
+        <pre class="prettyprint">
+          <code>xaRes.commit(xid2, false);</code>
+       </pre>
+
+        <li>We check that all messages are received.</li>
+        <pre class="prettyprint">
+          <code>checkAllMessageReceived();</code>
+       </pre>
+
+        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
+
+        <pre class="prettyprint">
+           <code>finally
+           {
+              if (initialContext != null)
+              {
+                initialContext.close();
+              }
+              if (connection != null)
+              {
+                 connection.close();
+              }
+           }</code>
+        </pre>
+     </ol>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java b/examples/features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
new file mode 100644
index 0000000..4dbe2f8
--- /dev/null
+++ b/examples/features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
@@ -0,0 +1,184 @@
+/*
+ * 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 org.apache.activemq.artemis.utils.Base64;
+
+import javax.transaction.xa.Xid;
+
+public class DummyXid implements Xid {
+
+   private static final long serialVersionUID = 407053232840068514L;
+
+   private final byte[] branchQualifier;
+
+   private final int formatId;
+
+   private final byte[] globalTransactionId;
+
+   private int hash;
+
+   private boolean hashCalculated;
+
+   // Static --------------------------------------------------------
+
+   public static String toBase64String(final Xid xid) {
+      return Base64.encodeBytes(DummyXid.toByteArray(xid));
+   }
+
+   private static byte[] toByteArray(final Xid xid) {
+      byte[] branchQualifier = xid.getBranchQualifier();
+      byte[] globalTransactionId = xid.getGlobalTransactionId();
+      int formatId = xid.getFormatId();
+
+      byte[] hashBytes = new byte[branchQualifier.length + globalTransactionId.length + 4];
+      System.arraycopy(branchQualifier, 0, hashBytes, 0, branchQualifier.length);
+      System.arraycopy(globalTransactionId, 0, hashBytes, branchQualifier.length, globalTransactionId.length);
+      byte[] intBytes = new byte[4];
+      for (int i = 0; i < 4; i++) {
+         intBytes[i] = (byte) ((formatId >> i * 8) % 0xFF);
+      }
+      System.arraycopy(intBytes, 0, hashBytes, branchQualifier.length + globalTransactionId.length, 4);
+      return hashBytes;
+   }
+
+   // Constructors --------------------------------------------------
+
+   /**
+    * Standard constructor
+    *
+    * @param branchQualifier
+    * @param formatId
+    * @param globalTransactionId
+    */
+   public DummyXid(final byte[] branchQualifier, final int formatId, final byte[] globalTransactionId) {
+      this.branchQualifier = branchQualifier;
+      this.formatId = formatId;
+      this.globalTransactionId = globalTransactionId;
+   }
+
+   /**
+    * Copy constructor
+    *
+    * @param other
+    */
+   public DummyXid(final Xid other) {
+      branchQualifier = copyBytes(other.getBranchQualifier());
+      formatId = other.getFormatId();
+      globalTransactionId = copyBytes(other.getGlobalTransactionId());
+   }
+
+   // Xid implementation ------------------------------------------------------------------
+
+   public byte[] getBranchQualifier() {
+      return branchQualifier;
+   }
+
+   public int getFormatId() {
+      return formatId;
+   }
+
+   public byte[] getGlobalTransactionId() {
+      return globalTransactionId;
+   }
+
+   // Public -------------------------------------------------------------------------------
+
+   @Override
+   public int hashCode() {
+      if (!hashCalculated) {
+         calcHash();
+      }
+      return hash;
+   }
+
+   @Override
+   public boolean equals(final Object other) {
+      if (this == other) {
+         return true;
+      }
+      if (!(other instanceof Xid)) {
+         return false;
+      }
+      Xid xother = (Xid) other;
+      if (xother.getFormatId() != formatId) {
+         return false;
+      }
+      if (xother.getBranchQualifier().length != branchQualifier.length) {
+         return false;
+      }
+      if (xother.getGlobalTransactionId().length != globalTransactionId.length) {
+         return false;
+      }
+      for (int i = 0; i < branchQualifier.length; i++) {
+         byte[] otherBQ = xother.getBranchQualifier();
+         if (branchQualifier[i] != otherBQ[i]) {
+            return false;
+         }
+      }
+      for (int i = 0; i < globalTransactionId.length; i++) {
+         byte[] otherGtx = xother.getGlobalTransactionId();
+         if (globalTransactionId[i] != otherGtx[i]) {
+            return false;
+         }
+      }
+      return true;
+   }
+
+   @Override
+   public String toString() {
+      return "XidImpl (" + System.identityHashCode(this) +
+         " bq:" +
+         stringRep(branchQualifier) +
+         " formatID:" +
+         formatId +
+         " gtxid:" +
+         stringRep(globalTransactionId);
+   }
+
+   // Private -------------------------------------------------------------------------------
+
+   private String stringRep(final byte[] bytes) {
+      StringBuilder buff = new StringBuilder();
+      for (int i = 0; i < bytes.length; i++) {
+         byte b = bytes[i];
+
+         buff.append(b);
+
+         if (i != bytes.length - 1) {
+            buff.append('.');
+         }
+      }
+
+      return buff.toString();
+   }
+
+   private void calcHash() {
+      byte[] hashBytes = DummyXid.toByteArray(this);
+      String s = new String(hashBytes);
+      hash = s.hashCode();
+      hashCalculated = true;
+   }
+
+   private byte[] copyBytes(final byte[] other) {
+      byte[] bytes = new byte[other.length];
+
+      System.arraycopy(other, 0, bytes, 0, other.length);
+
+      return bytes;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java b/examples/features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java
new file mode 100644
index 0000000..fd87f61
--- /dev/null
+++ b/examples/features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java
@@ -0,0 +1,191 @@
+/*
+ * 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.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.jms.XAConnection;
+import javax.jms.XAConnectionFactory;
+import javax.jms.XASession;
+import javax.naming.InitialContext;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.activemq.artemis.utils.UUIDGenerator;
+
+/**
+ * A simple JMS example showing the usage of XA support in JMS.
+ */
+public class XASendExample {
+
+   public static void main(final String[] args) throws Exception {
+      AtomicBoolean result = new AtomicBoolean(true);
+      final ArrayList<String> receiveHolder = new ArrayList<String>();
+      XAConnection connection = null;
+      InitialContext initialContext = null;
+      try {
+         // Step 1. Create an initial context to perform the JNDI lookup.
+         initialContext = new InitialContext();
+
+         // Step 2. Lookup on the queue
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+
+         // Step 3. Perform a lookup on the XA Connection Factory
+         XAConnectionFactory cf = (XAConnectionFactory) initialContext.lookup("XAConnectionFactory");
+
+         // Step 4.Create a JMS XAConnection
+         connection = cf.createXAConnection();
+
+         // Step 5. Start the connection
+         connection.start();
+
+         // Step 6. Create a JMS XASession
+         XASession xaSession = connection.createXASession();
+
+         // Step 7. Create a normal session
+         Session normalSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 8. Create a normal Message Consumer
+         MessageConsumer normalConsumer = normalSession.createConsumer(queue);
+         normalConsumer.setMessageListener(new SimpleMessageListener(receiveHolder, result));
+
+         // Step 9. Get the JMS Session
+         Session session = xaSession.getSession();
+
+         // Step 10. Create a message producer
+         MessageProducer producer = session.createProducer(queue);
+
+         // Step 11. Create two Text Messages
+         TextMessage helloMessage = session.createTextMessage("hello");
+         TextMessage worldMessage = session.createTextMessage("world");
+
+         // Step 12. create a transaction
+         Xid xid1 = new DummyXid("xa-example1".getBytes(StandardCharsets.UTF_8), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
+
+         // Step 13. Get the JMS XAResource
+         XAResource xaRes = xaSession.getXAResource();
+
+         // Step 14. Begin the Transaction work
+         xaRes.start(xid1, XAResource.TMNOFLAGS);
+
+         // Step 15. do work, sending two messages.
+         producer.send(helloMessage);
+         producer.send(worldMessage);
+
+         Thread.sleep(2000);
+
+         // Step 16. Check the result, it should receive none!
+         checkNoMessageReceived(receiveHolder);
+
+         // Step 17. Stop the work
+         xaRes.end(xid1, XAResource.TMSUCCESS);
+
+         // Step 18. Prepare
+         xaRes.prepare(xid1);
+
+         // Step 19. Roll back the transaction
+         xaRes.rollback(xid1);
+
+         // Step 20. No messages should be received!
+         checkNoMessageReceived(receiveHolder);
+
+         // Step 21. Create another transaction
+         Xid xid2 = new DummyXid("xa-example2".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
+
+         // Step 22. Start the transaction
+         xaRes.start(xid2, XAResource.TMNOFLAGS);
+
+         // Step 23. Re-send those messages
+         producer.send(helloMessage);
+         producer.send(worldMessage);
+
+         // Step 24. Stop the work
+         xaRes.end(xid2, XAResource.TMSUCCESS);
+
+         // Step 25. Prepare
+         xaRes.prepare(xid2);
+
+         // Step 26. No messages should be received at this moment
+         checkNoMessageReceived(receiveHolder);
+
+         // Step 27. Commit!
+         xaRes.commit(xid2, false);
+
+         Thread.sleep(2000);
+
+         // Step 28. Check the result, all message received
+         checkAllMessageReceived(receiveHolder);
+
+         if (!result.get())
+            throw new IllegalStateException();
+      }
+      finally {
+         // Step 29. Be sure to close our JMS resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+
+   private static void checkAllMessageReceived(ArrayList<String> receiveHolder) {
+      if (receiveHolder.size() != 2) {
+         throw new IllegalStateException("Number of messages received not correct ! -- " + receiveHolder.size());
+      }
+      receiveHolder.clear();
+   }
+
+   private static void checkNoMessageReceived(ArrayList<String> receiveHolder) {
+      if (receiveHolder.size() > 0) {
+         throw new IllegalStateException("Message received, wrong!");
+      }
+      receiveHolder.clear();
+   }
+}
+
+class SimpleMessageListener implements MessageListener {
+
+   ArrayList<String> receiveHolder;
+   AtomicBoolean result;
+
+   public SimpleMessageListener(ArrayList<String> receiveHolder, AtomicBoolean result) {
+      this.receiveHolder = receiveHolder;
+      this.result = result;
+   }
+
+   public void onMessage(final Message message) {
+      try {
+         System.out.println("Message received: " + message);
+         receiveHolder.add(((TextMessage) message).getText());
+      }
+      catch (JMSException e) {
+         result.set(false);
+         e.printStackTrace();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/xa-send/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/xa-send/src/main/resources/jndi.properties b/examples/features/standard/xa-send/src/main/resources/jndi.properties
new file mode 100644
index 0000000..77561f7
--- /dev/null
+++ b/examples/features/standard/xa-send/src/main/resources/jndi.properties
@@ -0,0 +1,21 @@
+# 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
+connectionFactory.XAConnectionFactory=tcp://localhost:61616?type=XA_CF
+queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/sub-modules/aerogear/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/aerogear/pom.xml b/examples/features/sub-modules/aerogear/pom.xml
new file mode 100644
index 0000000..c522d78
--- /dev/null
+++ b/examples/features/sub-modules/aerogear/pom.xml
@@ -0,0 +1,125 @@
+<?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.modules</groupId>
+      <artifactId>broker-modules</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <properties>
+      <endpoint/>
+      <applicationid/>
+      <mastersecret/>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <artifactId>aerogear</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS AeroGear Example</name>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</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>
+                     <!-- this list was extracted from mvn dependency:tree on integration/aerogear -->
+                     <libList>
+                        <param>org.apache.activemq:artemis-aerogear-integration:${project.version}</param>
+                        <param>org.jboss.aerogear:unifiedpush-java-client:1.0.0</param>
+                        <param>net.iharder:base64:2.3.8</param>
+                        <param>com.fasterxml.jackson.core:jackson-annotations:2.3.0</param>
+                        <param>com.fasterxml.jackson.core:jackson-core:2.3.0</param>
+                        <param>org.jboss.resteasy:resteasy-jackson-provider:2.3.2.Final</param>
+                        <param>org.codehaus.jackson:jackson-core-asl:1.8.5</param>
+                        <param>org.codehaus.jackson:jackson-mapper-asl:1.8.5</param>
+                        <param>org.codehaus.jackson:jackson-jaxrs:1.8.5</param>
+                        <param>org.codehaus.jackson:jackson-xc:1.8.5</param>
+                     </libList>
+                  </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.AerogearExample</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.modules</groupId>
+                  <artifactId>aerogear</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/sub-modules/aerogear/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/aerogear/readme.html b/examples/features/sub-modules/aerogear/readme.html
new file mode 100644
index 0000000..3534a4c
--- /dev/null
+++ b/examples/features/sub-modules/aerogear/readme.html
@@ -0,0 +1,157 @@
+<!--
+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 AeroGear 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 AeroGear 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 how you can send a message to a mobile device by leveraging <a href="http://aerogear.org/push/">AeroGears push</a> technology which
+         provides support for different push notification technologies like Google Cloud Messaging, Apple's APNs or
+         Mozilla's SimplePush.</p>
+
+     <p>For this example you will need an AeroGear Application running somewhere, a good way to do this is to deploy the
+        Push Application on <href a="">openshift</href>, you can follow the AeroGear Push 0.X Quickstart.</p>
+
+     <p>Once you have created your AeroGear Push Application you can create a mobile application. Simply log into the application
+     on the web and create a new mobile application by clicking the 'create' button. Once created you will see an application id
+     and a master secret, you will need the later to run the example.</p>
+
+     <p>lastly you will need to create a variant. For this example we will be using Android so you will need to create a google project,
+     this <a href="http://aerogear.org/docs/guides/aerogear-push-android/google-setup/">article</a> explains how to do this.
+     Once created click on your app then click 'add' to add a variant. choose 'google cloud messaging', enter your google
+         API key and the project number from your google project and click create</p>
+
+     <p>Now before we run the example we need a mobile application to receive it. Writing a mobile app is beyond the scope
+     of this example but for testing purposes we have supplied an Android app you can use, simply install on your android phone.
+     It can be found <a href="http://downloads.jboss.org.apache.activemq/ActiveMQAeroGear.apk">here</a>. For a more in depth mobile
+         app example visit the AeroGear site.</p>
+
+     <p>Once you have installed the mobile app you will need to configure the following:</p>
+     <p>AeroGear Unified Push URL : This is the URL where your aerogear server is running, something like http://myapp-mydomain.rhcloud.com
+        AeroGear Variant ID : This is the ID of the variant you created in AeroGear
+        AeroGear Variant Secret : This is the secret for your variant
+        GCM Sender ID : this is the Google project Number you created on Google
+        Variant : you can use this to target messages if needed.
+     </p>
+
+     <p>Once you set all these correctly you should get a message saying your mobile app is registered, if you log into
+         your AeroGear app you should see it registered with the variant.</p>
+
+
+     <p>Now to run the example simply run the following command
+         'mvn -Dendpoint=my aerogear url -Dapplicationid=my application id -Dmastersecret=my master secret -Djsse.enableSNIExtension=false clean verify'.
+     If you arent using java 7 you can omit the 'jsse.enableSNIExtension=false'</p>
+
+   <p>You should see something like this in your ActiveMQServer</p>
+     <ol>
+        <pre class="prettyprint">
+           <code>
+   Dec 04, 2013 3:25:39 PM org.jboss.aerogear.unifiedpush.SenderClient submitPayload
+   INFO: HTTP Response code from UnifiedPush Server: 302
+   Dec 04, 2013 3:25:39 PM org.jboss.aerogear.unifiedpush.SenderClient submitPayload
+   INFO: Performing redirect to 'https://myapp-mydomain.rhcloud.com/rest/sender/'
+   Dec 04, 2013 3:25:40 PM org.jboss.aerogear.unifiedpush.SenderClient submitPayload
+   INFO: HTTP Response code from UnifiedPush Server: 200
+           </code>
+        </pre>
+     </ol>
+   <p>And on your mobile app you should see a message from ActiveMQ</p>
+
+  <p>Now lets look a bit more closely at the configuration in broker.xml</p>
+     <ol>
+        <pre class="prettyprint">
+           <code>
+   &lt;queues>
+       &lt;queue name="jms.queue.exampleQueue">
+           &lt;address>jms.queue.exampleQueue&lt;/address>
+       &lt;/queue>
+   &lt;/queues>
+
+   &lt;connector-services>
+       &lt;connector-service name="aerogear-connector">
+           &lt;factory-class>org.apache.activemq.integration.aerogear.AeroGearConnectorServiceFactory&lt;/factory-class>
+           &lt;param key="endpoint" value="${endpoint}"/>
+           &lt;param key="queue" value="jms.queue.exampleQueue"/>
+           &lt;param key="application-id" value="${applicationid}"/>
+           &lt;param key="master-secret" value="${mastersecret}"/>
+       &lt;/connector-service>
+   &lt;/connector-services>
+           </code>
+        </pre>
+     </ol>
+  <p>Firstly you will see that we have to create a core queue so it is available when the connector is started, the following are mandatory parameters:</p>
+  <ol>
+      <li>endpoint - The endpoint or URL of you AeroGear application</li>
+      <li>queue - The name of the queue to consume from</li>
+      <li>application-id - The application id of your mobile application in AeroGear</li>
+      <li>master-secret - the secret of your mobile application in AeroGear</li>
+  </ol>
+  <p>as well as those there are also the following optional parameters</p>
+  <ol>
+      <li>ttl - The time to live for the message once AeroGear receives it</li>
+      <li>badge - The badge the mobile app should use for the notification</li>
+      <li>sound - The sound the mobile app should use for the notification</li>
+      <li>filter - A message filter(selector) to use on the connector</li>
+      <li>retry-interval - If an error occurs on send, how long before we try again</li>
+      <li>retry-attempts - How many times we should try to reconnect after an error</li>
+      <li>variants - A comma separated list of variants that should get the message</li>
+      <li>aliases - A list of aliases that should get the message</li>
+      <li>device-types - A list of device types that should get the message</li>
+  </ol>
+  <p>More in depth explanations of these can be found in the AeroGear docs.</p>
+  <p>Now lets look at a snippet of code we used to send the message for our JMS client</p>
+  <pre class="prettyprint">
+      <code>
+  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
+  Message message = session.createMessage();
+
+  message.setStringProperty("AEROGEAR_ALERT", "Hello this is a notification from ActiveMQ");
+
+  producer.send(message);
+      </code>
+  </pre>
+  <p> The most important thing here is string propert we have set on the message, i.e. 'AEROGEAR_ALERT'. This is the
+      actual alert that is sent via AeroGear</p>
+  <p>As well as the alert itself you can override any of the above optional parameters in the same fashionby using the
+      following propert names: AEROGEAR_SOUND,AEROGEAR_BADGE,AEROGEAR_TTL,AEROGEAR_VARIANTS,AEROGEAR_ALIASES and AEROGEAR_DEVICE_TYPES</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/sub-modules/aerogear/src/main/java/org/apache/activemq/artemis/jms/example/AerogearExample.java
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/aerogear/src/main/java/org/apache/activemq/artemis/jms/example/AerogearExample.java b/examples/features/sub-modules/aerogear/src/main/java/org/apache/activemq/artemis/jms/example/AerogearExample.java
new file mode 100644
index 0000000..b412d87
--- /dev/null
+++ b/examples/features/sub-modules/aerogear/src/main/java/org/apache/activemq/artemis/jms/example/AerogearExample.java
@@ -0,0 +1,77 @@
+/*
+ * 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.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+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 AerogearExample {
+
+   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
+         Message message = session.createMessage();
+
+         message.setStringProperty("AEROGEAR_ALERT", "Hello this is a notification from ActiveMQ");
+
+         producer.send(message);
+
+         System.out.println("Sent message");
+
+         System.out.println("now check your mobile app and press enter");
+
+         System.in.read();
+      }
+      finally {
+         // Step 12. Be sure to close our JMS resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}


[09/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/message-group/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroupExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-group/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroupExample.java b/examples/features/standard/message-group/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroupExample.java
new file mode 100644
index 0000000..c614860
--- /dev/null
+++ b/examples/features/standard/message-group/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroupExample.java
@@ -0,0 +1,122 @@
+/*
+ * 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.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 java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * A simple JMS Queue example that sends and receives message groups.
+ */
+public class MessageGroupExample {
+
+   public static void main(final String[] args) throws Exception {
+      final Map<String, String> messageReceiverMap = new ConcurrentHashMap<String, String>();
+      Connection connection = null;
+      try {
+
+         // Step 2. Perform a lookup on the queue
+         Queue queue = ActiveMQJMSClient.createQueue("queue/exampleQueue");
+
+         // Step 3. Perform a lookup on the Connection Factory
+         ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
+
+         // 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 two consumers
+         MessageConsumer consumer1 = session.createConsumer(queue);
+         consumer1.setMessageListener(new SimpleMessageListener("consumer-1", messageReceiverMap));
+         MessageConsumer consumer2 = session.createConsumer(queue);
+         consumer2.setMessageListener(new SimpleMessageListener("consumer-2", messageReceiverMap));
+
+         // Step 8. Create and send 10 text messages with group id 'Group-0'
+         int msgCount = 10;
+         TextMessage[] groupMessages = new TextMessage[msgCount];
+         for (int i = 0; i < msgCount; i++) {
+            groupMessages[i] = session.createTextMessage("Group-0 message " + i);
+            groupMessages[i].setStringProperty("JMSXGroupID", "Group-0");
+            producer.send(groupMessages[i]);
+            System.out.println("Sent message: " + groupMessages[i].getText());
+         }
+
+         System.out.println("all messages are sent");
+
+         // Step 9. Start the connection
+         connection.start();
+
+         Thread.sleep(2000);
+
+         // Step 10. check the group messages are received by only one consumer
+         String trueReceiver = messageReceiverMap.get(groupMessages[0].getText());
+         for (TextMessage grpMsg : groupMessages) {
+            String receiver = messageReceiverMap.get(grpMsg.getText());
+            if (!trueReceiver.equals(receiver)) {
+               throw new IllegalStateException("Group message [" + grpMsg.getText() + "[ went to wrong receiver: " + receiver);
+            }
+         }
+
+         cf.close();
+      }
+      finally {
+         // Step 11. Be sure to close our JMS resources!
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}
+
+class SimpleMessageListener implements MessageListener {
+
+   private final String name;
+   private final Map<String, String> messageReceiverMap;
+
+   public SimpleMessageListener(final String listenerName, Map<String, String> messageReceiverMap) {
+      name = listenerName;
+      this.messageReceiverMap = messageReceiverMap;
+   }
+
+   public void onMessage(final Message message) {
+      try {
+         TextMessage msg = (TextMessage) message;
+         System.out.format("Message: [%s] received by %s%n", msg.getText(), name);
+         messageReceiverMap.put(msg.getText(), name);
+      }
+      catch (JMSException e) {
+         e.printStackTrace();
+      }
+   }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/message-group/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-group/src/main/resources/jndi.properties b/examples/features/standard/message-group/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/message-group/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/6b17d966/examples/features/standard/message-group2/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-group2/pom.xml b/examples/features/standard/message-group2/pom.xml
new file mode 100644
index 0000000..1a0363d
--- /dev/null
+++ b/examples/features/standard/message-group2/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>message-group2</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Message Group Example 2</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>
+                     <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.MessageGroup2Example</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>message-group2</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/message-group2/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-group2/readme.html b/examples/features/standard/message-group2/readme.html
new file mode 100644
index 0000000..983a442
--- /dev/null
+++ b/examples/features/standard/message-group2/readme.html
@@ -0,0 +1,161 @@
+<!--
+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 Message Group 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>Message Group 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 configure and use message groups via a connection factory with ActiveMQ Artemis.</p>
+
+     <p>Message groups are sets of messages that has the following characteristics: </p>
+     <li>Messages in a message group share the same group id, i.e. they have same JMSXGroupID string property values.</li>
+     <li>Messages in a message group will be all delivered to no more than one of the queue's consumers. The consumer that receives the
+     first message of a group will receive all the messages that belongs to the group.</li>
+
+     <p>You can make any message belong to a message group by setting a 'group-id' on the connection factory. All producers created via this connection factory will set that group id on its messages.
+     In this example we set the group id 'Group-0'on a connection factory and send messages via 2 different producers and check that only 1 consumer receives them. </p>
+
+     <p>Alternatively, ActiveMQ's connection factories can be configured to <em>auto group</em> messages. By setting <code>autogroup</code> to </code>true</code> on the <code>ActiveMQConnectionFactory</code>
+        (or setting <code>&lt;autogroup&gt;true&lt;/autogroup&gt;</code> in <code>activemq-jms.xml</code>'s connection factory settings), a random unique id
+        will be picked to create a message group. <em>Every messages</em> sent by a producer created from this connection factory will automatically
+        be part of this message group.</p>
+
+     <h2>Example step-by-step</h2>
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
+        <pre class="prettyprint">
+           <code>InitialContext initialContext = getContext();</code>
+        </pre>
+
+        <li>We look-up the JMS queue object from JNDI</li>
+        <pre class="prettyprint">
+           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>We look-up the JMS connection factory object from JNDI</li>
+        <pre class="prettyprint">
+           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>We create a JMS connection</li>
+        <pre class="prettyprint">
+           <code>connection = cf.createConnection();</code>
+        </pre>
+
+        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
+        <pre class="prettyprint">
+           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
+        </pre>
+
+        <li>We create 2 JMS message producers on the session. This will be used to send the messages.</li>
+        <pre class="prettyprint">
+          <code>
+              MessageProducer producer1 = session.createProducer(queue);
+
+              MessageProducer producer2 = session.createProducer(queue);</code>
+       </pre>
+
+        <li>We create two consumers.</li>
+        <pre class="prettyprint">
+           <code>
+          MessageConsumer consumer1 = session.createConsumer(queue);
+          consumer1.setMessageListener(new SimpleMessageListener("consumer-1"));
+          MessageConsumer consumer2 = session.createConsumer(queue);
+          consumer2.setMessageListener(new SimpleMessageListener("consumer-2"));
+          </code>
+        </pre>
+
+        <li>We create and send 10 text messages using each producer</li>
+        <pre class="prettyprint">
+           <code>
+         int msgCount = 10;
+         for (int i = 0; i < msgCount; i++)
+         {
+            TextMessage m = session.createTextMessage("producer1 message " + i);
+            producer1.send(m);
+            System.out.println("Sent message: " + m.getText());
+            TextMessage m2 = session.createTextMessage("producer2 message " + i);
+            producer2.send(m2);
+            System.out.println("Sent message: " + m2.getText());
+         }
+           </code>
+        </pre>
+
+        <li>We start the connection.</li>
+          <pre class="prettyprint">
+           <code>connection.start();</code>
+        </pre>
+
+        <li>We check the group messages are received by only one consumer</li>
+        <pre class="prettyprint">
+           <code>
+            String trueReceiver = messageReceiverMap.get("producer1 message " + 0);
+            for (int i = 0; i < msgCount; i++)
+            {
+               String receiver = messageReceiverMap.get("producer1 message " + i);
+               if (!trueReceiver.equals(receiver))
+               {
+                  System.out.println("Group message [producer1 message " + i + "] went to wrong receiver: " + receiver);
+                  result = false;
+               }
+               receiver = messageReceiverMap.get("producer2 message " + i);
+               if (!trueReceiver.equals(receiver))
+               {
+                  System.out.println("Group message [producer2 message " + i + "] went to wrong receiver: " + receiver);
+                  result = false;
+               }
+            }
+
+           </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>
+
+     <h2>More information</h2>
+
+     <ul>
+         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#message-grouping2">Message Grouping chapter</a></li>
+     </ul>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/message-group2/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroup2Example.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-group2/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroup2Example.java b/examples/features/standard/message-group2/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroup2Example.java
new file mode 100644
index 0000000..a2164cf
--- /dev/null
+++ b/examples/features/standard/message-group2/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroup2Example.java
@@ -0,0 +1,129 @@
+/*
+ * 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.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 java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * A simple JMS Queue example that sends and receives message groups.
+ */
+public class MessageGroup2Example {
+
+   private boolean result = true;
+
+   public static void main(String[] args) throws Exception {
+      final Map<String, String> messageReceiverMap = new ConcurrentHashMap<String, String>();
+      Connection connection = null;
+      try {
+         //Step 2. Perform a lookup on the queue
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         //Step 3. Perform a lookup on the Connection Factory
+         ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?groupID=Group-0");
+
+         //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 2 JMS Message Producers
+         MessageProducer producer1 = session.createProducer(queue);
+
+         MessageProducer producer2 = session.createProducer(queue);
+
+         //Step 7. Create two consumers
+         MessageConsumer consumer1 = session.createConsumer(queue);
+         consumer1.setMessageListener(new SimpleMessageListener("consumer-1", messageReceiverMap));
+         MessageConsumer consumer2 = session.createConsumer(queue);
+         consumer2.setMessageListener(new SimpleMessageListener("consumer-2", messageReceiverMap));
+
+         //Step 8. Create and send 10 text messages with each producer
+         int msgCount = 10;
+         for (int i = 0; i < msgCount; i++) {
+            TextMessage m = session.createTextMessage("producer1 message " + i);
+            producer1.send(m);
+            System.out.println("Sent message: " + m.getText());
+            TextMessage m2 = session.createTextMessage("producer2 message " + i);
+            producer2.send(m2);
+            System.out.println("Sent message: " + m2.getText());
+         }
+
+         System.out.println("all messages are sent");
+
+         //Step 9. Start the connection
+         connection.start();
+
+         Thread.sleep(2000);
+
+         //Step 10. check the group messages are received by only one consumer
+
+         String trueReceiver = messageReceiverMap.get("producer1 message " + 0);
+         for (int i = 0; i < msgCount; i++) {
+            String receiver = messageReceiverMap.get("producer1 message " + i);
+            if (!trueReceiver.equals(receiver)) {
+               throw new IllegalStateException("Group message [producer1 message " + i + "] went to wrong receiver: " + receiver);
+            }
+            receiver = messageReceiverMap.get("producer2 message " + i);
+            if (!trueReceiver.equals(receiver)) {
+               throw new IllegalStateException("Group message [producer2 message " + i + "] went to wrong receiver: " + receiver);
+            }
+         }
+      }
+      finally {
+         //Step 11. Be sure to close our JMS resources!
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}
+
+class SimpleMessageListener implements MessageListener {
+
+   private final String name;
+   final Map<String, String> messageReceiverMap;
+
+   public SimpleMessageListener(String listenerName, Map<String, String> messageReceiverMap) {
+      name = listenerName;
+      this.messageReceiverMap = messageReceiverMap;
+   }
+
+   public void onMessage(Message message) {
+      try {
+         TextMessage msg = (TextMessage) message;
+         System.out.format("Message: [%s] received by %s%n", msg.getText(), name);
+         messageReceiverMap.put(msg.getText(), name);
+      }
+      catch (JMSException e) {
+         e.printStackTrace();
+      }
+   }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/message-priority/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-priority/pom.xml b/examples/features/standard/message-priority/pom.xml
new file mode 100644
index 0000000..b60aadc
--- /dev/null
+++ b/examples/features/standard/message-priority/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>message-priority</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS MessagePriorityExample 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>
+                     <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.MessagePriorityExample</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>message-priority</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/message-priority/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-priority/readme.html b/examples/features/standard/message-priority/readme.html
new file mode 100644
index 0000000..fc25297
--- /dev/null
+++ b/examples/features/standard/message-priority/readme.html
@@ -0,0 +1,159 @@
+<!--
+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 Message Priority 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 Message Priority 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 how messages with different priorities are delivered in different orders.</p>
+
+     <p>The Message Priority property carries the delivery preference of sent messages. It can be set by the message's
+     standard header field 'JMSPriority' as defined in JMS specification version 1.1. The value is of type
+     integer, ranging from 0 (the lowest) to 9 (the highest). When messages are being delivered, their priorities
+     will effect their order of delivery. Messages of higher priorities will likely be delivered before those
+     of lower priorities. Messages of equal priorities are delivered in the natural order of their arrival at
+     their destinations. Please consult the JMS 1.1 specification for full details.</p>
+
+     <p>In this example, three messages are sent to a queue with different priorities. The first message is sent
+     with default priority (4), the second is sent with a higher priority (5), and the third has the highest
+     priority (9). At the receiving end, we will show the order of receiving of the three messages. You will
+     see that the third message, though last sent, will 'jump' forward to be the first one received. The second
+     is also received ahead of the message first sent, but behind the third message. The first message, regardless
+     of its being sent first, arrives last.</p>
+
+     <h2>Example step-by-step</h2>
+     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
+
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
+        <pre class="prettyprint">
+           <code>InitialContext initialContext = getContext();</code>
+        </pre>
+
+        <li>We look-up the JMS queue object from JNDI</li>
+        <pre class="prettyprint">
+           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>We look-up the JMS connection factory object from JNDI</li>
+        <pre class="prettyprint">
+           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>We create a JMS connection</li>
+        <pre class="prettyprint">
+           <code>connection = cf.createConnection();</code>
+        </pre>
+
+        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
+        <pre class="prettyprint">
+           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
+        </pre>
+
+        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
+        <pre class="prettyprint">
+          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
+       </pre>
+
+        <li>We Create a JMS Message Consumer.</li>
+        <pre class="prettyprint">
+           <code>
+           MessageConsumer redConsumer = session.createConsumer(queue);
+           redConsumer.setMessageListener(new SimpleMessageListener());
+           </code>
+        </pre>
+
+        <li>We Create three messages.</li>
+        <pre class="prettyprint">
+           <code>
+           TextMessage[] sentMessages = new TextMessage[3];
+           sentMessages[0] = session.createTextMessage("first message");
+           sentMessages[1] = session.createTextMessage("second message");
+           sentMessages[2] = session.createTextMessage("third message");
+           </code>
+        </pre>
+
+        <li>Send the Messages, each has a different priority.</li>
+        <pre class="prettyprint">
+           <code>
+           producer.send(sentMessages[0]);
+           System.out.println("Message sent: " + sentMessages[0].getText() + " with priority: " + sentMessages[0].getJMSPriority());
+           producer.send(sentMessages[1], DeliveryMode.NON_PERSISTENT, 5, 0);
+           System.out.println("Message sent: " + sentMessages[1].getText() + "with priority: " + sentMessages[1].getJMSPriority());
+           producer.send(sentMessages[2], DeliveryMode.NON_PERSISTENT, 9, 0);
+           System.out.println("Message sent: " + sentMessages[2].getText() + "with priority: " + sentMessages[2].getJMSPriority());
+           </code>
+        </pre>
+
+        <li>We start the connection now.</li>
+        <pre class="prettyprint">
+           <code>
+           connection.start();
+           </code>
+        </pre>
+
+        <li>We wait for message delivery completion</li>
+        <pre class="prettyprint">
+           <code>
+           Thread.sleep(5000);
+           </code>
+        </pre>
+
+        <li>We wait for message delivery completion</li>
+        <pre class="prettyprint">
+           <code>
+           for (int i = 0; i < 3; i++)
+           {
+              TextMessage rm = msgReceived.get(i);
+              if (!rm.getText().equals(sentMessages[2-i].getText()))
+              {
+                 System.err.println("Priority is broken!");
+                 result = false;
+              }
+           }
+           </code>
+        </pre>
+
+        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
+
+        <pre class="prettyprint">
+           <code>finally
+           {
+              if (initialContext != null)
+              {
+                initialContext.close();
+              }
+              if (connection != null)
+              {
+                 connection.close();
+              }
+           }</code>
+        </pre>
+     </ol>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/message-priority/src/main/java/org/apache/activemq/artemis/jms/example/MessagePriorityExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-priority/src/main/java/org/apache/activemq/artemis/jms/example/MessagePriorityExample.java b/examples/features/standard/message-priority/src/main/java/org/apache/activemq/artemis/jms/example/MessagePriorityExample.java
new file mode 100644
index 0000000..2c87d26
--- /dev/null
+++ b/examples/features/standard/message-priority/src/main/java/org/apache/activemq/artemis/jms/example/MessagePriorityExample.java
@@ -0,0 +1,134 @@
+/*
+ * 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.ArrayList;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
+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 org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * A simple JMS example that shows the delivery order of messages with priorities.
+ */
+public class MessagePriorityExample {
+
+   public static void main(final String[] args) throws Exception {
+      AtomicBoolean result = new AtomicBoolean(true);
+      final ArrayList<TextMessage> msgReceived = new ArrayList<TextMessage>();
+      Connection connection = null;
+      try {
+
+         // Step 2. look-up the JMS queue object from JNDI
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // Step 3. look-up the JMS connection factory object from JNDI
+         ConnectionFactory cf = new ActiveMQConnectionFactory();
+
+         // 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 JMS Message Consumer
+         MessageConsumer redConsumer = session.createConsumer(queue);
+         redConsumer.setMessageListener(new SimpleMessageListener(msgReceived, result));
+
+         // Step 8. Create three messages
+         TextMessage[] sentMessages = new TextMessage[3];
+         sentMessages[0] = session.createTextMessage("first message");
+         sentMessages[1] = session.createTextMessage("second message");
+         sentMessages[2] = session.createTextMessage("third message");
+
+         // Step 9. Send the Messages, each has a different priority
+         producer.send(sentMessages[0]);
+         System.out.println("Message sent: " + sentMessages[0].getText() +
+                               " with priority: " +
+                               sentMessages[0].getJMSPriority());
+         producer.send(sentMessages[1], DeliveryMode.NON_PERSISTENT, 5, 0);
+         System.out.println("Message sent: " + sentMessages[1].getText() +
+                               "with priority: " +
+                               sentMessages[1].getJMSPriority());
+         producer.send(sentMessages[2], DeliveryMode.NON_PERSISTENT, 9, 0);
+         System.out.println("Message sent: " + sentMessages[2].getText() +
+                               "with priority: " +
+                               sentMessages[2].getJMSPriority());
+
+         // Step 10. Start the connection now.
+         connection.start();
+
+         // Step 11. Wait for message delivery completion
+         Thread.sleep(5000);
+
+         // Step 12. Examine the order
+         for (int i = 0; i < 3; i++) {
+            TextMessage rm = msgReceived.get(i);
+            if (!rm.getText().equals(sentMessages[2 - i].getText())) {
+               throw new IllegalStateException("Priority is broken!");
+            }
+         }
+
+         if (!result.get())
+            throw new IllegalStateException();
+      }
+      finally {
+         // Step 13. Be sure to close our JMS resources!
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}
+
+class SimpleMessageListener implements MessageListener {
+
+   ArrayList<TextMessage> msgReceived;
+   AtomicBoolean result;
+
+   public SimpleMessageListener(ArrayList<TextMessage> msgReceived, AtomicBoolean result) {
+      this.msgReceived = msgReceived;
+      this.result = result;
+   }
+
+   public void onMessage(final Message msg) {
+      TextMessage textMessage = (TextMessage) msg;
+      try {
+         System.out.println("Received message : [" + textMessage.getText() + "]");
+      }
+      catch (JMSException e) {
+         result.set(false);
+      }
+      msgReceived.add(textMessage);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/no-consumer-buffering/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/no-consumer-buffering/pom.xml b/examples/features/standard/no-consumer-buffering/pom.xml
new file mode 100644
index 0000000..838980c
--- /dev/null
+++ b/examples/features/standard/no-consumer-buffering/pom.xml
@@ -0,0 +1,108 @@
+<?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>no-consumer-buffering</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS No Consumer Buffering 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>
+                     <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.NoConsumerBufferingExample</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>no-consumer-buffering</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/no-consumer-buffering/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/no-consumer-buffering/readme.html b/examples/features/standard/no-consumer-buffering/readme.html
new file mode 100644
index 0000000..596562d
--- /dev/null
+++ b/examples/features/standard/no-consumer-buffering/readme.html
@@ -0,0 +1,205 @@
+<!--
+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 No Consumer Buffering 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>No Consumer Buffering 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>By default, ActiveMQ Artemis consumers buffer messages from the server in a client side buffer
+     before actual delivery actually occurs.</p>
+     <p>This improves performance since otherwise every time you called receive() or had processed the last
+     message in a MessageListener onMessage() method, the ActiveMQ Artemis client would have to go the
+     server to request the next message involving a network round trip for every message reducing performance.</p>
+     <p>Therefore, by default, ActiveMQ Artemis pre-fetches messages into a buffer on each consumer. The total maximum size of
+     messages in bytes that will be buffered on each consumer is determined by the <code>consumer-window-size</code>
+     parameter on the connection factory.</p>
+     <p>In some cases it is not desirable to buffer any messages on the client side consumer.</p>
+     <p>An example would be an order queue which had multiple consumers that processed orders from the queue.
+     Each order takes a significant time to process, but each one should be processed in a timely fashion.</p>
+     <p>If orders were buffered in each consumer, and a new consumer was added that consumer would not be able
+     to process orders which were already in the client side buffer of another consumer.</p>
+     <p>To turn off client side buffering of messages, set <code>consumer-window-size</code> to zero.</p>
+
+     <p>With ActiveMQ Artemis you can specify a maximum consume rate at which a JMS MessageConsumer will consume messages.
+     This can be specified when creating or deploying the connection factory. See <code>activemq-jms.xml</code></p>
+     <h2>Example step-by-step</h2>
+     <p>In this example we specify a <code>consumer-window-size</code> of <code>0</code> bytes in the <code>activemq-jms.xml</code>
+     file when deploying the connection factory:</p>
+     <pre class="prettyprint">
+     <code>
+   &lt;connection-factory name="ConnectionFactory"&gt;
+      &lt;connector-ref connector-name="netty-connector"/&gt;
+      &lt;entries&gt;
+         &lt;entry name="ConnectionFactory"/&gt;
+      &lt;/entries&gt;
+
+      &lt;!-- We set the consumer window size to 0, which means messages are not buffered at all
+      on the client side --&gt;
+      &lt;consumer-window-size&gt;0&lt;/consumer-window-size&gt;
+
+   &lt;/connection-factory&gt;
+     </code>
+     </pre>
+     <p>We create a consumer on a queue and send 10 messages to it. We then create another consumer on
+     the same queue.</p>
+     <p>We then consume messages from each consumer in a semi-random order. We note that the messages
+     are consumed in the order they were sent.</p>
+     <p>If the messages had been buffered in each consumer they would not be available to be consumed
+     in an order determined afer delivery.</p>
+
+     <ol>
+        <li>Create an initial context to perform the JNDI lookup.</li>
+        <pre class="prettyprint">
+           <code>initialContext = getContext(0);</code>
+        </pre>
+
+        <li>Perfom a lookup on the queue</li>
+        <pre class="prettyprint">
+           <code>Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>Perform a lookup on the Connection Factory</li>
+        <pre class="prettyprint">
+           <code>ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>Create a JMS Connection</li>
+        <pre class="prettyprint">
+           <code>connection = cf.createConnection();</code>
+        </pre>
+
+        <li>Create a JMS Session</li>
+        <pre class="prettyprint">
+           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
+        </pre>
+
+        <li>Create a JMS MessageProducer</li>
+        <pre class="prettyprint">
+          <code>MessageProducer producer = session.createProducer(queue);</code>
+        </pre>
+
+        <li>Create a JMS MessageConsumer</li>
+        <pre class="prettyprint">
+           <code>MessageConsumer consumer1 = session.createConsumer(queue);</code>
+        </pre>
+
+        <li>Start the connection</li>
+
+        <pre class="prettyprint">
+           <code>
+     connection.start();
+           </code>
+        </pre>
+
+
+        <li>Send 10 messages to the queue</li>
+        <pre class="prettyprint">
+           <code>
+     final int numMessages = 10;
+
+     for (int i = 0; i < numMessages; i++)
+     {
+        TextMessage message = session.createTextMessage("This is text message: " + i);
+
+        producer.send(message);
+     }
+           </code>
+        </pre>
+
+        <li>Create another JMS MessageConsumer on the same queue.</li>
+        <pre class="prettyprint">
+           <code>MessageConsumer consumer2 = session.createConsumer(queue);</code>
+        </pre>
+
+        <li>Consume three messages from consumer2</li>
+
+        <pre class="prettyprint">
+           <code>
+   for (int i = 0; i < 3; i++)
+   {
+      TextMessage message = (TextMessage)consumer2.receive(2000);
+
+      System.out.println("Consumed message from consumer2: " + message.getText());
+   }
+           </code>
+        </pre>
+
+        <li>Consume five messages from consumer1</li>
+
+        <pre class="prettyprint">
+           <code>
+   for (int i = 0; i < 5; i++)
+   {
+      TextMessage message = (TextMessage)consumer1.receive(2000);
+
+      System.out.println("Consumed message from consumer1: " + message.getText());
+   }
+           </code>
+        </pre>
+
+        <li>Consume two more messages from consumer2</li>
+
+        <pre class="prettyprint">
+           <code>
+   for (int i = 0; i < 2; i++)
+   {
+      TextMessage message = (TextMessage)consumer1.receive(2000);
+
+      System.out.println("Consumed message from consumer2: " + message.getText());
+   }
+           </code>
+        </pre>
+
+
+        <li>Be sure to close our resources!</li>
+
+        <pre class="prettyprint">
+           <code>
+           finally
+           {
+              if (initialContext != null)
+              {
+                initialContext.close();
+              }
+
+              if (connection != null)
+              {
+                 connection.close();
+              }
+           }</code>
+        </pre>
+     </ol>
+
+     <h2>More information</h2>
+
+     <ul>
+         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#flow-control.consumer.window">Consumer Window-Based Flow Control chapter</a></li>
+     </ul>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/no-consumer-buffering/src/main/java/org/apache/activemq/artemis/jms/example/NoConsumerBufferingExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/no-consumer-buffering/src/main/java/org/apache/activemq/artemis/jms/example/NoConsumerBufferingExample.java b/examples/features/standard/no-consumer-buffering/src/main/java/org/apache/activemq/artemis/jms/example/NoConsumerBufferingExample.java
new file mode 100644
index 0000000..6f321b0
--- /dev/null
+++ b/examples/features/standard/no-consumer-buffering/src/main/java/org/apache/activemq/artemis/jms/example/NoConsumerBufferingExample.java
@@ -0,0 +1,110 @@
+/*
+ * 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 org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * This example demonstrates how ActiveMQ Artemis consumers can be configured to not buffer any messages from
+ * the server.
+ */
+public class NoConsumerBufferingExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection = null;
+      try {
+         // Step 2. Perfom a lookup on the queue
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // Step 3. new Connection factory with consumerWindowsize=0
+         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?consumerWindowSize=0");
+
+         // 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 JMS MessageConsumer
+
+         MessageConsumer consumer1 = session.createConsumer(queue);
+
+         // Step 8. Start the connection
+
+         connection.start();
+
+         // Step 9. Send 10 messages to the queue
+
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session.createTextMessage("This is text message: " + i);
+
+            producer.send(message);
+         }
+
+         System.out.println("Sent messages");
+
+         // Step 10. Create another consumer on the same queue
+
+         MessageConsumer consumer2 = session.createConsumer(queue);
+
+         // Step 11. Consume three messages from consumer2
+
+         for (int i = 0; i < 3; i++) {
+            TextMessage message = (TextMessage) consumer2.receive(2000);
+
+            System.out.println("Consumed message from consumer2: " + message.getText());
+         }
+
+         // Step 12. Consume five messages from consumer1
+
+         for (int i = 0; i < 5; i++) {
+            TextMessage message = (TextMessage) consumer1.receive(2000);
+
+            System.out.println("Consumed message from consumer1: " + message.getText());
+         }
+
+         // Step 13. Consume another two messages from consumer2
+
+         for (int i = 0; i < 2; i++) {
+            TextMessage message = (TextMessage) consumer2.receive(2000);
+
+            System.out.println("Consumed message from consumer1: " + message.getText());
+         }
+      }
+      finally {
+         // Step 9. Be sure to close our resources!
+
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/no-consumer-buffering/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/no-consumer-buffering/src/main/resources/jndi.properties b/examples/features/standard/no-consumer-buffering/src/main/resources/jndi.properties
new file mode 100644
index 0000000..d9b77a6
--- /dev/null
+++ b/examples/features/standard/no-consumer-buffering/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?consumerWindowSize=0
+queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/paging/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/paging/pom.xml b/examples/features/standard/paging/pom.xml
new file mode 100644
index 0000000..d78efc9
--- /dev/null
+++ b/examples/features/standard/paging/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>paging</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Paging 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>
+                     <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.PagingExample</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>paging</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/paging/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/paging/readme.html b/examples/features/standard/paging/readme.html
new file mode 100644
index 0000000..7c74320
--- /dev/null
+++ b/examples/features/standard/paging/readme.html
@@ -0,0 +1,187 @@
+<!--
+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 Paging 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>Paging 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 how ActiveMQ Artemis would avoid running out of memory resources by paging messages.</p>
+     <p>A maxSize can be specified per Destination via the destinations settings configuration file (broker.xml).</p>
+     <p>When messages routed to an address exceed the specified maxSize the server will begin to write messages to the file
+     system, this is called paging. This will continue to occur until messages have been delivered to consumers and subsequently
+     acknowledged freeing up memory. Messages will then be read from the file system , i.e. depaged, and routed as normal. </p>
+     <p>Acknowledgement plays an important factor on paging as messages will stay on the file system until the memory is released
+     so it is important to make sure that the client acknowledges its messages.</p>
+
+
+     <h2>Example step-by-step</h2>
+
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
+        <pre class="prettyprint">
+           <code>InitialContext initialContext = getContext();</code>
+        </pre>
+
+        <li>We look-up the JMS connection factory object from JNDI</li>
+        <pre class="prettyprint">
+           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>We look-up the JMS queue object from JNDI. pagingQueue is configured to hold a very limited number of bytes in memory</li>
+        <pre class="prettyprint">
+           <code>Queue pageQueue = (Queue) initialContext.lookup("/queue/pagingQueue");</code>
+        </pre>
+
+        <li>We look-up the JMS queue object from JNDI.</li>
+        <pre class="prettyprint">
+           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>We create a JMS connection</li>
+        <pre class="prettyprint">
+           <code>connection = cf.createConnection();</code>
+        </pre>
+
+        <li>We create a JMS session. The session is created as non transacted. We will use client acknowledgement on this example.</li>
+        <pre class="prettyprint">
+           <code>Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);</code>
+        </pre>
+
+
+         <li>Create a JMS Message Producer for pageQueueAddress</li>
+         <pre class="prettyprint"><code>
+         MessageProducer pageMessageProducer = session.createProducer(pageQueue);
+         </pre></code>
+
+         <li>We don't need persistent messages in order to use paging. (This step is optional)</li>
+         <pre class="prettyprint"><code>
+         pageMessageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+         </pre></code>
+
+         <li>Create a Binary Bytes Message with 10K arbitrary bytes</li>
+         <pre class="prettyprint"><code>
+         BytesMessage message = session.createBytesMessage();
+         message.writeBytes(new byte[10 * 1024]);
+         </pre></code>
+
+
+         <li>Send only 20 messages to the Queue. This will be already enough for pagingQueue. Look at ./paging/config/activemq-queues.xml for the config.</li>
+         <pre class="prettyprint"><code>
+         for (int i = 0; i < 20; i++)
+         {
+            pageMessageProducer.send(message);
+         }
+         </pre></code>
+
+         <li>Create a JMS Message Producer</li>
+         <pre class="prettyprint"><code>
+         MessageProducer messageProducer = session.createProducer(queue);
+         </pre></code>
+
+         <li>We don't need persistent messages in order to use paging. (This step is optional)</li>
+         <pre class="prettyprint"><code>
+         messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+         </pre></code>
+
+         <li>Send the message for about 30K, which should be over the memory limit imposed by the server</li>
+         <pre class="prettyprint"><code>
+         for (int i = 0; i < 30000; i++)
+         {
+            messageProducer.send(message);
+         }
+         </pre></code>
+
+         <li>if you pause the example here, you will several files under ./build/data/paging</li>
+
+         <pre class="prettyprint"><code>
+         // Thread.sleep(30000); // if you want to just our of curiosity, you can sleep here and inspect the created files just for
+         </pre></code>
+
+
+         <li>Create a JMS Message Consumer</li>
+         <pre class="prettyprint"><code>
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+         </pre></code>
+
+
+         <li>Start the JMS Connection. This step will activate the subscribers to receive messages.</li>
+         <pre class="prettyprint"><code>
+         connection.start();
+         </pre></code>
+
+
+         <li>Receive the messages. It's important to ACK for messages as ActiveMQ Artemis will not read messages from paging until messages are ACKed</li>
+
+         <pre class="prettyprint"><code>
+         for (int i = 0; i < 30000; i++)
+         {
+            message = (BytesMessage)messageConsumer.receive(1000);
+
+            if (i % 1000 == 0)
+            {
+               System.out.println("Received " + i + " messages");
+
+               message.acknowledge();
+            }
+         }
+         </pre></code>
+
+         <li>Receive the messages from the Queue names pageQueue. Create the proper consumer for that.</li>
+         <pre class="prettyprint"><code>
+         messageConsumer.close();
+         messageConsumer = session.createConsumer(pageQueue);
+
+         for (int i = 0; i < 20; i++)
+         {
+            message = (BytesMessage)messageConsumer.receive(1000);
+
+            System.out.println("Received message " + i + " from pageQueue");
+
+            message.acknowledge();
+         }
+         </pre></code>
+
+        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
+
+        <pre class="prettyprint">
+           <code>finally
+           {
+              if (initialContext != null)
+              {
+                initialContext.close();
+              }
+              if (connection != null)
+              {
+                 connection.close();
+              }
+           }</code>
+        </pre>
+
+     </ol>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/paging/src/main/java/org/apache/activemq/artemis/jms/example/PagingExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/paging/src/main/java/org/apache/activemq/artemis/jms/example/PagingExample.java b/examples/features/standard/paging/src/main/java/org/apache/activemq/artemis/jms/example/PagingExample.java
new file mode 100644
index 0000000..19d8a17
--- /dev/null
+++ b/examples/features/standard/paging/src/main/java/org/apache/activemq/artemis/jms/example/PagingExample.java
@@ -0,0 +1,135 @@
+/*
+ * 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.BytesMessage;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+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 PagingExample {
+
+   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 Connection Factory
+         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 3. We look-up the JMS queue object from JNDI. pagingQueue is configured to hold a very limited number
+         // of bytes in memory
+         Queue pageQueue = (Queue) initialContext.lookup("queue/pagingQueue");
+
+         // Step 4. Lookup for a JMS Queue
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+
+         // Step 5. Create a JMS Connection
+         connection = cf.createConnection();
+
+         // Step 6. Create a JMS Session
+         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+         // Step 7. Create a JMS Message Producer for pageQueueAddress
+         MessageProducer pageMessageProducer = session.createProducer(pageQueue);
+
+         // Step 8. We don't need persistent messages in order to use paging. (This step is optional)
+         pageMessageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+         // Step 9. Create a Binary Bytes Message with 10K arbitrary bytes
+         BytesMessage message = session.createBytesMessage();
+         message.writeBytes(new byte[10 * 1024]);
+
+         // Step 10. Send only 20 messages to the Queue. This will be already enough for pagingQueue. Look at
+         // ./paging/config/activemq-queues.xml for the config.
+         for (int i = 0; i < 20; i++) {
+            pageMessageProducer.send(message);
+         }
+
+         // Step 11. Create a JMS Message Producer
+         MessageProducer messageProducer = session.createProducer(queue);
+
+         // Step 12. We don't need persistent messages in order to use paging. (This step is optional)
+         messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+         // Step 13. Send the message for about 1K, which should be over the memory limit imposed by the server
+         for (int i = 0; i < 1000; i++) {
+            messageProducer.send(message);
+         }
+
+         // Step 14. if you pause this example here, you will see several files under ./build/data/paging
+         // Thread.sleep(30000); // if you want to just our of curiosity, you can sleep here and inspect the created
+         // files just for
+
+         // Step 15. Create a JMS Message Consumer
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         // Step 16. Start the JMS Connection. This step will activate the subscribers to receive messages.
+         connection.start();
+
+         // Step 17. Receive the messages. It's important to ACK for messages as ActiveMQ Artemis will not read messages from
+         // paging
+         // until messages are ACKed
+
+         for (int i = 0; i < 1000; i++) {
+            message = (BytesMessage) messageConsumer.receive(3000);
+
+            if (i % 100 == 0) {
+               System.out.println("Received " + i + " messages");
+               message.acknowledge();
+            }
+         }
+
+         message.acknowledge();
+
+         // Step 18. Receive the messages from the Queue names pageQueue. Create the proper consumer for that
+         messageConsumer.close();
+         messageConsumer = session.createConsumer(pageQueue);
+
+         for (int i = 0; i < 20; i++) {
+            message = (BytesMessage) messageConsumer.receive(1000);
+
+            System.out.println("Received message " + i + " from pageQueue");
+
+            message.acknowledge();
+         }
+      }
+      finally {
+         // And finally, always remember to close your JMS connections after use, in a finally block. Closing a JMS
+         // connection will automatically close all of its sessions, consumers, producer and browser objects
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/paging/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/paging/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/paging/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/paging/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/paging/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/paging/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/paging/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/paging/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/6b17d966/examples/features/standard/paging/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/paging/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/paging/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..a7a1969
--- /dev/null
+++ b/examples/features/standard/paging/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,93 @@
+<?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 topic used by the example-->
+      <queue name="exampleQueue"/>
+
+      <queue name="pagingQueue"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</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.pagingQueue">
+            <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-settings>
+
+      <address-settings>
+         <address-setting match="jms.queue.pagingQueue">
+            <max-size-bytes>100000</max-size-bytes>
+            <page-size-bytes>20000</page-size-bytes>
+         </address-setting>
+
+         <address-setting match="jms.queue.exampleQueue">
+            <max-size-bytes>10485760</max-size-bytes>
+            <page-size-bytes>1048576</page-size-bytes>
+         </address-setting>
+         <address-setting match="#">
+            <max-size-bytes>10485760</max-size-bytes>
+            <page-size-bytes>1048576</page-size-bytes>
+         </address-setting>
+      </address-settings>
+
+   </core>
+</configuration>


[16/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/soak/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/perf/soak/pom.xml b/examples/features/perf/soak/pom.xml
new file mode 100644
index 0000000..eb07b0b
--- /dev/null
+++ b/examples/features/perf/soak/pom.xml
@@ -0,0 +1,162 @@
+<?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>
+   <artifactId>artemis-jms-soak-example</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis Soak Normal Example</name>
+
+   <parent>
+      <groupId>org.apache.activemq.examples.soak</groupId>
+      <artifactId>perf-root</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+   </dependencies>
+
+   <properties>
+      <server.dir>${basedir}/server0/</server.dir>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <profiles>
+      <profile>
+         <id>server</id>
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.apache.activemq</groupId>
+                  <artifactId>artemis-maven-plugin</artifactId>
+                  <executions>
+                     <execution>
+                        <id>create</id>
+                        <goals>
+                           <goal>create</goal>
+                        </goals>
+                        <configuration>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/server0</configuration>
+                        </configuration>
+                     </execution>
+                  </executions>
+                  <dependencies>
+                     <dependency>
+                        <groupId>org.apache.activemq.examples.soak</groupId>
+                        <artifactId>artemis-jms-soak-example</artifactId>
+                        <version>${project.version}</version>
+                     </dependency>
+                  </dependencies>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
+      <profile>
+         <id>local</id>
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.apache.activemq</groupId>
+                  <artifactId>artemis-maven-plugin</artifactId>
+                  <executions>
+                     <execution>
+                        <id>runConsumer</id>
+                        <goals>
+                           <goal>runClient</goal>
+                        </goals>
+                        <configuration>
+                           <clientClass>org.apache.activemq.artemis.jms.soak.example.SoakReceiver</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>runProducer</id>
+                        <goals>
+                           <goal>runClient</goal>
+                        </goals>
+                        <configuration>
+                           <clientClass>org.apache.activemq.artemis.jms.soak.example.SoakSender</clientClass>
+                        </configuration>
+                     </execution>
+                  </executions>
+                  <dependencies>
+                     <dependency>
+                        <groupId>org.apache.activemq.examples.soak</groupId>
+                        <artifactId>artemis-jms-soak-example</artifactId>
+                        <version>${project.version}</version>
+                     </dependency>
+                  </dependencies>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
+      <profile>
+         <id>remote</id>
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.apache.activemq</groupId>
+                  <artifactId>artemis-maven-plugin</artifactId>
+                  <executions>
+                     <execution>
+                        <id>runConsumer</id>
+                        <goals>
+                           <goal>runClient</goal>
+                        </goals>
+                        <configuration>
+                           <clientClass>org.apache.activemq.artemis.jms.soak.example.SoakReceiver</clientClass>
+                           <args>
+                              <param>tcp://localhost:61616</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>runProducer</id>
+                        <goals>
+                           <goal>runClient</goal>
+                        </goals>
+                        <configuration>
+                           <clientClass>org.apache.activemq.artemis.jms.soak.example.SoakSender</clientClass>
+                           <args>
+                              <param>tcp://localhost:61616</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                  </executions>
+                  <dependencies>
+                     <dependency>
+                        <groupId>org.apache.activemq.examples.soak</groupId>
+                        <artifactId>artemis-jms-soak-example</artifactId>
+                        <version>${project.version}</version>
+                     </dependency>
+                  </dependencies>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
+
+   </profiles>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/soak/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/perf/soak/server0/broker.xml b/examples/features/perf/soak/server0/broker.xml
new file mode 100644
index 0000000..76df21f
--- /dev/null
+++ b/examples/features/perf/soak/server0/broker.xml
@@ -0,0 +1,49 @@
+<?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">
+      <queue name="soakQueue"/>
+   </jms>
+   <core xmlns="urn:activemq:core">
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
+      </acceptors>
+
+      <security-enabled>false</security-enabled>
+
+      <persistence-enabled>false</persistence-enabled>
+
+      <server-dump-interval>30000</server-dump-interval>
+
+      <queues>
+         <queue name="soakQueue">
+            <address>soakAddress</address>
+         </queue>
+      </queues>
+   </core>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/soak/soak.properties
----------------------------------------------------------------------
diff --git a/examples/features/perf/soak/soak.properties b/examples/features/perf/soak/soak.properties
new file mode 100644
index 0000000..2ccff7d
--- /dev/null
+++ b/examples/features/perf/soak/soak.properties
@@ -0,0 +1,30 @@
+# 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.
+
+duration-in-minutes=2
+num-warmup-messages=100
+message-size=1024
+durable=true
+transacted=false
+batch-size=1000
+drain-queue=false
+destination-lookup=soakQueue
+connection-factory-lookup=/ConnectionFactory
+throttle-rate=-1
+dups-ok-acknowledge=false
+disable-message-id=true
+disable-message-timestamp=true

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakBase.java
----------------------------------------------------------------------
diff --git a/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakBase.java b/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakBase.java
new file mode 100644
index 0000000..ce5b9bc
--- /dev/null
+++ b/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakBase.java
@@ -0,0 +1,116 @@
+/*
+ * 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.soak.example;
+
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.Properties;
+import java.util.Random;
+import java.util.logging.Logger;
+
+public class SoakBase {
+
+   private static final Logger log = Logger.getLogger(SoakBase.class.getName());
+
+   private static final String DEFAULT_SOAK_PROPERTIES_FILE_NAME = "soak.properties";
+
+   public static final int TO_MILLIS = 60 * 1000; // from minute to milliseconds
+
+   public static byte[] randomByteArray(final int length) {
+      byte[] bytes = new byte[length];
+
+      Random random = new Random();
+
+      for (int i = 0; i < length; i++) {
+         bytes[i] = Integer.valueOf(random.nextInt()).byteValue();
+      }
+
+      return bytes;
+   }
+
+   protected static String getPerfFileName() {
+      String fileName = System.getProperty("soak.props");
+      if (fileName == null) {
+         fileName = SoakBase.DEFAULT_SOAK_PROPERTIES_FILE_NAME;
+      }
+      return fileName;
+   }
+
+   protected static SoakParams getParams(final String fileName) throws Exception {
+      Properties props = null;
+
+      InputStream is = null;
+
+      try {
+         is = new FileInputStream(fileName);
+
+         props = new Properties();
+
+         props.load(is);
+      }
+      finally {
+         if (is != null) {
+            is.close();
+         }
+      }
+
+      int durationInMinutes = Integer.valueOf(props.getProperty("duration-in-minutes"));
+      int noOfWarmupMessages = Integer.valueOf(props.getProperty("num-warmup-messages"));
+      int messageSize = Integer.valueOf(props.getProperty("message-size"));
+      boolean durable = Boolean.valueOf(props.getProperty("durable"));
+      boolean transacted = Boolean.valueOf(props.getProperty("transacted"));
+      int batchSize = Integer.valueOf(props.getProperty("batch-size"));
+      boolean drainQueue = Boolean.valueOf(props.getProperty("drain-queue"));
+      String destinationLookup = props.getProperty("destination-lookup");
+      String connectionFactoryLookup = props.getProperty("connection-factory-lookup");
+      int throttleRate = Integer.valueOf(props.getProperty("throttle-rate"));
+      boolean dupsOK = Boolean.valueOf(props.getProperty("dups-ok-acknowlege"));
+      boolean disableMessageID = Boolean.valueOf(props.getProperty("disable-message-id"));
+      boolean disableTimestamp = Boolean.valueOf(props.getProperty("disable-message-timestamp"));
+
+      SoakBase.log.info("duration-in-minutes: " + durationInMinutes);
+      SoakBase.log.info("num-warmup-messages: " + noOfWarmupMessages);
+      SoakBase.log.info("message-size: " + messageSize);
+      SoakBase.log.info("durable: " + durable);
+      SoakBase.log.info("transacted: " + transacted);
+      SoakBase.log.info("batch-size: " + batchSize);
+      SoakBase.log.info("drain-queue: " + drainQueue);
+      SoakBase.log.info("throttle-rate: " + throttleRate);
+      SoakBase.log.info("connection-factory-lookup: " + connectionFactoryLookup);
+      SoakBase.log.info("destination-lookup: " + destinationLookup);
+      SoakBase.log.info("disable-message-id: " + disableMessageID);
+      SoakBase.log.info("disable-message-timestamp: " + disableTimestamp);
+      SoakBase.log.info("dups-ok-acknowledge: " + dupsOK);
+
+      SoakParams soakParams = new SoakParams();
+      soakParams.setDurationInMinutes(durationInMinutes);
+      soakParams.setNoOfWarmupMessages(noOfWarmupMessages);
+      soakParams.setMessageSize(messageSize);
+      soakParams.setDurable(durable);
+      soakParams.setSessionTransacted(transacted);
+      soakParams.setBatchSize(batchSize);
+      soakParams.setDrainQueue(drainQueue);
+      soakParams.setConnectionFactoryLookup(connectionFactoryLookup);
+      soakParams.setDestinationLookup(destinationLookup);
+      soakParams.setThrottleRate(throttleRate);
+      soakParams.setDisableMessageID(disableMessageID);
+      soakParams.setDisableTimestamp(disableTimestamp);
+      soakParams.setDupsOK(dupsOK);
+
+      return soakParams;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakParams.java
----------------------------------------------------------------------
diff --git a/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakParams.java b/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakParams.java
new file mode 100644
index 0000000..dda2ac1
--- /dev/null
+++ b/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakParams.java
@@ -0,0 +1,158 @@
+/*
+ * 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.soak.example;
+
+import java.io.Serializable;
+
+/**
+ * Class that holds the parameters used in the performance examples
+ */
+public class SoakParams implements Serializable {
+
+   private static final long serialVersionUID = -4336539641012356002L;
+
+   private int durationInMinutes = 60;
+
+   private int noOfWarmupMessages;
+
+   private int messageSize = 1024; // in bytes
+
+   private boolean durable = false;
+
+   private boolean isSessionTransacted = false;
+
+   private int batchSize = 5000;
+
+   private boolean drainQueue = true;
+
+   private String connectionFactoryLookup;
+
+   private String destinationLookup;
+
+   private int throttleRate;
+
+   private boolean disableMessageID;
+
+   private boolean disableTimestamp;
+
+   private boolean dupsOK;
+
+   public synchronized int getDurationInMinutes() {
+      return durationInMinutes;
+   }
+
+   public synchronized void setDurationInMinutes(final int durationInMinutes) {
+      this.durationInMinutes = durationInMinutes;
+   }
+
+   public synchronized int getNoOfWarmupMessages() {
+      return noOfWarmupMessages;
+   }
+
+   public synchronized void setNoOfWarmupMessages(final int noOfWarmupMessages) {
+      this.noOfWarmupMessages = noOfWarmupMessages;
+   }
+
+   public synchronized int getMessageSize() {
+      return messageSize;
+   }
+
+   public synchronized void setMessageSize(final int messageSize) {
+      this.messageSize = messageSize;
+   }
+
+   public synchronized boolean isDurable() {
+      return durable;
+   }
+
+   public synchronized void setDurable(final boolean durable) {
+      this.durable = durable;
+   }
+
+   public synchronized boolean isSessionTransacted() {
+      return isSessionTransacted;
+   }
+
+   public synchronized void setSessionTransacted(final boolean isSessionTransacted) {
+      this.isSessionTransacted = isSessionTransacted;
+   }
+
+   public synchronized int getBatchSize() {
+      return batchSize;
+   }
+
+   public synchronized void setBatchSize(final int batchSize) {
+      this.batchSize = batchSize;
+   }
+
+   public synchronized boolean isDrainQueue() {
+      return drainQueue;
+   }
+
+   public synchronized void setDrainQueue(final boolean drainQueue) {
+      this.drainQueue = drainQueue;
+   }
+
+   public synchronized String getConnectionFactoryLookup() {
+      return connectionFactoryLookup;
+   }
+
+   public synchronized void setConnectionFactoryLookup(final String connectionFactoryLookup) {
+      this.connectionFactoryLookup = connectionFactoryLookup;
+   }
+
+   public synchronized String getDestinationLookup() {
+      return destinationLookup;
+   }
+
+   public synchronized void setDestinationLookup(final String destinationLookup) {
+      this.destinationLookup = destinationLookup;
+   }
+
+   public synchronized int getThrottleRate() {
+      return throttleRate;
+   }
+
+   public synchronized void setThrottleRate(final int throttleRate) {
+      this.throttleRate = throttleRate;
+   }
+
+   public synchronized boolean isDisableMessageID() {
+      return disableMessageID;
+   }
+
+   public synchronized void setDisableMessageID(final boolean disableMessageID) {
+      this.disableMessageID = disableMessageID;
+   }
+
+   public synchronized boolean isDisableTimestamp() {
+      return disableTimestamp;
+   }
+
+   public synchronized void setDisableTimestamp(final boolean disableTimestamp) {
+      this.disableTimestamp = disableTimestamp;
+   }
+
+   public synchronized boolean isDupsOK() {
+      return dupsOK;
+   }
+
+   public synchronized void setDupsOK(final boolean dupsOK) {
+      this.dupsOK = dupsOK;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakReceiver.java
----------------------------------------------------------------------
diff --git a/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakReceiver.java b/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakReceiver.java
new file mode 100644
index 0000000..ce39968
--- /dev/null
+++ b/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakReceiver.java
@@ -0,0 +1,190 @@
+/*
+ * 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.soak.example;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.Session;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.logging.Logger;
+
+public class SoakReceiver {
+
+   private static final Logger log = Logger.getLogger(SoakReceiver.class.getName());
+
+   private static final String EOF = UUID.randomUUID().toString();
+
+   public static void main(final String[] args) {
+      Runnable runnable = new Runnable() {
+         @Override
+         public void run() {
+
+            try {
+               String fileName = SoakBase.getPerfFileName();
+
+               SoakParams params = SoakBase.getParams(fileName);
+
+               final SoakReceiver receiver = new SoakReceiver(params);
+
+               Runtime.getRuntime().addShutdownHook(new Thread() {
+                  @Override
+                  public void run() {
+                     receiver.disconnect();
+                  }
+               });
+
+               receiver.run();
+            }
+            catch (Exception e) {
+               e.printStackTrace();
+            }
+         }
+      };
+
+      Thread t = new Thread(runnable);
+      t.start();
+   }
+
+   private final SoakParams perfParams;
+
+   private final ExceptionListener exceptionListener = new ExceptionListener() {
+      public void onException(final JMSException e) {
+         disconnect();
+         connect();
+      }
+   };
+
+   private final MessageListener listener = new MessageListener() {
+      int modulo = 10000;
+
+      private final AtomicLong count = new AtomicLong(0);
+
+      private final long start = System.currentTimeMillis();
+
+      long moduloStart = start;
+
+      public void onMessage(final Message msg) {
+         long totalDuration = System.currentTimeMillis() - start;
+
+         try {
+            if (SoakReceiver.EOF.equals(msg.getStringProperty("eof"))) {
+               SoakReceiver.log.info(String.format("Received %s messages in %.2f minutes", count, 1.0 * totalDuration / SoakBase.TO_MILLIS));
+               SoakReceiver.log.info("END OF RUN");
+
+               return;
+            }
+         }
+         catch (JMSException e1) {
+            e1.printStackTrace();
+         }
+         if (count.incrementAndGet() % modulo == 0) {
+            double duration = (1.0 * System.currentTimeMillis() - moduloStart) / 1000;
+            moduloStart = System.currentTimeMillis();
+            SoakReceiver.log.info(String.format("received %s messages in %2.2fs (total: %.0fs)", modulo, duration, totalDuration / 1000.0));
+         }
+      }
+   };
+
+   private Session session;
+
+   private Connection connection;
+
+   private SoakReceiver(final SoakParams perfParams) {
+      this.perfParams = perfParams;
+   }
+
+   public void run() throws Exception {
+      connect();
+
+      boolean runInfinitely = perfParams.getDurationInMinutes() == -1;
+
+      if (!runInfinitely) {
+         Thread.sleep(perfParams.getDurationInMinutes() * SoakBase.TO_MILLIS);
+
+         // send EOF message
+         Message eof = session.createMessage();
+         eof.setStringProperty("eof", SoakReceiver.EOF);
+         listener.onMessage(eof);
+
+         if (connection != null) {
+            connection.close();
+            connection = null;
+         }
+      }
+      else {
+         while (true) {
+            Thread.sleep(500);
+         }
+      }
+   }
+
+   private void disconnect() {
+      if (connection != null) {
+         try {
+            connection.setExceptionListener(null);
+            connection.close();
+         }
+         catch (JMSException e) {
+            e.printStackTrace();
+         }
+         finally {
+            connection = null;
+         }
+      }
+   }
+
+   private void connect() {
+      InitialContext ic = null;
+      try {
+         ic = new InitialContext();
+
+         ConnectionFactory factory = (ConnectionFactory) ic.lookup(perfParams.getConnectionFactoryLookup());
+
+         Destination destination = (Destination) ic.lookup(perfParams.getDestinationLookup());
+
+         connection = factory.createConnection();
+         connection.setExceptionListener(exceptionListener);
+
+         session = connection.createSession(perfParams.isSessionTransacted(), perfParams.isDupsOK() ? Session.DUPS_OK_ACKNOWLEDGE : Session.AUTO_ACKNOWLEDGE);
+
+         MessageConsumer messageConsumer = session.createConsumer(destination);
+         messageConsumer.setMessageListener(listener);
+
+         connection.start();
+      }
+      catch (Exception e) {
+         e.printStackTrace();
+      }
+      finally {
+         try {
+            ic.close();
+         }
+         catch (NamingException e) {
+            e.printStackTrace();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakSender.java
----------------------------------------------------------------------
diff --git a/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakSender.java b/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakSender.java
new file mode 100644
index 0000000..10fbbd8
--- /dev/null
+++ b/examples/features/perf/soak/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakSender.java
@@ -0,0 +1,195 @@
+/*
+ * 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.soak.example;
+
+import javax.jms.BytesMessage;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
+import javax.jms.Destination;
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.logging.Logger;
+
+import org.apache.activemq.artemis.utils.TokenBucketLimiter;
+import org.apache.activemq.artemis.utils.TokenBucketLimiterImpl;
+
+public class SoakSender {
+
+   private static final Logger log = Logger.getLogger(SoakSender.class.getName());
+
+   public static void main(final String[] args) {
+      try {
+         String fileName = SoakBase.getPerfFileName();
+
+         SoakParams params = SoakBase.getParams(fileName);
+         final SoakSender sender = new SoakSender(params);
+
+         Runtime.getRuntime().addShutdownHook(new Thread() {
+            @Override
+            public void run() {
+               sender.disconnect();
+            }
+         });
+
+         sender.run();
+      }
+      catch (Exception e) {
+         e.printStackTrace();
+      }
+   }
+
+   private final SoakParams perfParams;
+
+   private Connection connection;
+
+   private Session session;
+
+   private MessageProducer producer;
+
+   private final ExceptionListener exceptionListener = new ExceptionListener() {
+      public void onException(final JMSException e) {
+         System.out.println("SoakReconnectableSender.exceptionListener.new ExceptionListener() {...}.onException()");
+         disconnect();
+         connect();
+      }
+
+   };
+
+   private SoakSender(final SoakParams perfParams) {
+      this.perfParams = perfParams;
+   }
+
+   public void run() throws Exception {
+      connect();
+
+      boolean runInfinitely = perfParams.getDurationInMinutes() == -1;
+
+      BytesMessage message = session.createBytesMessage();
+
+      byte[] payload = SoakBase.randomByteArray(perfParams.getMessageSize());
+
+      message.writeBytes(payload);
+
+      final int modulo = 10000;
+
+      TokenBucketLimiter tbl = perfParams.getThrottleRate() != -1 ? new TokenBucketLimiterImpl(perfParams.getThrottleRate(), false) : null;
+
+      boolean transacted = perfParams.isSessionTransacted();
+      int txBatchSize = perfParams.getBatchSize();
+      boolean display = true;
+
+      long start = System.currentTimeMillis();
+      long moduleStart = start;
+      AtomicLong count = new AtomicLong(0);
+      while (true) {
+         try {
+            producer.send(message);
+            count.incrementAndGet();
+
+            if (transacted) {
+               if (count.longValue() % txBatchSize == 0) {
+                  session.commit();
+               }
+            }
+
+            long totalDuration = System.currentTimeMillis() - start;
+
+            if (display && count.longValue() % modulo == 0) {
+               double duration = (1.0 * System.currentTimeMillis() - moduleStart) / 1000;
+               moduleStart = System.currentTimeMillis();
+               SoakSender.log.info(String.format("sent %s messages in %2.2fs (time: %.0fs)", modulo, duration, totalDuration / 1000.0));
+            }
+
+            if (tbl != null) {
+               tbl.limit();
+            }
+
+            if (!runInfinitely && totalDuration > perfParams.getDurationInMinutes() * SoakBase.TO_MILLIS) {
+               break;
+            }
+         }
+         catch (Exception e) {
+            e.printStackTrace();
+         }
+      }
+
+      SoakSender.log.info(String.format("Sent %s messages in %s minutes", count, perfParams.getDurationInMinutes()));
+      SoakSender.log.info("END OF RUN");
+
+      if (connection != null) {
+         connection.close();
+         connection = null;
+      }
+   }
+
+   private synchronized void disconnect() {
+      if (connection != null) {
+         try {
+            connection.setExceptionListener(null);
+            connection.close();
+         }
+         catch (JMSException e) {
+            e.printStackTrace();
+         }
+         finally {
+            connection = null;
+         }
+      }
+   }
+
+   private void connect() {
+      InitialContext ic = null;
+      try {
+         ic = new InitialContext();
+
+         ConnectionFactory factory = (ConnectionFactory) ic.lookup(perfParams.getConnectionFactoryLookup());
+
+         Destination destination = (Destination) ic.lookup(perfParams.getDestinationLookup());
+
+         connection = factory.createConnection();
+
+         session = connection.createSession(perfParams.isSessionTransacted(), perfParams.isDupsOK() ? Session.DUPS_OK_ACKNOWLEDGE : Session.AUTO_ACKNOWLEDGE);
+
+         producer = session.createProducer(destination);
+
+         producer.setDeliveryMode(perfParams.isDurable() ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
+
+         producer.setDisableMessageID(perfParams.isDisableMessageID());
+
+         producer.setDisableMessageTimestamp(perfParams.isDisableTimestamp());
+
+         connection.setExceptionListener(exceptionListener);
+      }
+      catch (Exception e) {
+         e.printStackTrace();
+      }
+      finally {
+         try {
+            ic.close();
+         }
+         catch (NamingException e) {
+            e.printStackTrace();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/soak/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/perf/soak/src/main/resources/jndi.properties b/examples/features/perf/soak/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/perf/soak/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/6b17d966/examples/features/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/pom.xml b/examples/features/pom.xml
new file mode 100644
index 0000000..f5afbee
--- /dev/null
+++ b/examples/features/pom.xml
@@ -0,0 +1,68 @@
+<?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</groupId>
+      <artifactId>artemis-examples</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <groupId>org.apache.activemq.examples.clustered</groupId>
+   <artifactId>broker-features</artifactId>
+   <packaging>pom</packaging>
+   <name>ActiveMQ Artemis Clustered Examples</name>
+
+   <!-- Properties -->
+   <properties>
+      <!--
+      Explicitly declaring the source encoding eliminates the following
+      message: [WARNING] Using platform encoding (UTF-8 actually) to copy
+      filtered resources, i.e. build is platform dependent!
+      -->
+      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+      <activemq.basedir>${project.basedir}/../..</activemq.basedir>
+   </properties>
+
+   <profiles>
+      <profile>
+         <id>examples</id>
+         <modules>
+            <module>clustered</module>
+            <module>ha</module>
+            <module>standard</module>
+            <module>sub-modules</module>
+            <module>perf</module>
+         </modules>
+      </profile>
+      <profile>
+         <id>release</id>
+         <modules>
+            <module>clustered</module>
+            <module>ha</module>
+            <module>standard</module>
+            <module>sub-modules</module>
+            <module>perf</module>
+         </modules>
+      </profile>
+   </profiles>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/README.md
----------------------------------------------------------------------
diff --git a/examples/features/standard/README.md b/examples/features/standard/README.md
new file mode 100644
index 0000000..e9d9e36
--- /dev/null
+++ b/examples/features/standard/README.md
@@ -0,0 +1,32 @@
+Running the ActiveMQ Artemis Examples
+============================
+
+To run an individual example firstly cd into the example directory and run
+
+```sh
+mvn verify
+```
+
+Most examples offer a way to start them without creating and starting the server (say if you want to do it manually)
+
+```sh
+mvn verify -PnoServer
+```
+
+If you are running against an un released version, i.e. from master branch, you will have to run `mvn install` on the root
+pom.xml and the example/activemq-jms-examples-common/pom.xml first.
+
+If you want to run all the examples (except those that need to be run standalone) you can run `mvn verify -Pexamples` in the examples
+directory but before you do you will need to up the memory used by running:
+
+```
+export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m"
+```
+### Recreating the examples
+
+If you are trying to copy the examples somewhere else and modifying them. Consider asking Maven to explicitly list all the dependencies:
+
+```
+# if trying to modify the 'topic' example:
+cd examples/jms/topic && mvn dependency:list
+```

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/bridge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/bridge/pom.xml b/examples/features/standard/bridge/pom.xml
new file mode 100644
index 0000000..db1caf8
--- /dev/null
+++ b/examples/features/standard/bridge/pom.xml
@@ -0,0 +1,167 @@
+<?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>core-bridge</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis Core Bridge Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.geronimo.specs</groupId>
+         <artifactId>geronimo-jms_2.0_spec</artifactId>
+      </dependency>
+   </dependencies>
+
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <libList>
+                        <!-- For the transformer -->
+                        <arg>org.apache.activemq.examples.broker:core-bridge:${project.version}</arg>
+                     </libList>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <libList>
+                        <!-- For the transformer -->
+                        <arg>org.apache.activemq.examples.broker:core-bridge:${project.version}</arg>
+                     </libList>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                     <portOffset>1</portOffset>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.BridgeExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.broker</groupId>
+                  <artifactId>core-bridge</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/bridge/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/bridge/readme.html b/examples/features/standard/bridge/readme.html
new file mode 100644
index 0000000..698c6c2
--- /dev/null
+++ b/examples/features/standard/bridge/readme.html
@@ -0,0 +1,74 @@
+<!--
+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 Core Bridge 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>Core Bridge 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 a core bridge deployed on one server, which consumes messages from a
+     local queue and forwards them to an address on a second server.</p>
+
+     <p>Core bridges are used to create message flows between any two ActiveMQ Artemis servers which are remotely separated.
+     Core bridges are resilient and will cope with temporary connection failure allowing them to be an ideal
+     choice for forwarding over unreliable connections, e.g. a WAN.</p>
+     <p>They can also be configured with an optional filter expression, and will only forward messages that
+     match that filter.</p>
+     <p>Furthermore they can be configured to use an optional Transformer class. A user-defined Transformer class
+     can be specified which is called at forwarding time. This gives the user the opportunity to transform
+     the message in some ways, e.g. changing its properties or body</p>
+     <p>ActiveMQ Artemis also includes a <b>JMS Bridge</b>. This is similar to a core bridge, but uses the JMS API
+     and can be used to bridge between any two JMS 1.1 compliant messaging systems. The core bridge is limited to bridging
+     between ActiveMQ Artemis instances, but may provide better performance than the JMS bridge. The JMS bridge is covered in
+     a separate example.</p>
+     <p>For more information on bridges, please see the ActiveMQ Artemis user manual.</p>
+
+     <p>In this example we will demonstrate a simple sausage factory for aardvarks.</p>
+     <p>We have a JMS queue on server 0 named <code>sausage-factory</code>, and we have a
+     JMS queue on server 1 named <code>mincing-machine</code></p>
+     <p>We want to forward any messages that are sent to the <code>sausage-factory</code> queue on server 0, to the <code>mincing-machine</code>
+     on server 1.</p>
+     <p>We only want to make aardvark sausages, so we only forward messages where the property "name" is set
+     to "aardvark". It is known that other things, such are Sasquatches are also sent to the <code>sausage-factory</code> and we
+     want to reject those.</p>
+     <p>Moreover it is known that Aardvarks normally wear blue hats, and it's important that we only make sausages using
+     Aardvarks with green hats, so on the way we are going transform the property "hat" from "green" to "blue".</p>
+     <p>Here's a snippet from <code>broker.xml</code> showing the bridge configuration</p>
+     <pre class="prettyprint">
+     <code>
+     &lt;bridge name="my-bridge"&gt;
+          &lt;queue-name&gt;jms.queue.sausage-factory&lt;/queue-name&gt;
+          &lt;forwarding-address&gt;jms.queue.mincing-machine&lt;/forwarding-address&gt;
+          &lt;filter string="name='aardvark'"/&gt;
+          &lt;transformer-class-name&gt;org.apache.activemq.artemis.jms.example.HatColourChangeTransformer&lt;/transformer-class-name&gt;
+          &lt;reconnect-attempts&gt;-1&lt;/reconnect-attempts&gt;
+          &lt;static-connectors>
+             &lt;connector-ref>remote-connector&lt;/connector-ref>
+          &lt;/static-connectors>
+     &lt;/bridge&gt;
+     </code>
+     </pre>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java b/examples/features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java
new file mode 100644
index 0000000..0fa17c2
--- /dev/null
+++ b/examples/features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java
@@ -0,0 +1,175 @@
+/*
+ * 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.naming.InitialContext;
+import java.util.Hashtable;
+
+/**
+ * This example demonstrates a core bridge set-up between two nodes, consuming messages from a queue
+ * on one node and forwarding them to an address on the second node.
+ */
+public class BridgeExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection0 = null;
+
+      Connection connection1 = null;
+
+      InitialContext ic0 = null;
+
+      InitialContext ic1 = null;
+
+      try {
+         // Step 1 - we create an initial context for looking up JNDI on node 0
+
+         Hashtable<String, Object> properties = new Hashtable<String, Object>();
+         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://127.0.0.1:61616");
+         properties.put("queue.queue/sausage-factory", "sausage-factory");
+         ic0 = new InitialContext(properties);
+
+         // Step 2 - we look up the sausage-factory queue from node 0
+
+         Queue sausageFactory = (Queue) ic0.lookup("queue/sausage-factory");
+
+         // Step 3 - we look up a JMS ConnectionFactory object from node 0
+
+         ConnectionFactory cf0 = (ConnectionFactory) ic0.lookup("ConnectionFactory");
+
+         // Step 4 - we create an initial context for looking up JNDI on node 1
+
+         properties = new Hashtable<String, Object>();
+         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://127.0.0.1:61617");
+         properties.put("queue.queue/mincing-machine", "mincing-machine");
+         ic1 = new InitialContext(properties);
+
+         // Step 5 - we look up the mincing-machine queue on node 1
+
+         Queue mincingMachine = (Queue) ic1.lookup("queue/mincing-machine");
+
+         // Step 6 - we look up a JMS ConnectionFactory object from node 1
+
+         ConnectionFactory cf1 = (ConnectionFactory) ic1.lookup("ConnectionFactory");
+
+         // Step 7. We create a JMS Connection connection0 which is a connection to server 0
+
+         connection0 = cf0.createConnection();
+
+         // Step 8. We create a JMS Connection connection1 which is a connection to server 1
+         connection1 = cf1.createConnection();
+
+         // Step 9. We create a JMS Session on server 0
+
+         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 10. We create a JMS Session on server 1
+
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 10. We start the connection to ensure delivery occurs on them
+
+         connection1.start();
+
+         // Step 11. We create JMS MessageConsumer object
+         MessageConsumer consumer = session1.createConsumer(mincingMachine);
+
+         // Step 12. We create a JMS MessageProducer object on server 0
+         MessageProducer producer = session0.createProducer(sausageFactory);
+
+         // Step 13. We create and send a message representing an aardvark with a green hat to the sausage-factory
+         // on node 0
+         Message message = session0.createMessage();
+
+         message.setStringProperty("name", "aardvark");
+
+         message.setStringProperty("hat", "green");
+
+         producer.send(message);
+
+         System.out.println("Sent " + message.getStringProperty("name") +
+                               " message with " +
+                               message.getStringProperty("hat") +
+                               " hat to sausage-factory on node 0");
+
+         // Step 14 - we successfully receive the aardvark message from the mincing-machine one node 1. The aardvark's
+         // hat is now blue since it has been transformed!
+
+         Message receivedMessage = consumer.receive(5000);
+
+         System.out.println("Received " + receivedMessage.getStringProperty("name") +
+                               " message with " +
+                               receivedMessage.getStringProperty("hat") +
+                               " hat from mincing-machine on node 1");
+
+         // Step 13. We create and send another message, this time representing a sasquatch with a mauve hat to the
+         // sausage-factory on node 0. This won't be bridged to the mincing-machine since we only want aardvarks, not
+         // sasquatches
+
+         message = session0.createMessage();
+
+         message.setStringProperty("name", "sasquatch");
+
+         message.setStringProperty("hat", "mauve");
+
+         producer.send(message);
+
+         System.out.println("Sent " + message.getStringProperty("name") +
+                               " message with " +
+                               message.getStringProperty("hat") +
+                               " hat to sausage-factory on node 0");
+
+         // Step 14. We don't receive the message since it has not been bridged.
+
+         receivedMessage = consumer.receive(1000);
+
+         if (receivedMessage == null) {
+            System.out.println("Didn't receive that message from mincing-machine on node 1");
+         }
+         else {
+            throw new IllegalStateException();
+         }
+      }
+      finally {
+         // Step 15. Be sure to close our resources!
+
+         if (connection0 != null) {
+            connection0.close();
+         }
+
+         if (connection1 != null) {
+            connection1.close();
+         }
+
+         if (ic0 != null) {
+            ic0.close();
+         }
+
+         if (ic1 != null) {
+            ic1.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/HatColourChangeTransformer.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/HatColourChangeTransformer.java b/examples/features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/HatColourChangeTransformer.java
new file mode 100644
index 0000000..ae8cf39
--- /dev/null
+++ b/examples/features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/HatColourChangeTransformer.java
@@ -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.
+ */
+package org.apache.activemq.artemis.jms.example;
+
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.server.ServerMessage;
+import org.apache.activemq.artemis.core.server.cluster.Transformer;
+
+public class HatColourChangeTransformer implements Transformer {
+
+   public ServerMessage transform(final ServerMessage message) {
+      SimpleString propName = new SimpleString("hat");
+
+      SimpleString oldProp = message.getSimpleStringProperty(propName);
+
+      // System.out.println("Old hat colour is " + oldProp);
+
+      // Change the colour
+      message.putStringProperty(propName, new SimpleString("blue"));
+
+      return message;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/bridge/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/bridge/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/bridge/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..250a851
--- /dev/null
+++ b/examples/features/standard/bridge/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,88 @@
+<?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="sausage-factory"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+
+      <!-- Connectors -->
+      <connectors>
+         <!-- Connector to the other node -->
+         <connector name="remote-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- We need to create a core queue for the JMS queue explicitly because the bridge will be deployed
+      before the JMS queue is deployed, so the first time, it otherwise won't find the queue -->
+      <queues>
+         <queue name="jms.queue.sausage-factory">
+            <address>jms.queue.sausage-factory</address>
+         </queue>
+      </queues>
+
+      <!-- We set-up a bridge that forwards from a queue on this node to an address on another node.
+      We specify a filter with the bridge, and a transformer too. The filter and transformer are optional -->
+      <bridges>
+         <bridge name="my-bridge">
+            <queue-name>jms.queue.sausage-factory</queue-name>
+            <forwarding-address>jms.queue.mincing-machine</forwarding-address>
+            <filter string="name='aardvark'"/>
+            <transformer-class-name>org.apache.activemq.artemis.jms.example.HatColourChangeTransformer</transformer-class-name>
+            <reconnect-attempts>-1</reconnect-attempts>
+            <static-connectors>
+               <connector-ref>remote-connector</connector-ref>
+            </static-connectors>
+         </bridge>
+      </bridges>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.queue.#">
+            <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-settings>
+   </core>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/bridge/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/bridge/src/main/resources/activemq/server1/broker.xml b/examples/features/standard/bridge/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..516f179
--- /dev/null
+++ b/examples/features/standard/bridge/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,59 @@
+<?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="mincing-machine"/>
+   </jms>
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server1/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server1/data/messaging/paging</paging-directory>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.queue.#">
+            <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-settings>
+   </core>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/browser/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/browser/pom.xml b/examples/features/standard/browser/pom.xml
new file mode 100644
index 0000000..7ab1299
--- /dev/null
+++ b/examples/features/standard/browser/pom.xml
@@ -0,0 +1,110 @@
+<?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>browser</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Browser 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>
+                  <phase>verify</phase>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+               </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.QueueBrowserExample</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>browser</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/browser/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/browser/readme.html b/examples/features/standard/browser/readme.html
new file mode 100644
index 0000000..9f9e01a
--- /dev/null
+++ b/examples/features/standard/browser/readme.html
@@ -0,0 +1,40 @@
+<!--
+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 QueueBrowser 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 QueueBrowser Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+     <p>This example shows you how to use a JMS <a href="http://java.sun.com/javaee/5/docs/api/javax/jms/QueueBrowser.html">QueueBrowser</a> with ActiveMQ Artemis.<br />
+     Queues are a standard part of JMS, please consult the JMS 1.1 specification for full details.<br />
+     A QueueBrowser is used to look at messages on the queue without removing them.
+     It can scan the entire content of a queue or only messages matching a message selector.</p>
+     <p>
+         The example will send 2 messages on a queue, use a QueueBrowser to browse
+         the queue (looking at the message without removing them) and finally consume the 2 messages
+     </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java b/examples/features/standard/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java
new file mode 100644
index 0000000..1c9db3b
--- /dev/null
+++ b/examples/features/standard/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java
@@ -0,0 +1,103 @@
+/*
+ * 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.QueueBrowser;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+import java.util.Enumeration;
+
+/**
+ * A simple example which shows how to use a QueueBrowser to look at messages of a queue without removing them from the queue
+ */
+public class QueueBrowserExample {
+
+   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
+         //          you could alternatively instantiate the connection directly
+         //          ConnectionFactory cf = new ActiveMQConnectionFactory(); // this would accept the broker URI as well
+         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 2 Text Messages
+         TextMessage message_1 = session.createTextMessage("this is the 1st message");
+         TextMessage message_2 = session.createTextMessage("this is the 2nd message");
+
+         // Step 8. Send the Message
+         producer.send(message_1);
+         producer.send(message_2);
+
+         // Step 9. Create the JMS QueueBrowser
+         QueueBrowser browser = session.createBrowser(queue);
+
+         // Step 10. Browse the messages on the queue
+         // Browsing a queue does not remove the messages from the queue
+         Enumeration messageEnum = browser.getEnumeration();
+         while (messageEnum.hasMoreElements()) {
+            TextMessage message = (TextMessage) messageEnum.nextElement();
+            System.out.println("Browsing: " + message.getText());
+         }
+
+         // Step 11. Close the browser
+         browser.close();
+
+         // Step 12. Create a JMS Message Consumer
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         // Step 13. Start the Connection
+         connection.start();
+
+         // Step 14. Receive the 2 messages
+         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
+         System.out.println("Received message: " + messageReceived.getText());
+         messageReceived = (TextMessage) messageConsumer.receive(5000);
+         System.out.println("Received message: " + messageReceived.getText());
+      }
+      finally {
+         // Step 15. 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/6b17d966/examples/features/standard/browser/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/browser/src/main/resources/jndi.properties b/examples/features/standard/browser/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/browser/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/6b17d966/examples/features/standard/client-kickoff/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/client-kickoff/pom.xml b/examples/features/standard/client-kickoff/pom.xml
new file mode 100644
index 0000000..6ffb19a
--- /dev/null
+++ b/examples/features/standard/client-kickoff/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>client-kickoff</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Kick Off 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>
+                     <!-- options used for JMX on the example -->
+                     <javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
+                     </javaOptions>
+                  </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.ClientKickoffExample</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>client-kickoff</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>


[47/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-durable-subscription/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-durable-subscription/readme.html b/examples/broker-features/clustered/clustered-durable-subscription/readme.html
deleted file mode 100644
index d50b2b2..0000000
--- a/examples/broker-features/clustered/clustered-durable-subscription/readme.html
+++ /dev/null
@@ -1,66 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Durable Subscription 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 Durable Subscription 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 a clustered JMS durable subscription.
-     Normally durable subscriptions exist on a single node and can only have one subscriber at any one time,
-     however, with ActiveMQ Artemis it's possible to create durable subscription instances with the same name and client-id
-     on different nodes of the cluster, and consume from them simultaneously.
-     This allows the work of processing messages from a durable subscription to be spread across the cluster in
-     a similar way to how JMS Queues can be load balanced across the cluster
-     </p>
-     <p>In this example we first configure the two nodes to form a cluster, then we then create a durable subscriber
-     with the same name and client-id on both nodes, and we create a producer on only one of the nodes.</p>
-     <p>We then send some messages via the producer, and we verify that the messages are round robin'd between
-     the two subscription instances. Note that each durable subscription instance with the same name and client-id
-     <b>does not</b> receive its own copy of the messages. This is because the instances on different nodes form a
-     single "logical" durable subscription, in the same way multiple JMS Queue instances on different nodes
-     form a single "local" JMS Queue</p>
-     <p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
-     JNDI, these could be instantiated directly.
-     <p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster between the two nodes
-     and to load balance the messages between the nodes.</p>
-     <p>The cli create method will define this section by default if you use --clustered as a parameter</p>
-     <pre class="prettyprint">
-     <code>&lt;cluster-connection name="my-cluster"&gt;
-        &lt;address&gt;jms&lt;/address&gt;
-        &lt;retry-interval&gt;500&lt;/retry-interval&gt;
-        &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
-        &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
-        &lt;max-hops&gt;1&lt;/max-hops&gt;
-        &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
-     &lt;/cluster-connection&gt;
-     </code>
-     </pre>
-     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
-     section of the user manual.</p>
-
-   </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java b/examples/broker-features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
deleted file mode 100644
index 6af9577..0000000
--- a/examples/broker-features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
+++ /dev/null
@@ -1,130 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * A simple example that shows a JMS Durable Subscription across two nodes of a cluster.
- *
- * The same durable subscription can exist on more than one node of the cluster, and messages
- * sent to the topic will be load-balanced in a round-robin fashion between the two nodes
- */
-public class ClusteredDurableSubscriptionExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection connection0 = null;
-
-      Connection connection1 = null;
-
-      try {
-         // Step 1. Instantiate the connection factory on server 0
-         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
-
-         // Step 2. nstantiate the connection factory on server 1
-         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
-
-         // Step 3. We create a JMS Connection connection0 which is a connection to server 0
-         // and set the client-id
-         connection0 = cf0.createConnection();
-
-         final String clientID = "my-client-id";
-
-         connection0.setClientID(clientID);
-
-         // Step 4. We create a JMS Connection connection1 which is a connection to server 1
-         // and set the same client-id
-         connection1 = cf1.createConnection();
-
-         connection1.setClientID(clientID);
-
-         // Step 5. We create a JMS Session on server 0
-         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 6. We create a JMS Session on server 1
-         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 7. We start the connections to ensure delivery occurs on them
-         connection0.start();
-
-         connection1.start();
-
-         // Step 8. We create JMS durable subscriptions with the same name and client-id on both nodes
-         // of the cluster
-
-         final String subscriptionName = "my-subscription";
-
-         // Step 9. lookup the topic
-         Topic topic = session0.createTopic("exampleTopic");
-
-         MessageConsumer subscriber0 = session0.createDurableSubscriber(topic, subscriptionName);
-
-         MessageConsumer subscriber1 = session1.createDurableSubscriber(topic, subscriptionName);
-
-         Thread.sleep(1000);
-
-         // Step 10. We create a JMS MessageProducer object on server 0
-         MessageProducer producer = session0.createProducer(topic);
-
-         // Step 11. We send some messages to server 0
-
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session0.createTextMessage("This is text message " + i);
-
-            producer.send(message);
-
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 12. We now consume those messages on *both* server 0 and server 1.
-         // Note that the messages have been load-balanced between the two nodes, with some
-         // messages on node 0 and others on node 1.
-         // The "logical" subscription is distributed across the cluster and contains exactly one copy of all the
-         // messages
-
-         for (int i = 0; i < numMessages; i += 2) {
-            TextMessage message0 = (TextMessage) subscriber0.receive(5000);
-
-            System.out.println("Got message: " + message0.getText() + " from node 0");
-
-            TextMessage message1 = (TextMessage) subscriber1.receive(5000);
-
-            System.out.println("Got message: " + message1.getText() + " from node 1");
-         }
-      }
-      finally {
-         // Step 15. Be sure to close our JMS resources!
-         if (connection0 != null) {
-            connection0.close();
-         }
-
-         if (connection1 != null) {
-            connection1.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 2bfaeae..0000000
--- a/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?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 topic used by the example-->
-      <topic name="exampleTopic"/>
-   </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>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!--  other configuration -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.topic.exampleTopic">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 8134f27..0000000
--- a/examples/broker-features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?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 topic used by the example-->
-      <topic name="exampleTopic"/>
-   </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:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broacast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!--  other configuration -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.topic.exampleTopic">
-            <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-settings>
-
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-grouping/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-grouping/pom.xml b/examples/broker-features/clustered/clustered-grouping/pom.xml
deleted file mode 100644
index b41a2ad..0000000
--- a/examples/broker-features/clustered/clustered-grouping/pom.xml
+++ /dev/null
@@ -1,194 +0,0 @@
-<?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.clustered</groupId>
-      <artifactId>broker-clustered</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>clustered-grouping</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS CLustered Grouping 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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create2</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server2</instance>
-                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server0</location>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server1</location>
-                     <testURI>tcp://localhost:61617</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server1</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start2</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server2</location>
-                     <testURI>tcp://localhost:61618</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server2</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ClusteredGroupingExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server1</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop2</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server2</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.clustered</groupId>
-                  <artifactId>clustered-grouping</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-grouping/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-grouping/readme.html b/examples/broker-features/clustered/clustered-grouping/readme.html
deleted file mode 100644
index 7bce8f2..0000000
--- a/examples/broker-features/clustered/clustered-grouping/readme.html
+++ /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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Clustered Grouping Example</title>
-    <link rel="stylesheet" type="text/css" href="../../../common/common.css">
-  </head>
-  <body>
-     <h1>JMS Clustered Grouping 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 to ensure strict ordering across a cluster using clustered message grouping</p>
-     <p>We create 3 nodes each with a grouping message handler, one with a Local handler and 2 with a Remote handler.</p>
-     <p>The local handler acts as an arbitrator for the 2 remote handlers, holding the information on routes and communicating
-         the routing info with the remote handlers on the other 2 nodes</p>
-     <p>We then send some messages to each node with the same group id set and ensure the same consumer receives all of them</p>
-     <p>Here's the relevant snippet from the server configuration that has the local handler</p>
-     <pre>
-     <code>
-       &lt;cluster-connections&gt;
-          &lt;cluster-connection name="my-cluster"&gt;
-             &lt;address&gt;jms&lt;/address&gt;
-             &lt;connector-ref>netty-connector&lt;/connector-ref>
-             &lt;retry-interval&gt;500&lt;/retry-interval&gt;
-             &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
-             &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
-             &lt;max-hops&gt;1&lt;/max-hops&gt;
-             &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
-          &lt;/cluster-connection&gt;
-       &lt;/cluster-connections&gt;
-
-       &lt;grouping-handler name="my-grouping-handler"&gt;
-          &lt;type&gt;LOCAL&lt;/type&gt;
-          &lt;address&gt;jms&lt;/address&gt;
-          &lt;timeout&gt;5000&lt;/timeout&gt;
-       &lt;/grouping-handler&gt;
-     </code>
-     </pre>
-
-     <p>Here's the relevant snippet from the server configuration that has the remote handlers</p>
-     <pre>
-     <code>
-       &lt;cluster-connections&gt;
-          &lt;cluster-connection name="my-cluster"&gt;
-             &lt;address&gt;jms&lt;/address&gt;
-             &lt;retry-interval&gt;500&lt;/retry-interval&gt;
-             &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
-             &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
-             &lt;max-hops&gt;1&lt;/max-hops&gt;
-             &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
-          &lt;/cluster-connection&gt;
-       &lt;/cluster-connections&gt;
-
-       &lt;grouping-handler name="my-grouping-handler"&gt;
-          &lt;type&gt;REMOTE&lt;/type&gt;
-          &lt;address&gt;jms&lt;/address&gt;
-          &lt;timeout&gt;5000&lt;/timeout&gt;
-       &lt;/grouping-handler&gt;
-     </code>
-     </pre>
-
-   </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java b/examples/broker-features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
deleted file mode 100644
index dfadef5..0000000
--- a/examples/broker-features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
+++ /dev/null
@@ -1,153 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
- * nodes of the cluster.
- */
-public class ClusteredGroupingExample {
-
-   public static void main(String[] args) throws Exception {
-      Connection connection0 = null;
-
-      Connection connection1 = null;
-
-      Connection connection2 = null;
-
-      try {
-         // Step 1. We will instantiate the queue object directly on this example
-         //         This could be done through JNDI or JMSession.createQueue
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         // Step 2. create a connection factory towards server 0.
-         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
-
-         // Step 3. create a connection factory towards server 1.
-         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
-
-         // Step 4.  create a connection factory towards server 2.
-         ConnectionFactory cf2 = new ActiveMQConnectionFactory("tcp://localhost:61618");
-
-         // Step 5. We create a JMS Connection connection0 which is a connection to server 0
-         connection0 = cf0.createConnection();
-
-         // Step 6. We create a JMS Connection connection1 which is a connection to server 1
-         connection1 = cf1.createConnection();
-
-         // Step 7. We create a JMS Connection connection2 which is a connection to server 2
-         connection2 = cf2.createConnection();
-
-         // Step 8. We create a JMS Session on server 0
-         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 9. We create a JMS Session on server 1
-         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 10. We create a JMS Session on server 2
-         Session session2 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 11. We start the connections to ensure delivery occurs on them
-         connection0.start();
-
-         connection1.start();
-
-         connection2.start();
-
-         // Step 12. We create JMS MessageConsumer objects on server 0
-         MessageConsumer consumer = session0.createConsumer(queue);
-
-         // Step 13. We create a JMS MessageProducer object on server 0, 1 and 2
-         MessageProducer producer0 = session0.createProducer(queue);
-
-         MessageProducer producer1 = session1.createProducer(queue);
-
-         MessageProducer producer2 = session2.createProducer(queue);
-
-         // Step 14. We send some messages to server 0, 1 and 2 with the same groupid set
-
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session0.createTextMessage("This is text message " + i);
-
-            message.setStringProperty("JMSXGroupID", "Group-0");
-
-            producer0.send(message);
-
-            System.out.println("Sent messages: " + message.getText() + " to node 0");
-         }
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session1.createTextMessage("This is text message " + (i + 10));
-
-            message.setStringProperty("JMSXGroupID", "Group-0");
-
-            producer1.send(message);
-
-            System.out.println("Sent messages: " + message.getText() + " to node 1");
-
-         }
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session2.createTextMessage("This is text message " + (i + 20));
-
-            message.setStringProperty("JMSXGroupID", "Group-0");
-
-            producer2.send(message);
-
-            System.out.println("Sent messages: " + message.getText() + " to node 2");
-         }
-
-         // Step 15. We now consume those messages from server 0
-         // We note the messages have all been sent to the same consumer on the same node
-
-         for (int i = 0; i < numMessages * 3; i++) {
-            TextMessage message0 = (TextMessage) consumer.receive(5000);
-
-            System.out.println("Got message: " + message0.getText() + " from node 0");
-
-         }
-      }
-      finally {
-         // Step 17. Be sure to close our resources!
-
-         if (connection0 != null) {
-            connection0.close();
-         }
-
-         if (connection1 != null) {
-            connection1.close();
-         }
-
-         if (connection2 != null) {
-            connection2.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 4520059..0000000
--- a/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?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>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <grouping-handler name="my-grouping-handler">
-         <type>LOCAL</type>
-         <address>jms</address>
-         <timeout>5000</timeout>
-         <group-timeout>-1</group-timeout>
-         <reaper-period>30000</reaper-period>
-      </grouping-handler>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 4765f7a..0000000
--- a/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?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:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <grouping-handler name="my-grouping-handler">
-         <type>REMOTE</type>
-         <address>jms</address>
-         <timeout>5000</timeout>
-      </grouping-handler>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml b/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml
deleted file mode 100644
index 16bf2eb..0000000
--- a/examples/broker-features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?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:61618</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <grouping-handler name="my-grouping-handler">
-         <type>REMOTE</type>
-         <address>jms</address>
-         <timeout>5000</timeout>
-      </grouping-handler>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-jgroups/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-jgroups/pom.xml b/examples/broker-features/clustered/clustered-jgroups/pom.xml
deleted file mode 100644
index 30f6a20..0000000
--- a/examples/broker-features/clustered/clustered-jgroups/pom.xml
+++ /dev/null
@@ -1,161 +0,0 @@
-<?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.clustered</groupId>
-      <artifactId>broker-clustered</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>clustered-jgroups</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Clustered JGroups 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>
-                     <libList>
-                        <!-- You need to add jgroups.jar to the server's lib -->
-                        <arg>org.jgroups:jgroups:3.6.0.Final</arg>
-                     </libList>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <libList>
-                        <!-- You need to add jgroups.jar to the server's lib -->
-                        <arg>org.jgroups:jgroups:3.6.0.Final</arg>
-                     </libList>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server0</location>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server1</location>
-                     <testURI>tcp://localhost:61617</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server1</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ClusteredJgroupsExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <location>${basedir}/target/server1</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.clustered</groupId>
-                  <artifactId>clustered-jgroups</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-jgroups/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-jgroups/readme.html b/examples/broker-features/clustered/clustered-jgroups/readme.html
deleted file mode 100644
index 2731997..0000000
--- a/examples/broker-features/clustered/clustered-jgroups/readme.html
+++ /dev/null
@@ -1,67 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Clustering with JGroups 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>ActiveMQ Artemis Clustering with JGroups 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 the working of a two node cluster using JGroups as the underlying topology broadcasting/discovery
-     technique.</p>
-     <p>We deploy a queue on to the cluster, then create a consumer on the queue on each node, and we create a producer on only one of the nodes.</p>
-     <p>We then send some messages via the producer, and we verify that <b>both</b> consumers receive the sent messages
-     in a round-robin fashion.</p>
-     <p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
-     JNDI, these could be instantiated directly.</p>
-     <p>To enable ActiveMQ Artemis to use JGroups you need to configure JGroups configuration file and make sure it is on the classpath
-         by placing in the configuration directory, the file test-jgroups-file_ping.xml is the configuration used in this
-     exaample</p>
-     <p>You then configure the jgroups file used by the broadcast and discovery groups in the configuration along with the
-         channel name which you want this cluster to share.</p>
-     <pre class="prettyprint">
-     <code>
-   &lt;broadcast-groups&gt;
-      &lt;broadcast-group name="my-broadcast-group">
-         &lt;broadcast-period>5000&lt;/broadcast-period>
-         &lt;jgroups-file>test-jgroups-file_ping.xml&lt;/jgroups-file>
-         &lt;jgroups-channel>activemq_broadcast_channel&lt;/jgroups-channel>
-         &lt;connector-ref>netty-connector&lt;/connector-ref>
-      &lt;/broadcast-group>
-   &lt;/broadcast-groups&gt;
-
-   &lt;discovery-groups&gt;
-      &lt;discovery-group name="my-discovery-group">
-         &lt;jgroups-file>test-jgroups-file_ping.xml&lt;/jgroups-file>
-         &lt;jgroups-channel>activemq_broadcast_channel&lt;/jgroups-channel>
-         &lt;refresh-timeout>10000&lt;/refresh-timeout>
-      &lt;/discovery-group>
-   &lt;/discovery-groups&gt;
-     </code>
-     </pre>
-     <p>For more information on ActiveMQ Artemis clustering in general, please see the clustering
-     section of the user manual.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java b/examples/broker-features/clustered/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java
deleted file mode 100644
index f8016b1..0000000
--- a/examples/broker-features/clustered/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java
+++ /dev/null
@@ -1,140 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-import java.util.Hashtable;
-
-/**
- * A simple example that demonstrates clustering using jgroups.
- */
-public class ClusteredJgroupsExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection connection0 = null;
-
-      Connection connection1 = null;
-
-      InitialContext ic0 = null;
-
-      InitialContext ic1 = null;
-
-      try {
-         // Step 1. Get an initial context for looking up JNDI from server 0
-         Hashtable<String, Object> properties = new Hashtable<String, Object>();
-         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616");
-         properties.put("queue.queue/exampleQueue", "exampleQueue");
-         ic0 = new InitialContext(properties);
-
-         // Step 2. Look-up the JMS Queue object from JNDI
-         Queue queue = (Queue) ic0.lookup("queue/exampleQueue");
-
-         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory cf0 = (ConnectionFactory) ic0.lookup("ConnectionFactory");
-
-         // Step 4. Get an initial context for looking up JNDI from server 1
-         properties = new Hashtable<String, Object>();
-         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
-         ic1 = new InitialContext(properties);
-
-         // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
-         ConnectionFactory cf1 = (ConnectionFactory) ic1.lookup("ConnectionFactory");
-
-         // Step 6. We create a JMS Connection connection0 which is a connection to server 0
-         connection0 = cf0.createConnection();
-
-         // Step 7. We create a JMS Connection connection1 which is a connection to server 1
-         connection1 = cf1.createConnection();
-
-         // Step 8. We create a JMS Session on server 0
-         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 9. We create a JMS Session on server 1
-         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 10. We start the connections to ensure delivery occurs on them
-         connection0.start();
-
-         connection1.start();
-
-         // Step 11. We create JMS MessageConsumer objects on server 0 and server 1
-         MessageConsumer consumer0 = session0.createConsumer(queue);
-
-         MessageConsumer consumer1 = session1.createConsumer(queue);
-
-         Thread.sleep(1000);
-
-         // Step 12. We create a JMS MessageProducer object on server 0
-         MessageProducer producer = session0.createProducer(queue);
-
-         // Step 13. We send some messages to server 0
-
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session0.createTextMessage("This is text message " + i);
-
-            producer.send(message);
-
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 14. We now consume those messages on *both* server 0 and server 1.
-         // We note the messages have been distributed between servers in a round robin fashion
-         // JMS Queues implement point-to-point message where each message is only ever consumed by a
-         // maximum of one consumer
-
-         for (int i = 0; i < numMessages; i += 2) {
-            TextMessage message0 = (TextMessage) consumer0.receive(5000);
-
-            System.out.println("Got message: " + message0.getText() + " from node 0");
-
-            TextMessage message1 = (TextMessage) consumer1.receive(5000);
-
-            System.out.println("Got message: " + message1.getText() + " from node 1");
-         }
-      }
-      finally {
-         // Step 15. Be sure to close our resources!
-
-         if (connection0 != null) {
-            connection0.close();
-         }
-
-         if (connection1 != null) {
-            connection1.close();
-         }
-
-         if (ic0 != null) {
-            ic0.close();
-         }
-
-         if (ic1 != null) {
-            ic1.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 17809e5..0000000
--- a/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?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>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <broadcast-period>5000</broadcast-period>
-            <jgroups-file>test-jgroups-file_ping.xml</jgroups-file>
-            <jgroups-channel>active_broadcast_channel</jgroups-channel>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <jgroups-file>test-jgroups-file_ping.xml</jgroups-file>
-            <jgroups-channel>active_broadcast_channel</jgroups-channel>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server0/client-jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server0/client-jndi.properties b/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server0/client-jndi.properties
deleted file mode 100644
index 5cbe72c..0000000
--- a/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server0/client-jndi.properties
+++ /dev/null
@@ -1,19 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server0/test-jgroups-file_ping.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server0/test-jgroups-file_ping.xml b/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server0/test-jgroups-file_ping.xml
deleted file mode 100644
index 5fb6ab4..0000000
--- a/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server0/test-jgroups-file_ping.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?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.
--->
-
-<config xmlns="urn:org:jgroups"
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="urn:org:jgroups file:schema/JGroups-2.8.xsd">
-    <TCP loopback="true"
-         recv_buf_size="20000000"
-         send_buf_size="640000"
-         discard_incompatible_packets="true"
-         max_bundle_size="64000"
-         max_bundle_timeout="30"
-         enable_bundling="true"
-         use_send_queues="false"
-         sock_conn_timeout="300"
-
-         thread_pool.enabled="true"
-         thread_pool.min_threads="1"
-         thread_pool.max_threads="10"
-         thread_pool.keep_alive_time="5000"
-         thread_pool.queue_enabled="false"
-         thread_pool.queue_max_size="100"
-         thread_pool.rejection_policy="run"
-
-         oob_thread_pool.enabled="true"
-         oob_thread_pool.min_threads="1"
-         oob_thread_pool.max_threads="8"
-         oob_thread_pool.keep_alive_time="5000"
-         oob_thread_pool.queue_enabled="false"
-         oob_thread_pool.queue_max_size="100"
-         oob_thread_pool.rejection_policy="run"/>
-
-   <!-- a location that can be found by both server's running -->
-    <FILE_PING location="../../file.ping.dir"/>
-    <MERGE2 max_interval="30000"
-              min_interval="10000"/>
-    <FD_SOCK/>
-    <FD timeout="10000" max_tries="5" />
-    <VERIFY_SUSPECT timeout="1500"  />
-    <BARRIER />
-    <pbcast.NAKACK
-                   use_mcast_xmit="false"
-                   retransmit_timeout="300,600,1200,2400,4800"
-                   discard_delivered_msgs="true"/>
-    <UNICAST timeout="300,600,1200" />
-    <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
-                   max_bytes="400000"/>
-    <pbcast.GMS print_local_addr="true" join_timeout="3000"
-
-                view_bundling="true"/>
-    <FC max_credits="2000000"
-        min_threshold="0.10"/>
-    <FRAG2 frag_size="60000"  />
-    <pbcast.STATE_TRANSFER/>
-    <pbcast.FLUSH timeout="0"/>
-</config>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 267eae7..0000000
--- a/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?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:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <broadcast-period>5000</broadcast-period>
-            <jgroups-file>test-jgroups-file_ping.xml</jgroups-file>
-            <jgroups-channel>active_broadcast_channel</jgroups-channel>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <jgroups-file>test-jgroups-file_ping.xml</jgroups-file>
-            <jgroups-channel>active_broadcast_channel</jgroups-channel>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server1/client-jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server1/client-jndi.properties b/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server1/client-jndi.properties
deleted file mode 100644
index 7f579c1..0000000
--- a/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server1/client-jndi.properties
+++ /dev/null
@@ -1,19 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-java.naming.provider.url=tcp://localhost:61617

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server1/test-jgroups-file_ping.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server1/test-jgroups-file_ping.xml b/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server1/test-jgroups-file_ping.xml
deleted file mode 100644
index 1137496..0000000
--- a/examples/broker-features/clustered/clustered-jgroups/src/main/resources/activemq/server1/test-jgroups-file_ping.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?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.
--->
-
-<config xmlns="urn:org:jgroups"
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.0.xsd">
-    <TCP loopback="true"
-         recv_buf_size="20000000"
-         send_buf_size="640000"
-         discard_incompatible_packets="true"
-         max_bundle_size="64000"
-         max_bundle_timeout="30"
-         enable_bundling="true"
-         use_send_queues="false"
-         sock_conn_timeout="300"
-
-         thread_pool.enabled="true"
-         thread_pool.min_threads="1"
-         thread_pool.max_threads="10"
-         thread_pool.keep_alive_time="5000"
-         thread_pool.queue_enabled="false"
-         thread_pool.queue_max_size="100"
-         thread_pool.rejection_policy="run"
-
-         oob_thread_pool.enabled="true"
-         oob_thread_pool.min_threads="1"
-         oob_thread_pool.max_threads="8"
-         oob_thread_pool.keep_alive_time="5000"
-         oob_thread_pool.queue_enabled="false"
-         oob_thread_pool.queue_max_size="100"
-         oob_thread_pool.rejection_policy="run"/>
-
-    <!-- a location that can be found by both server's running -->
-    <FILE_PING location="../../file.ping.dir"/>
-    <MERGE2 max_interval="30000"
-              min_interval="10000"/>
-    <FD_SOCK/>
-    <FD timeout="10000" max_tries="5" />
-    <VERIFY_SUSPECT timeout="1500"  />
-    <BARRIER />
-    <pbcast.NAKACK
-                   use_mcast_xmit="false"
-                   retransmit_timeout="300,600,1200,2400,4800"
-                   discard_delivered_msgs="true"/>
-    <UNICAST timeout="300,600,1200" />
-    <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
-                   max_bytes="400000"/>
-    <pbcast.GMS print_local_addr="true" join_timeout="3000"
-
-                view_bundling="true"/>
-    <FC max_credits="2000000"
-        min_threshold="0.10"/>
-    <FRAG2 frag_size="60000"  />
-    <pbcast.STATE_TRANSFER/>
-    <pbcast.FLUSH timeout="0"/>
-</config>


[27/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.keystore
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.keystore b/examples/broker-features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.keystore
deleted file mode 100644
index 50de681..0000000
Binary files a/examples/broker-features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.keystore and /dev/null differ

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.truststore
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.truststore b/examples/broker-features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.truststore
deleted file mode 100644
index 129391a..0000000
Binary files a/examples/broker-features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.truststore and /dev/null differ

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index f0de0fc..0000000
--- a/examples/broker-features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?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.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-ssl-acceptor">tcp://localhost:5500?sslEnabled=true;keyStorePath=activemq/server0/activemq.example.keystore;keyStorePassword=activemqexample</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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/ssl-enabled/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/ssl-enabled/src/main/resources/jndi.properties b/examples/broker-features/standard/ssl-enabled/src/main/resources/jndi.properties
deleted file mode 100644
index 7929c7c..0000000
--- a/examples/broker-features/standard/ssl-enabled/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:5500?sslEnabled=true&trustStorePath=activemq/server0/activemq.example.truststore&trustStorePassword=activemqexample
-queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/static-selector/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/static-selector/pom.xml b/examples/broker-features/standard/static-selector/pom.xml
deleted file mode 100644
index 1ce08e6..0000000
--- a/examples/broker-features/standard/static-selector/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>static-selector</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis Static Selector 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>
-                     <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.StaticSelectorExample</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>static-selector</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/static-selector/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/static-selector/readme.html b/examples/broker-features/standard/static-selector/readme.html
deleted file mode 100644
index 0dca49f..0000000
--- a/examples/broker-features/standard/static-selector/readme.html
+++ /dev/null
@@ -1,60 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Static Message Selector 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>Static Message Selector Example</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
-
-
-     <p>This example shows you how to configure a ActiveMQ Artemis queue with static message selectors (filters)
-        (to configure a static selector directly on a <em>JMS</em> queue, please see the
-        <a href="../static-selector-jms/readme.html">static-selector-jms example</a>).</p>
-
-     <p>Static message selectors are ActiveMQ's extension to message selectors as defined in JMS spec 1.1.
-     Rather than specifying the selector in the application code, static message selectors are defined in one of
-     ActiveMQ's configuration files, broker.xml, as an element called 'filter' inside each queue
-     definition, like</p>
-
-     <pre class="prettyprint"><code>
-      &lt;queues&gt;
-      	&lt;queue name=&quot;jms.queue.selectorQueue&quot;&gt;
-      	    &lt;address&gt;jms.queue.selectorQueue&lt;/address&gt;
-      	    &lt;filter string=&quot;color='red'&quot;/&gt;
-      	&lt;/queue&gt;
-      &lt;/queues&gt;
-     </code></pre>
-
-     <p>Once configured the queue 'selectorQueue' only delivers messages that are selected against the filter, i.e.,
-     only the messages whose 'color' properties are of 'red' values can be received by its consumers. Those that don't match
-     the filter will be dropped by the queue and therefore will never be delivered to any of its consumers.</p>
-
-     <p>In the example code, five messages with different 'color' property values are sent to queue 'selectorQueue'. One consumer
-     is created to receive messages from the queue. Of the five sent messages, two are of 'red' color properties, one is 'blue',
-     one is 'green' and one has not the 'color' property at all. The result is that the consumer only gets the two 'red' messages.</p>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/static-selector/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/static-selector/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorExample.java b/examples/broker-features/standard/static-selector/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorExample.java
deleted file mode 100644
index 08f9db9..0000000
--- a/examples/broker-features/standard/static-selector/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorExample.java
+++ /dev/null
@@ -1,137 +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.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 shows how static message selectors work.
- */
-public class StaticSelectorExample {
-
-   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, this is the queue that has filter configured with it.
-         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 6. Create a JMS Session
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         Session producerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 7. Create a JMS Message Producer
-         MessageProducer producer = producerSession.createProducer(queue);
-
-         // Step 8. Create a JMS Message Consumer that receives 'red' messages
-         MessageConsumer redConsumer = session.createConsumer(queue);
-         redConsumer.setMessageListener(new SimpleMessageListener("red", result));
-
-         // Step 9. Create five messages with different 'color' properties
-         TextMessage redMessage1 = session.createTextMessage("Red-1");
-         redMessage1.setStringProperty("color", "red");
-         TextMessage redMessage2 = session.createTextMessage("Red-2");
-         redMessage2.setStringProperty("color", "red");
-         TextMessage greenMessage = session.createTextMessage("Green");
-         greenMessage.setStringProperty("color", "green");
-         TextMessage blueMessage = session.createTextMessage("Blue");
-         blueMessage.setStringProperty("color", "blue");
-         TextMessage normalMessage = session.createTextMessage("No color");
-
-         // Step 10. Send the Messages
-         producer.send(redMessage1);
-         System.out.println("Message sent: " + redMessage1.getText());
-         producer.send(greenMessage);
-         System.out.println("Message sent: " + greenMessage.getText());
-         producer.send(blueMessage);
-         System.out.println("Message sent: " + blueMessage.getText());
-         producer.send(redMessage2);
-         System.out.println("Message sent: " + redMessage2.getText());
-         producer.send(normalMessage);
-         System.out.println("Message sent: " + normalMessage.getText());
-
-         // Step 11. Waiting for the message listener to check the received messages.
-         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 != null && !colorProp.equals(name)) {
-            result.set(false);
-         }
-      }
-      catch (JMSException e) {
-         e.printStackTrace();
-         result.set(false);
-      }
-   }
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/static-selector/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/static-selector/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/static-selector/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index ca09b3b..0000000
--- a/examples/broker-features/standard/static-selector/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?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.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <queues>
-         <queue name="jms.queue.exampleQueue">
-            <address>jms.queue.exampleQueue</address>
-            <filter string="color='red'"/>
-         </queue>
-      </queues>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/static-selector/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/static-selector/src/main/resources/jndi.properties b/examples/broker-features/standard/static-selector/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/static-selector/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/temp-queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/temp-queue/pom.xml b/examples/broker-features/standard/temp-queue/pom.xml
deleted file mode 100644
index 624d8ed..0000000
--- a/examples/broker-features/standard/temp-queue/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>temp-queue</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Temporary 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>
-                     <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.TemporaryQueueExample</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>temp-queue</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/temp-queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/temp-queue/readme.html b/examples/broker-features/standard/temp-queue/readme.html
deleted file mode 100644
index 4b4d5c8..0000000
--- a/examples/broker-features/standard/temp-queue/readme.html
+++ /dev/null
@@ -1,40 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Temporary 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 Temporary 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 use a TemporaryQueue with ActiveMQ Artemis. First a temporary queue is created to send and receive a message and then deleted.
-         Then another temporary queue is created and used after its connection is closed to illustrate its scope.</p>
-     <p>A TemporaryQueue is a JMS queue that exists only within the lifetime of its connection. It is often used in request-reply
-         type messaging where the reply is sent through a temporary destination. The temporary queue is often created as
-         a server resource, so after using, the user should call delete() method to release the resources.
-         Please consult the JMS 1.1 specification for full details.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/temp-queue/src/main/java/org/apache/activemq/artemis/jms/example/TemporaryQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/temp-queue/src/main/java/org/apache/activemq/artemis/jms/example/TemporaryQueueExample.java b/examples/broker-features/standard/temp-queue/src/main/java/org/apache/activemq/artemis/jms/example/TemporaryQueueExample.java
deleted file mode 100644
index 5747fae..0000000
--- a/examples/broker-features/standard/temp-queue/src/main/java/org/apache/activemq/artemis/jms/example/TemporaryQueueExample.java
+++ /dev/null
@@ -1,118 +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.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-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 temporary queues.
- */
-public class TemporaryQueueExample {
-
-   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. Look-up the JMS connection factory
-         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 3. Create a JMS Connection
-         connection = cf.createConnection();
-
-         // Step 4. Start the connection
-         connection.start();
-
-         // Step 5. Create a JMS session with AUTO_ACKNOWLEDGE mode
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 6. Create a Temporary Queue
-         TemporaryQueue tempQueue = session.createTemporaryQueue();
-
-         System.out.println("Temporary queue is created: " + tempQueue);
-
-         // Step 7. Create a JMS message producer
-         MessageProducer messageProducer = session.createProducer(tempQueue);
-
-         // Step 8. Create a text message
-         TextMessage message = session.createTextMessage("This is a text message");
-
-         // Step 9. Send the text message to the queue
-         messageProducer.send(message);
-
-         System.out.println("Sent message: " + message.getText());
-
-         // Step 11. Create a message consumer
-         MessageConsumer messageConsumer = session.createConsumer(tempQueue);
-
-         // Step 12. Receive the message from the queue
-         message = (TextMessage) messageConsumer.receive(5000);
-
-         System.out.println("Received message: " + message.getText());
-
-         // Step 13. Close the consumer and producer
-         messageConsumer.close();
-         messageProducer.close();
-
-         // Step 14. Delete the temporary queue
-         tempQueue.delete();
-
-         // Step 15. Create another temporary queue.
-         TemporaryQueue tempQueue2 = session.createTemporaryQueue();
-
-         System.out.println("Another temporary queue is created: " + tempQueue2);
-
-         // Step 16. Close the connection.
-         connection.close();
-
-         // Step 17. Create a new connection.
-         connection = cf.createConnection();
-
-         // Step 18. Create a new session.
-         session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 19. Try to access the tempQueue2 outside its lifetime
-         try {
-            messageConsumer = session.createConsumer(tempQueue2);
-            throw new Exception("Temporary queue cannot be accessed outside its lifecycle!");
-         }
-         catch (JMSException e) {
-            System.out.println("Exception got when trying to access a temp queue outside its scope: " + e);
-         }
-      }
-      finally {
-         if (connection != null) {
-            // Step 20. Be sure to close our JMS resources!
-            connection.close();
-         }
-         if (initialContext != null) {
-            // Step 21. Also close the initialContext!
-            initialContext.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 2dd2df9..0000000
--- a/examples/broker-features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?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>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-      <security-settings>
-         <!--security for example queues -->
-         <security-setting match="jms.queue.#">
-            <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 settings for JMS temporary queue -->
-         <security-setting match="jms.tempqueue.#">
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/temp-queue/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/temp-queue/src/main/resources/jndi.properties b/examples/broker-features/standard/temp-queue/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/temp-queue/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/topic-hierarchies/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-hierarchies/pom.xml b/examples/broker-features/standard/topic-hierarchies/pom.xml
deleted file mode 100644
index e3fe3f8..0000000
--- a/examples/broker-features/standard/topic-hierarchies/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>topic-hierarchies</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Topic Hierarchies 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>
-                     <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.TopicHierarchyExample</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>topic-hierarchies</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic-hierarchies/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-hierarchies/readme.html b/examples/broker-features/standard/topic-hierarchies/readme.html
deleted file mode 100644
index 0aa16ca..0000000
--- a/examples/broker-features/standard/topic-hierarchies/readme.html
+++ /dev/null
@@ -1,42 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Topic Hierarchy 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>Topic Hierarchy 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>ActiveMQ Artemis supports topic hierarchies. With a topic hierarchy you can register a subscriber with a wild-card
-     and that subscriber will receive any messages routed to an address that match the wildcard.</p>
-     <p>ActiveMQ Artemis wild-cards can use the character '#' which means "match any number of words", and
-     the character '*' which means "match a single word". Words are delimited by the character "."</p>
-     <p>For example if I subscribe using the wild-card "news.europe.#", then that would match messages sent to the addresses
-     "news.europe", "news.europe.sport" and "news.europe.entertainment", but it does not match messages sent to the
-     address "news.usa.wrestling"</p>
-     <p>For more information on the wild-card syntax please consult the user manual.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java b/examples/broker-features/standard/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java
deleted file mode 100644
index 0a720da..0000000
--- a/examples/broker-features/standard/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java
+++ /dev/null
@@ -1,121 +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.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.naming.InitialContext;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-
-/**
- * This example demonstrates how a JMS TopicSubscriber can be created to subscribe to a wild-card Topic.
- *
- * For more information please see the readme.html
- */
-public class TopicHierarchyExample {
-
-   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 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. Instantiate a topic representing the wildcard we're going to subscribe to
-         Topic topicSubscribe = ActiveMQJMSClient.createTopic("news.europe.#");
-
-         // Step 7. Create a consumer (topic subscriber) that will consume using that wildcard
-         // The consumer will receive any messages sent to any topic that starts with news.europe
-         MessageConsumer messageConsumer = session.createConsumer(topicSubscribe);
-
-         // Step 8. Create an anonymous producer
-         MessageProducer producer = session.createProducer(null);
-
-         // Step 9. Instantiate some more topic objects corresponding to the individual topics
-         // we're going to send messages to
-         Topic topicNewsUsaWrestling = ActiveMQJMSClient.createTopic("news.usa.wrestling");
-
-         Topic topicNewsEuropeSport = ActiveMQJMSClient.createTopic("news.europe.sport");
-
-         Topic topicNewsEuropeEntertainment = ActiveMQJMSClient.createTopic("news.europe.entertainment");
-
-         // Step 10. Send a message destined for the usa wrestling topic
-         TextMessage messageWrestlingNews = session.createTextMessage("Hulk Hogan starts ballet classes");
-
-         producer.send(topicNewsUsaWrestling, messageWrestlingNews);
-
-         // Step 11. Send a message destined for the europe sport topic
-         TextMessage messageEuropeSport = session.createTextMessage("Lewis Hamilton joins European synchronized swimming team");
-
-         producer.send(topicNewsEuropeSport, messageEuropeSport);
-
-         // Step 12. Send a message destined for the europe entertainment topic
-         TextMessage messageEuropeEntertainment = session.createTextMessage("John Lennon resurrected from dead");
-
-         producer.send(topicNewsEuropeEntertainment, messageEuropeEntertainment);
-
-         // Step 9. Start the connection
-
-         connection.start();
-
-         // Step 10. We don't receive the usa wrestling message since we subscribed to news.europe.# and
-         // that doesn't match news.usa.wrestling. However we do receive the Europe sport message, and the
-         // europe entertainment message, since these match the wildcard.
-
-         TextMessage messageReceived1 = (TextMessage) messageConsumer.receive(5000);
-
-         System.out.println("Received message: " + messageReceived1.getText());
-
-         TextMessage messageReceived2 = (TextMessage) messageConsumer.receive(5000);
-
-         System.out.println("Received message: " + messageReceived2.getText());
-
-         Message message = messageConsumer.receive(1000);
-
-         if (message != null) {
-            throw new IllegalStateException("Message was not null.");
-         }
-
-         System.out.println("Didn't received any more message: " + message);
-      }
-      finally {
-         // Step 12. Be sure to close our resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 9ec66c6..0000000
--- a/examples/broker-features/standard/topic-hierarchies/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?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 topics used by the example-->
-
-      <topic name="news"/>
-
-      <topic name="news.usa"/>
-
-      <topic name="news.usa.wrestling"/>
-
-      <topic name="news.europe"/>
-
-      <topic name="news.europe.sport"/>
-
-      <topic name="news.europe.entertainment"/>
-   </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>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.#">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic-hierarchies/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-hierarchies/src/main/resources/jndi.properties b/examples/broker-features/standard/topic-hierarchies/src/main/resources/jndi.properties
deleted file mode 100644
index 5cbe72c..0000000
--- a/examples/broker-features/standard/topic-hierarchies/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,19 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic-selector-example1/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-selector-example1/pom.xml b/examples/broker-features/standard/topic-selector-example1/pom.xml
deleted file mode 100644
index f883759..0000000
--- a/examples/broker-features/standard/topic-selector-example1/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>topic-selector1</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Topic Selector Example 1</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>
-                     <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.TopicSelectorExample1</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>topic-selector1</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic-selector-example1/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-selector-example1/readme.html b/examples/broker-features/standard/topic-selector-example1/readme.html
deleted file mode 100644
index f03f4f5..0000000
--- a/examples/broker-features/standard/topic-selector-example1/readme.html
+++ /dev/null
@@ -1,38 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Topic Selector Example 1</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 Topic Selector Example 1</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 how messages can be consumed from a topic using Message Selectors.</p>
-     <p>Consumers (or Subscribers) will only consume messages routed to a topic that match the provided selector</p>
-     <p>Topics and selectors are a standard part of JMS, please consult the JMS 1.1 specification for full details.</p>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java b/examples/broker-features/standard/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java
deleted file mode 100644
index 53aee12..0000000
--- a/examples/broker-features/standard/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java
+++ /dev/null
@@ -1,145 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.naming.InitialContext;
-
-/**
- * A simple JMS Topic example that creates a producer and consumer on a queue and sends and receives a message.
- */
-public class TopicSelectorExample1 {
-
-   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. Look-up the JMS topic
-         Topic topic = (Topic) initialContext.lookup("topic/exampleTopic");
-
-         // Step 3. Look-up the JMS 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(topic);
-
-         // Step 7. Create one subscription with a specific Filter for someID=1
-         MessageConsumer messageConsumer1 = session.createConsumer(topic, "someID=1", false);
-
-         // Step 8. Create another subscription with a specific Filter for someID=2
-         MessageConsumer messageConsumer2 = session.createConsumer(topic, "someID=2", false);
-
-         // Step 9. Create another subscription with no filters, which will receive every message sent to the topic
-         MessageConsumer messageConsumer3 = session.createConsumer(topic);
-
-         // Step 10. Send 20 messages, 10 with someID=1, 10 with someID=2
-
-         for (int i = 1; i < 10; i++) {
-            for (int someID = 1; someID <= 2; someID++) {
-               // Step 10.1 Create a text message
-               TextMessage message1 = session.createTextMessage("This is a text message " + i +
-                                                                   " sent for someID=" +
-                                                                   someID);
-
-               // Step 10.1 Set a property
-               message1.setIntProperty("someID", someID);
-
-               // Step 10.2 Send the message
-               producer.send(message1);
-
-               System.out.println("Sent message: " + message1.getText());
-            }
-         }
-
-         // Step 11. Start the JMS Connection. This step will activate the subscribers to receive messages.
-         connection.start();
-
-         // Step 12. Consume the messages from MessageConsumer1, filtering out someID=2
-
-         System.out.println("*************************************************************");
-         System.out.println("MessageConsumer1 will only receive messages where someID=1:");
-         for (;;) {
-            TextMessage messageReceivedA = (TextMessage) messageConsumer1.receive(1000);
-            if (messageReceivedA == null) {
-               break;
-            }
-
-            System.out.println("messageConsumer1 received " + messageReceivedA.getText() +
-                                  " someID = " +
-                                  messageReceivedA.getIntProperty("someID"));
-         }
-
-         // Step 13. Consume the messages from MessageConsumer2, filtering out someID=2
-         System.out.println("*************************************************************");
-         System.out.println("MessageConsumer2 will only receive messages where someID=2:");
-         for (;;) {
-            TextMessage messageReceivedB = (TextMessage) messageConsumer2.receive(1000);
-            if (messageReceivedB == null) {
-               break;
-            }
-
-            System.out.println("messageConsumer2 received " + messageReceivedB.getText() +
-                                  " someID = " +
-                                  messageReceivedB.getIntProperty("someID"));
-         }
-
-         // Step 14. Consume the messages from MessageConsumer3, receiving the complete set of messages
-         System.out.println("*************************************************************");
-         System.out.println("MessageConsumer3 will receive every message:");
-         for (;;) {
-            TextMessage messageReceivedC = (TextMessage) messageConsumer3.receive(1000);
-            if (messageReceivedC == null) {
-               break;
-            }
-            System.out.println("messageConsumer3 received " + messageReceivedC.getText() +
-                                  " someID = " +
-                                  messageReceivedC.getIntProperty("someID"));
-         }
-
-         // Step 15. Close the subscribers
-         messageConsumer1.close();
-         messageConsumer2.close();
-         messageConsumer3.close();
-      }
-      finally {
-         // Step 15. 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/6b17d966/examples/broker-features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index d45eb5d..0000000
--- a/examples/broker-features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?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 topic used by the example-->
-      <topic name="exampleTopic"/>
-   </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>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example topic-->
-         <security-setting match="jms.topic.exampleTopic">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic-selector-example1/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-selector-example1/src/main/resources/jndi.properties b/examples/broker-features/standard/topic-selector-example1/src/main/resources/jndi.properties
deleted file mode 100644
index 54bed6d..0000000
--- a/examples/broker-features/standard/topic-selector-example1/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-topic.topic/exampleTopic=exampleTopic

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic-selector-example2/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-selector-example2/pom.xml b/examples/broker-features/standard/topic-selector-example2/pom.xml
deleted file mode 100644
index d5f88c6..0000000
--- a/examples/broker-features/standard/topic-selector-example2/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>topic-selector2</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Topic Selector Example 2</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>
-                     <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.TopicSelectorExample2</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>topic-selector2</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>


[34/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/last-value-queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/last-value-queue/readme.html b/examples/broker-features/standard/last-value-queue/readme.html
deleted file mode 100644
index 1fb58ee..0000000
--- a/examples/broker-features/standard/last-value-queue/readme.html
+++ /dev/null
@@ -1,162 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Last-Value 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>Last-Value 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 configure and use last-value queues.</p>
-     <p>Last-Value queues are special queues which discard any messages when a newer message with the same value for a well-defined <em>Last-Value</em> property is put in the queue.
-         In other words, a Last-Value queue only retains the last value.</p>
-     <p>A typical example for Last-Value queue is for stock prices, where you are only interested by the latest value for a particular stock.</p>
-
-     <p>The example will send 3 messages with the same <em>Last-Value</em> property to a to a Last-Value queue.<br />
-        We will browse the queue and see that only the last message is in the queue, the first two messages have been discarded. <br />
-        We will then consume from the queue the <em>last</em> message.</p>
-
-     <h2>Example setup</h2>
-     <p>Last-Value queues are defined in the configuration file <a href="server0/broker.xml">broker.xml</a>:</p>
-     <pre class="prettyprint">
-         <code>&lt;address-setting match="jms.queue.lastValueQueue"&gt;
-                &lt;last-value-queue&gt;true&lt;/last-value-queue&gt;
-         &lt;/address-setting&gt;</code>
-     </pre>
-
-     <h2>Example step-by-step</h2>
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <a href="server0/client-jndi.properties">client-jndi.properties</a></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/lastValueQueue");</code>
-        </pre>
-
-        <li>We look up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection, a session and a producer for the queue</li>
-        <pre class="prettyprint">
-           <code> connection = cf.createConnection();
-            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            MessageProducer producer = session.createProducer(queue);</code>
-       </pre>
-
-       <li>We will create and send a text message with the Last-Value property set to <code>STOCK_NAME</code></li>
-       <pre class="prettyprint">
-           <code>TextMessage message = session.createTextMessage("1st message with Last-Value property set");
-           message.setStringProperty("_AMQ_LVQ_NAME", "STOCK_NAME");
-           producer.send(message);
-           System.out.format("Sent message: %s\n", message.getText());</code>
-       </pre>
-
-       <p><em>The <em>Last-Value</em> key is defined in ActiveMQ's MessageImpl class. Its value is <code>"_AMQ_LVQ_NAME"</code></em></p>
-
-       <li>We will create and send a <em>second</em> text message with the Last-Value property set to <code>STOCK_NAME</code></li>
-       <pre class="prettyprint">
-           <code>message = session.createTextMessage("2nd message with Last-Value property set");
-           message.setStringProperty("_AMQ_LVQ_NAME", "STOCK_NAME");
-           producer.send(message);
-           System.out.format("Sent message: %s\n", message.getText());</code>
-       </pre>
-
-       <li>We will create and send a <em>third</em> text message with the Last-Value property set to <code>STOCK_NAME</code></li>
-       <pre class="prettyprint">
-           <code>message = session.createTextMessage("3rd message with Last-Value property set");
-           message.setStringProperty("_AMQ_LVQ_NAME", "STOCK_NAME");
-           producer.send(message);
-           System.out.format("Sent message: %s\n", message.getText());</code>
-       </pre>
-
-       <p><em>When the 2<sup>nd</sup> message was sent to the queue, the 1<sup>st</sup> message was discarded.<br />
-           Similarly, when the 3<sup>rd</sup> message was sent to the queue, the 2<sup>nd</sup> message was discarded.<br />
-           Only the 3<sup>rd</sup> message remains in the queue.</em></p>
-
-        <li>We will browse the queue. There will be a single message displayed: the 3<sup>rd</sup> message</li>
-        <pre class="prettyprint">
-            <code>QueueBrowser browser = session.createBrowser(queue);
-            Enumeration enumeration = browser.getEnumeration();
-            while (enumeration.hasMoreElements())
-            {
-               TextMessage messageInTheQueue = (TextMessage)enumeration.nextElement();
-               System.out.format("Message in the queue: %s\n", messageInTheQueue.getText());
-            }
-            browser.close();
-            </code>
-        </pre>
-
-        <p><em>We will now consume the message on the queue</em></p>
-
-        <li>We create a JMS message consumer on the queue</li>
-        <pre class="prettyprint">
-            <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We try to receive a message from the queue. It will be the 3<sup>rd</sup> message</li>
-        <pre class="prettyprint">
-           <code> TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
-            System.out.format("Received message: %s\n", messageReceived.getText());</code>
-        </pre>
-
-        <li>We will try to receive another message but there is no other on the queue. The <code>receive</code> method will timeout after 5 seconds</li>
-        <pre class="prettyprint">
-           <code> messageReceived = (TextMessage)messageConsumer.receive(5000);
-           System.out.format("Received message: %s\n", messageReceived);</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>
-
-     <h2>More information</h2>
-
-     <ul>
-        <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#last-value-queues">Last-Value Queues chapter</a></li>
-     </ul>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/last-value-queue/src/main/java/org/apache/activemq/artemis/jms/example/LastValueQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/last-value-queue/src/main/java/org/apache/activemq/artemis/jms/example/LastValueQueueExample.java b/examples/broker-features/standard/last-value-queue/src/main/java/org/apache/activemq/artemis/jms/example/LastValueQueueExample.java
deleted file mode 100644
index 469f839..0000000
--- a/examples/broker-features/standard/last-value-queue/src/main/java/org/apache/activemq/artemis/jms/example/LastValueQueueExample.java
+++ /dev/null
@@ -1,104 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import java.util.Enumeration;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * This example shows how to configure and use a <em>Last-Value</em> queues.
- * Only the last message with a well-defined property is hold by the queue.
- */
-public class LastValueQueueExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection connection = null;
-      try {
-         // Step 2. new Queue
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         // Step 3. new Connection Factory
-         ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
-
-         // Step 4.Create a JMS Connection, session and producer on the queue
-         connection = cf.createConnection();
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageProducer producer = session.createProducer(queue);
-
-         // Step 5. Create and send a text message with the Last-Value header set
-         TextMessage message = session.createTextMessage("1st message with Last-Value property set");
-         message.setStringProperty("_AMQ_LVQ_NAME", "STOCK_NAME");
-         producer.send(message);
-         System.out.format("Sent message: %s%n", message.getText());
-
-         // Step 6. Create and send a second text message with the Last-Value header set
-         message = session.createTextMessage("2nd message with Last-Value property set");
-         message.setStringProperty("_AMQ_LVQ_NAME", "STOCK_NAME");
-         producer.send(message);
-         System.out.format("Sent message: %s%n", message.getText());
-
-         // Step 7. Create and send a third text message with the Last-Value header set
-         message = session.createTextMessage("3rd message with Last-Value property set");
-         message.setStringProperty("_AMQ_LVQ_NAME", "STOCK_NAME");
-         producer.send(message);
-         System.out.format("Sent message: %s%n", message.getText());
-
-         // Step 8. Browse the queue. There is only 1 message in it, the last sent
-         QueueBrowser browser = session.createBrowser(queue);
-         Enumeration enumeration = browser.getEnumeration();
-         while (enumeration.hasMoreElements()) {
-            TextMessage messageInTheQueue = (TextMessage) enumeration.nextElement();
-            System.out.format("Message in the queue: %s%n", messageInTheQueue.getText());
-         }
-         browser.close();
-
-         // Step 9. Create a JMS Message Consumer for the queue
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-
-         // Step 10. Start the Connection
-         connection.start();
-
-         // Step 11. Trying to receive a message. Since the queue is configured to keep only the
-         // last message with the Last-Value header set, the message received is the last sent
-         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-         System.out.format("Received message: %s%n", messageReceived.getText());
-
-         // Step 12. Trying to receive another message but there will be none.
-         // The 1st message was discarded when the 2nd was sent to the queue.
-         // The 2nd message was in turn discarded when the 3trd was sent to the queue
-         messageReceived = (TextMessage) messageConsumer.receive(5000);
-         System.out.format("Received message: %s%n", messageReceived);
-
-         cf.close();
-      }
-      finally {
-         // Step 13. Be sure to close our JMS resources!
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 470de98..0000000
--- a/examples/broker-features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?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.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</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-settings>
-
-      <address-settings>
-         <!--override the expiry address for the example-->
-         <address-setting match="jms.queue.lastValueQueue">
-            <last-value-queue>true</last-value-queue>
-         </address-setting>
-      </address-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/last-value-queue/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/last-value-queue/src/main/resources/jndi.properties b/examples/broker-features/standard/last-value-queue/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/last-value-queue/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/management-notifications/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/management-notifications/pom.xml b/examples/broker-features/standard/management-notifications/pom.xml
deleted file mode 100644
index bade921..0000000
--- a/examples/broker-features/standard/management-notifications/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>management-notifications</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Management Notifications 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>
-                     <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.ManagementNotificationExample</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>management-notifications</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/management-notifications/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/management-notifications/readme.html b/examples/broker-features/standard/management-notifications/readme.html
deleted file mode 100644
index 6ac1efa..0000000
--- a/examples/broker-features/standard/management-notifications/readme.html
+++ /dev/null
@@ -1,215 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Management Notification 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>Management Notification 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 how to receive management notifications from ActiveMQ Artemis using JMS Messages.</p>
-     <p>ActiveMQ Artemis servers emit management notifications when events of interest occur (consumers are created or closed,
-         destinations are created or deleted, security authentication fails, etc.).<br />
-         These notifications can be received either by using JMX (see <a href="../jmx/readme.html">JMX example</a>) or by receiving JMS Messages
-         from a well-known destination.</p>
-     <p>This example will setup a JMS MessageListener to receive management notifications. We will also perform normal JMS operations to see the kind
-         of notifications they trigger.</p>
-
-     <h2>Example configuration</h2>
-
-     <p>ActiveMQ Artemis can configured to send JMS messages when management notifications are emitted on the server.</p>
-     <p>By default, the management name is called <code>activemq.notifications</code> but this can be configured in <a href="server0/broker.xml">broker.xml</a>.
-        For this example, we will set it to <code>jms.topic.notificationsTopic</code> to be able to receive notifications from a JMS Topic.</p>
-      <pre class="prettyprint">
-         <code>&lt;management-notification-address&gt;jms.topic.notificationsTopic&lt;/management-notification-address&gt;</code>
-     </pre>
-
-     <p>Since we want to lookup the notifications topic using JNDI, we also declare it in  <a href="server0/activemq-jms.xml">activemq-jms.xml</a>
-     <pre class="prettyprint">
-         <code>&lt;topic name="notificationsTopic"&gt;
-            &lt;entry name="/topic/notificationsTopic"/&gt;
-         &lt;/topic&gt;</code>
-     </pre>
-     <p>The notification queue requires permission to create/delete temporary queues and consume messages.
-         This is also configured in <a href="server0/broker.xml">broker.xml</a></p>
-     <pre class="prettyprint">
-         <code><!--security for notification topic-->
-         &lt;security-setting match="jms.topic.notificationsTopic"&gt;
-            &lt;permission type="consume" roles="guest"/&gt;
-            &lt;permission type="createNonDurableQueue" roles="guest"/&gt;
-            &lt;permission type="deleteNonDurableQueue" roles="guest"/&gt;
-         &lt;/security-setting&gt;</code>
-     </pre>
-
-     <h2>Example step-by-step</h2>
-x     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get its properties from <a href="server0/client-jndi.properties">client-jndi.properties</a></li>
-        <pre class="prettyprint">
-            <code>InitialContext initialContext = getContext(0);</code>
-        </pre>
-
-        <li>We look up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-            <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-            <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection, a session and a message producer for the example queue</li>
-        <pre class="prettyprint">
-            <code>connection = cf.createConnection();
-            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            MessageProducer producer = session.createProducer(queue);</code>
-        </pre>
-
-        <li>We look up the JMS Topic used to receive the notifications from JNDI</li>
-        <pre class="prettyprint">
-            <code>Topic notificationsTopic = (Topic) initialContext.lookup("/topic/notificationsTopic");</code>
-        </pre>
-
-        <li>We create a MessageConsumer for the notification queue and set its MessageListener. When a notification is received, we will simply display all the message properties</li>
-        <pre class="prettyprint">
-           <code>MessageConsumer notificationConsumer = session.createConsumer(notificationsTopic);
-           notificationConsumer.setMessageListener(new MessageListener()
-           {
-              public void onMessage(Message notif)
-              {
-                 System.out.println("------------------------");
-                 System.out.println("Received notification:");
-                 try
-                 {
-                    Enumeration propertyNames = notif.getPropertyNames();
-                    while (propertyNames.hasMoreElements())
-                    {
-                       String propertyName = (String)propertyNames.nextElement();
-                       System.out.format("  %s: %s\n", propertyName, notif.getObjectProperty(propertyName));
-                    }
-                 }
-                 catch (JMSException e)
-                 {
-                 }
-                 System.out.println("------------------------");
-              }
-           });</code>
-        </pre>
-
-        <li>We start the connection to receive messages</li>
-        <pre class="prettyprint">
-            <code>connection.start();</code>
-        </pre>
-
-        <p><em>Now that a message listener is setup to receive management notifications, we will perform regular JMS operations to
-            see what kind of notifications are triggered</em></p>
-
-        <li>We create a JMS message consumer on the example queue</li>
-        <pre class="prettyprint">
-            <code>MessageConsumer consumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <p>This will generate a <code>CONSUMER_CREATED</code> notification:
-        <pre class="prettyprint">
-            <code>------------------------
-            Received notification:
-              _AMQ_RoutingName: jms.queue.exampleQueue
-              _AMQ_Address: jms.queue.exampleQueue
-              ...
-              _AMQ_ConsumerCount: 1
-              ...
-              _AMQ_NotifType: CONSUMER_CREATED
-            ------------------------</code>
-        </pre>
-        <p>The notification tells us that a consumer was created for the JMS queue <code>exampleQueue</code>. When the notification
-            was emitted, this consumer was the only one for the queue</p>
-
-        <li>We close this consumer</li>
-        <pre class="prettyprint">
-            <code>consumer.close();</code>
-        </pre>
-
-        <p>This will generate a <code>CONSUMER_CLOSED</code> notification:
-        <pre class="prettyprint">
-            <code>------------------------
-            Received notification:
-              _AMQ_RoutingName: jms.queue.exampleQueue
-              _AMQ_Address: jms.queue.exampleQueue
-              ...
-              _AMQ_ConsumerCount: 0
-              ...
-              _AMQ_NotifType: CONSUMER_CLOSED
-            ------------------------</code>
-        </pre>
-        <p>The notification tells us that a consumer was closed for the JMS queue <code>exampleQueue</code>. When the notification
-            was emitted, there were no other consumers on the queue</p>
-
-        <li>As a last example, we will create a connection with invalid user credentials</li>
-        <pre class="prettyprint">
-            <code>try
-            {
-               cf.createConnection("not.a.valid.user", "not.a.valid.password");
-            } catch (JMSException e)
-            {
-            }</code>
-        </pre>
-
-        <p>This will generate a <code>SECURITY_AUTHENTICATION_VIOLATION</code> notification:
-        <pre class="prettyprint">
-            <code>------------------------
-            Received notification:
-              _AMQ_User: not.a.valid.user
-              ...
-              _AMQ_NotifType: SECURITY_AUTHENTICATION_VIOLATION
-            ------------------------
-            </code>
-        </pre>
-        <p>The notification tells us that a user named <code>not.a.valid.user</code> failed to authenticate when creating a connection to ActiveMQ Artemis.</p>
-
-        <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>
-
-     <h2>More information</h2>
-
-     <ul>
-         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.notifications">Management Notifications chapter</a></li>
-     </ul>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/management-notifications/src/main/java/org/apache/activemq/artemis/jms/example/ManagementNotificationExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/management-notifications/src/main/java/org/apache/activemq/artemis/jms/example/ManagementNotificationExample.java b/examples/broker-features/standard/management-notifications/src/main/java/org/apache/activemq/artemis/jms/example/ManagementNotificationExample.java
deleted file mode 100644
index 5fc00cf..0000000
--- a/examples/broker-features/standard/management-notifications/src/main/java/org/apache/activemq/artemis/jms/example/ManagementNotificationExample.java
+++ /dev/null
@@ -1,109 +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.Enumeration;
-
-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.Topic;
-import javax.naming.InitialContext;
-
-/**
- * An example that shows how to receive management notifications using JMS messages.
- */
-public class ManagementNotificationExample {
-
-   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, a session and a producer for the queue
-         connection = cf.createConnection();
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageProducer producer = session.createProducer(queue);
-
-         // Step 5. Perform a lookup on the notifications topic
-         Topic notificationsTopic = (Topic) initialContext.lookup("topic/notificationsTopic");
-
-         // Step 6. Create a JMS message consumer for the notification queue and set its message listener
-         // It will display all the properties of the JMS Message
-         MessageConsumer notificationConsumer = session.createConsumer(notificationsTopic);
-         notificationConsumer.setMessageListener(new MessageListener() {
-            public void onMessage(final Message notif) {
-               System.out.println("------------------------");
-               System.out.println("Received notification:");
-               try {
-                  Enumeration propertyNames = notif.getPropertyNames();
-                  while (propertyNames.hasMoreElements()) {
-                     String propertyName = (String) propertyNames.nextElement();
-                     System.out.format("  %s: %s%n", propertyName, notif.getObjectProperty(propertyName));
-                  }
-               }
-               catch (JMSException e) {
-               }
-               System.out.println("------------------------");
-            }
-         });
-
-         // Step 7. Start the Connection to allow the consumers to receive messages
-         connection.start();
-
-         // Step 8. Create a JMS Message Consumer on the queue
-         MessageConsumer consumer = session.createConsumer(queue);
-
-         // Step 9. Close the consumer
-         consumer.close();
-
-         // Step 10. Try to create a connection with unknown user
-         try {
-            cf.createConnection("not.a.valid.user", "not.a.valid.password");
-         }
-         catch (JMSException e) {
-         }
-
-         // sleep a little bit to be sure to receive the notification for the security
-         // authentication violation before leaving the example
-         Thread.sleep(2000);
-      }
-      finally {
-         // Step 11. Be sure to close the resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 2c97901..0000000
--- a/examples/broker-features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?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 ../../../../src/schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-
-      <!--the notifications topic used by the example-->
-      <topic name="notificationsTopic"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-
-      <management-notification-address>jms.topic.notificationsTopic</management-notification-address>
-
-      <!-- Netty standard TCP acceptor -->
-      <acceptors>
-         <acceptor name="netty">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!--  Other configs -->
-
-      <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 for notification queue-->
-         <security-setting match="jms.topic.notificationsTopic">
-            <permission type="consume" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-         </security-setting>
-
-         <!-- security settings for JMS temporary queue -->
-         <security-setting match="queuetempjms.*">
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/management-notifications/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/management-notifications/src/main/resources/jndi.properties b/examples/broker-features/standard/management-notifications/src/main/resources/jndi.properties
deleted file mode 100644
index 2582245..0000000
--- a/examples/broker-features/standard/management-notifications/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,21 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-queue.queue/exampleQueue=exampleQueue
-topic.topic/notificationsTopic=notificationsTopic

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/management/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/management/pom.xml b/examples/broker-features/standard/management/pom.xml
deleted file mode 100644
index cd006e5..0000000
--- a/examples/broker-features/standard/management/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>management</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Management 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>
-                     <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.ManagementExample</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>management</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/management/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/management/readme.html b/examples/broker-features/standard/management/readme.html
deleted file mode 100644
index 30057ba..0000000
--- a/examples/broker-features/standard/management/readme.html
+++ /dev/null
@@ -1,208 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Management 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>Management Example</h1>
-     <p>This example shows how to manage ActiveMQ Artemis using JMS Messages to invoke management operations on the server.</a></p>
-     <p>To manage ActiveMQ Artemis using JMX, see the <a href="../jmx/readme.html">JMX</a> example.</p>
-
-     <h2>Example configuration</h2>
-
-     <p>ActiveMQ Artemis can be managed by sending JMS messages with specific properties to its <em>management</em> queue.</p>
-     </p>By default, the management name is called <code>activemq.management</code> but this can be configured in <a href="server0/broker.xml">broker.xml</a>
-     <pre class="prettyprint">
-         <code>&lt;management-address&gt;activemq.management&lt;/management-address&gt;</code>
-     </pre>
-
-     <p>The management queue requires a "special" user permission <code>manage</code> to be able to receive management messages.
-         This is also configured in <a href="server0/broker.xml">broker.xml</a></p>
-     <pre class="prettyprint">
-         <code>&lt;security-setting match="activemq.management"&gt;
-            &lt;permission type="manage" roles="guest" /&gt;
-         &lt;/security-setting&gt;</code>
-     </pre>
-
-     <h2>Example step-by-step</h2>
-     <p><em>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</em></p>
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get its properties from <a href="server0/client-jndi.properties">client-jndi.properties</a></li>
-        <pre class="prettyprint">
-            <code>InitialContext initialContext = getContext(0);</code>
-        </pre>
-
-        <li>We look up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-            <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-            <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-            <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-            <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-            <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create a JMS text message that we are going to send.</li>
-        <pre class="prettyprint">
-            <code>TextMessage message = session.createTextMessage("This is a text message");</code>
-        </pre>
-
-        <li>We send message to the queue</li>
-        <pre class="prettyprint">
-            <code>messageProducer.send(message);</code>
-        </pre>
-
-        <p><em>Now that we have a message in the queue, we will manage the queue by retrieving the number of messages in the queue
-            (i.e. 1) and by removing the message which has been sent in step 8.</em></p>
-
-        <li>We create the JMS management queue. This is a <em>special</em> queue which is not looked up from JNDI but instantiated directly</li>
-        <pre class="prettyprint">
-            <code>Queue managementQueue = new ActiveMQQueue("activemq.management", "activemq.management");</code>
-        </pre>
-
-        <li>We create a <code>QueueRequestor</code> to send messages to the management queue and receive replies (see <a href="../queue-requestor/readme.html">queue-requestor example</a>)</li>
-        <pre class="prettyprint">
-            <code>QueueRequestor requestor = new QueueRequestor(session, managementQueue);</code>
-        </pre>
-
-        <li>We start the connection to receive replies on the requestor</li>
-        <pre class="prettyprint">
-           <code>connection.start()</code>
-        </pre>
-
-        <li>We create a JMS message which will be used as a <em>management</em> message</li>
-        <pre class="prettyprint">
-            <code>Message m = session.createMessage();</code>
-        </pre>
-
-        <li>a <em>management</em> message has well-defined properties that ActiveMQ Artemis server needs to know to perform management operations.<br />
-            We use a helper class <code>JMSManagementHelper</code> to fill these properties:
-            <ul>
-                <li>The name of the resource to manage <code>jms.queue.exampleQueue</code>
-                    (i.e. <code>jms.queue</code> followed by the name of the queue as defined in <a href="server0/activemq-jms.xml">activemq-jms.xml</a>)</li>
-                <li>In our case, the name of the attribute to retrieve <code>MessageCount</code></li>
-            </ul>
-        </li>
-        <pre class="prettyprint">
-            <code>JMSManagementHelper.putAttribute(m, "jms.queue.exampleQueue", "MessageCount");</code>
-        </pre>
-
-        <li>We send the <em>management</em> message using the requestor and wait for a reply</li>
-        <pre class="prettyprint">
-            <code>Message reply = requestor.request(m);</code>
-        </pre>
-
-        <li>We use a helper class <code>JMSManagementHelper</code> to retrieve the result from the reply message:
-        <pre class="prettyprint">
-            <code>int messageCount = (Integer)JMSManagementHelper.getResult(reply);
-            System.out.println(queue.getQueueName() + " contains " + messageCount + " messages");</code>
-        </pre>
-
-        <li>We create another JMS message to use as a management message</li>
-        <pre class="prettyprint">
-            <code>m = session.createMessage();</code>
-        </pre>
-
-        <li>This time, we fill the <em>management</em> message with properties to <em>invoke</em> a management operation on the queue
-            <ul>
-                <li>the name of the resource <code>jms.queue.exampleQueue</code></li>
-                <li>the name of the management operation <code>removeMessage</code></li>
-                <li>any parameters required to invoke the management operations (in our case, the JMS Message ID of the message sent in step 8)</li>
-            </ul>
-        </li>
-        <pre class="prettyprint">
-            <code>JMSManagementHelper.putOperationInvocation(m, "jms.queue.exampleQueue", "removeMessage", message.getJMSMessageID());</code>
-        </pre>
-
-        <li>Again, we use the requestor to send the management message and wait for a reply</li>
-        <pre class="prettyprint">
-            <code>reply = requestor.request(m);</code>
-        </pre>
-
-        <li>We use the helper class to check that the operation was successfully invoked on the server</li>
-        <pre class="prettyprint">
-            <code>boolean success = JMSManagementHelper.hasOperationSucceeded(reply);
-            System.out.println("operation invocation has succeeded: " + success);</code>
-        </pre>
-
-        <li>We use a helper class <code>JMSManagementHelper</code> to retrieve the result from the reply message:
-            (in our case, the <code>removeMessage</code> method returns a boolean)</li>
-        <pre class="prettyprint">
-            <code>boolean messageRemoved = (Boolean)JMSManagementHelper.getResult(reply);
-            System.out.println("message has been removed: " + messageRemoved);</code>
-        </pre>
-
-        <p><em>We will now consume the message from the queue but there will be none: the message sent at step 8 was removed by the management operation</em></p>
-
-        <li>We create a JMS message consumer on the queue</li>
-        <pre class="prettyprint">
-            <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We try to receive a message from the queue. Since there is none, the call will timeout after 5000ms and messageReceived will be null
-        </li>
-        <pre class="prettyprint">
-            <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-            System.out.println("Received message: " + messageReceived);</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>
-
-     <h2>More information</h2>
-
-     <ul>
-        <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.jms">Using Management Via JMS chapter</a></li>
-     </ul>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java b/examples/broker-features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java
deleted file mode 100644
index 8c780c3..0000000
--- a/examples/broker-features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java
+++ /dev/null
@@ -1,133 +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.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueRequestor;
-import javax.jms.QueueSession;
-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;
-
-/**
- * An example that shows how to manage ActiveMQ Artemis using JMS messages.
- */
-public class ManagementExample {
-
-   public static void main(final String[] args) throws Exception {
-      QueueConnection 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
-         QueueConnectionFactory cf = (QueueConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 4.Create a JMS Connection
-         connection = cf.createQueueConnection();
-
-         // Step 5. Create a JMS Session
-         QueueSession session = connection.createQueueSession(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 the JMS management queue.
-         // It is a "special" queue and it is not looked up from JNDI but constructed directly
-         Queue managementQueue = ActiveMQJMSClient.createQueue("activemq.management");
-
-         // Step 10. Create a QueueRequestor for the management queue (see queue-requestor example)
-         QueueRequestor requestor = new QueueRequestor(session, managementQueue);
-
-         // Step 11. Start the Connection to allow the queue requestor to receive replies
-         connection.start();
-
-         // Step 12. Create a JMS message which is used to send a management message
-         Message m = session.createMessage();
-
-         // Step 13. Use a helper class to fill the JMS message with management information:
-         // * the name of the resource to manage
-         // * in this case, we want to retrieve the value of the messageCount of the queue
-         JMSManagementHelper.putAttribute(m, "jms.queue.exampleQueue", "messageCount");
-
-         // Step 14. Use the requestor to send the request and wait for the reply
-         Message reply = requestor.request(m);
-
-         // Step 15. Use a helper class to retrieve the operation result
-         int messageCount = (Integer) JMSManagementHelper.getResult(reply);
-         System.out.println(queue.getQueueName() + " contains " + messageCount + " messages");
-
-         // Step 16. Create another JMS message to use as a management message
-         m = session.createMessage();
-
-         // Step 17. Use a helper class to fill the JMS message with management information:
-         // * the object name of the resource to manage (i.e. the queue)
-         // * in this case, we want to call the "removeMessage" operation with the JMS MessageID
-         // of the message sent to the queue in step 8.
-         JMSManagementHelper.putOperationInvocation(m, "jms.queue.exampleQueue", "removeMessage", message.getJMSMessageID());
-
-         // Step 18 Use the requestor to send the request and wait for the reply
-         reply = requestor.request(m);
-
-         // Step 19. Use a helper class to check that the operation has succeeded
-         boolean success = JMSManagementHelper.hasOperationSucceeded(reply);
-         System.out.println("operation invocation has succeeded: " + success);
-
-         // Step 20. Use a helper class to retrieve the operation result
-         // in that case, a boolean which is true if the message was removed, false else
-         boolean messageRemoved = (Boolean) JMSManagementHelper.getResult(reply);
-         System.out.println("message has been removed: " + messageRemoved);
-
-         // Step 21. Create a JMS Message Consumer on the queue
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-
-         // Step 22. Trying to receive a message. Since the only message in the queue was removed by a management
-         // operation,
-         // there is none to consume. The call will timeout after 5000ms and messageReceived will be null
-         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-         System.out.println("Received message: " + messageReceived);
-      }
-      finally {
-         // Step 23. Be sure to close the resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/management/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/management/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/management/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 36eec30..0000000
--- a/examples/broker-features/standard/management/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?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.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-
-      <management-address>jms.queue.activemq.management</management-address>
-
-      <!-- Netty standard TCP acceptor -->
-      <acceptors>
-         <acceptor name="netty">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <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 for management queue-->
-         <security-setting match="jms.queue.activemq.management">
-            <permission type="manage" roles="guest"/>
-         </security-setting>
-
-         <!-- security settings for JMS temporary queue -->
-         <security-setting match="jms.tempqueue.#">
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/management/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/management/src/main/resources/jndi.properties b/examples/broker-features/standard/management/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/management/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/message-counters/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-counters/pom.xml b/examples/broker-features/standard/message-counters/pom.xml
deleted file mode 100644
index e2db0ac..0000000
--- a/examples/broker-features/standard/message-counters/pom.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?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>message-counters</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Message Counter Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <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>
-   </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>
-                     <javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3001 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
-                     </javaOptions>
-                  </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.MessageCounterExample</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>message-counters</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>


[43/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/colocated-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/colocated-failover/readme.html b/examples/broker-features/ha/colocated-failover/readme.html
deleted file mode 100644
index a3700d4..0000000
--- a/examples/broker-features/ha/colocated-failover/readme.html
+++ /dev/null
@@ -1,56 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Colocated Failover 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 Colocated Failover Shared Store Example</h1>
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory. This example will always spawn and stop multiple servers.</pre>
-
-     <p>This example demonstrates how you can colocate live and backup servers in the same VM. We do this by creating an
-     HA Policy that is colocated. colocated means that backup servers can be created and maintained by live servers on behalf
-     of other requesting live servers. In this example we create a colocated shared store server.
-     <p>This example starts 2 live servers each with a backup server that backs up the other live server.</p>
-     <p>The first live server will be killed and the backup in the second will become live</p>
-     <p>The following shows how to configure the live servers to request and allow backups to be deployed</p>
-     <pre class="prettyprint">
-     <code>&lt;ha-policy>
-         &lt;shared-store>
-             &lt;colocated>
-                 &lt;backup-port-offset>100&lt;/backup-port-offset>
-                 &lt;backup-request-retries>-1&lt;/backup-request-retries>
-                 &lt;backup-request-retry-interval>2000&lt;/backup-request-retry-interval>
-                 &lt;max-backups>1&lt;/max-backups>
-                 &lt;request-backup>true&lt;/request-backup>
-                 &lt;master/>
-                 &lt;slave/>
-             &lt;/colocated>
-         &lt;/shared-store>
-     &lt;/ha-policy>
-     </code>
-     </pre>
-     <p>notice that we have used a template to set some sensible defaults but overridden the backup strategy so back ups
-     are full servers</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java b/examples/broker-features/ha/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java
deleted file mode 100644
index 3e0d07e..0000000
--- a/examples/broker-features/ha/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java
+++ /dev/null
@@ -1,147 +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 org.apache.activemq.artemis.util.ServerUtil;
-
-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;
-import java.util.Hashtable;
-
-/**
- * A simple example that demonstrates a colocated server
- */
-public class ColocatedFailoverExample {
-
-   private static Process server0;
-
-   private static Process server1;
-
-   public static void main(final String[] args) throws Exception {
-      final int numMessages = 30;
-
-      Connection connection = null;
-      Connection connection1 = null;
-
-      InitialContext initialContext = null;
-      InitialContext initialContext1 = null;
-
-      try {
-         server0 = ServerUtil.startServer(args[0], ColocatedFailoverExample.class.getSimpleName() + "0", 0, 5000);
-         server1 = ServerUtil.startServer(args[1], ColocatedFailoverExample.class.getSimpleName() + "1", 1, 5000);
-
-         // Step 1. Get an initial context for looking up JNDI for both servers
-         Hashtable<String, Object> properties = new Hashtable<String, Object>();
-         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
-         properties.put("queue.queue/exampleQueue", "exampleQueue");
-         initialContext = new InitialContext(properties);
-
-         properties = new Hashtable<String, Object>();
-         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
-         initialContext1 = new InitialContext(properties);
-
-         // Step 2. Look up the JMS resources from JNDI
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-         ConnectionFactory connectionFactory1 = (ConnectionFactory) initialContext1.lookup("ConnectionFactory");
-
-         // Step 3. Create a JMS Connections
-         connection = connectionFactory.createConnection();
-         connection1 = connectionFactory1.createConnection();
-
-         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 5. Create a JMS MessageProducers
-         MessageProducer producer = session.createProducer(queue);
-         MessageProducer producer1 = session1.createProducer(queue);
-
-         // Step 6. Send some messages to both servers
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session.createTextMessage("This is text message " + i);
-            producer.send(message);
-            System.out.println("Sent message: " + message.getText());
-            message = session1.createTextMessage("This is another text message " + i);
-            producer1.send(message);
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 7. Crash server #0, the live server, and wait a little while to make sure
-         // it has really crashed
-         ServerUtil.killServer(server0);
-         Thread.sleep(10000);
-
-         // Step 8. start the connection ready to receive messages
-         connection.start();
-         connection1.start();
-
-         // Step 9.create a consumer
-         MessageConsumer consumer = session1.createConsumer(queue);
-
-         // Step 10. Receive and acknowledge all of the sent messages, the backup server that is colocated with server 1
-         // will have become live and is now handling messages for server 0.
-         TextMessage message0 = null;
-         for (int i = 0; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            if (message0 == null) {
-               throw new IllegalStateException("Message not received!");
-            }
-            System.out.println("Got message: " + message0.getText());
-         }
-         message0.acknowledge();
-
-         MessageConsumer consumer1 = session.createConsumer(queue);
-
-         // Step 11. Receive and acknowledge the rest of the sent messages from server 1.
-         for (int i = 0; i < numMessages; i++) {
-            message0 = (TextMessage) consumer1.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-         message0.acknowledge();
-      }
-      finally {
-         // Step 11. Be sure to close our resources!
-
-         if (connection != null) {
-            connection.close();
-         }
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection1 != null) {
-            connection1.close();
-         }
-
-         if (initialContext1 != null) {
-            initialContext1.close();
-         }
-
-         ServerUtil.killServer(server0);
-         ServerUtil.killServer(server1);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/colocated-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/colocated-failover/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/ha/colocated-failover/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 0a4103f..0000000
--- a/examples/broker-features/ha/colocated-failover/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,115 +0,0 @@
-<?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.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- a colocated server that will allow shared store full backups to be requested-->
-      <ha-policy>
-         <shared-store>
-            <colocated>
-               <backup-port-offset>100</backup-port-offset>
-               <backup-request-retries>-1</backup-request-retries>
-               <backup-request-retry-interval>2000</backup-request-retry-interval>
-               <max-backups>1</max-backups>
-               <request-backup>true</request-backup>
-               <master>
-                  <failover-on-shutdown>true</failover-on-shutdown>
-               </master>
-               <slave>
-                  <failover-on-shutdown>true</failover-on-shutdown>
-               </slave>
-            </colocated>
-         </shared-store>
-      </ha-policy>
-
-      <!-- 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-settings>
-
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/colocated-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/colocated-failover/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/ha/colocated-failover/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 8083f27..0000000
--- a/examples/broker-features/ha/colocated-failover/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-<?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.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- a colocated server that will allow shared store full backups to be requested-->
-      <ha-policy>
-         <shared-store>
-            <colocated>
-               <backup-port-offset>100</backup-port-offset>
-               <backup-request-retries>-1</backup-request-retries>
-               <backup-request-retry-interval>2000</backup-request-retry-interval>
-               <max-backups>1</max-backups>
-               <request-backup>true</request-backup>
-               <master>
-                  <failover-on-shutdown>true</failover-on-shutdown>
-               </master>
-               <slave>
-                  <failover-on-shutdown>true</failover-on-shutdown>
-               </slave>
-            </colocated>
-         </shared-store>
-      </ha-policy>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/ha-policy-autobackup/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/ha-policy-autobackup/pom.xml b/examples/broker-features/ha/ha-policy-autobackup/pom.xml
deleted file mode 100644
index 9322e2a..0000000
--- a/examples/broker-features/ha/ha-policy-autobackup/pom.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>ha-policy-autobackup</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS HA Policy Auto backup example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create2</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.HAPolicyAutoBackupExample</clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                        <param>${basedir}/target/server1</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>ha-policy-autobackup</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java b/examples/broker-features/ha/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java
deleted file mode 100644
index 0df8bfd..0000000
--- a/examples/broker-features/ha/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java
+++ /dev/null
@@ -1,155 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.core.client.ClusterTopologyListener;
-import org.apache.activemq.artemis.api.core.client.TopologyMember;
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-import org.apache.activemq.artemis.util.ServerUtil;
-
-/**
- * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
- * nodes of the cluster.
- */
-public class HAPolicyAutoBackupExample {
-
-   private static Process server0;
-
-   private static Process server1;
-
-   public static void main(final String[] args) throws Exception {
-      Connection connection0 = null;
-
-      Connection connection1 = null;
-
-      try {
-         server0 = ServerUtil.startServer(args[0], HAPolicyAutoBackupExample.class.getSimpleName() + "0", 0, 5000);
-         server1 = ServerUtil.startServer(args[1], HAPolicyAutoBackupExample.class.getSimpleName() + "1", 1, 5000);
-
-         // Step 2. Look-up the JMS Queue object from JNDI
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         // Step 3. new connection factories towards server 0 and 1
-         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
-         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
-
-         // Step 6. We create JMS Connections to server 0 and 1
-         connection0 = cf0.createConnection();
-         connection1 = cf1.createConnection();
-
-         // step 7. wait for the backups to start replication
-         waitForBackups(cf0, 2);
-
-         // Step 8. We create JMS Sessions on server 0 and 1
-         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 9. We start the connections to ensure delivery occurs on them
-         connection0.start();
-         connection1.start();
-
-         // Step 10. We create JMS MessageConsumer objects on server 0 and server 1
-         MessageConsumer consumer0 = session0.createConsumer(queue);
-         MessageConsumer consumer1 = session1.createConsumer(queue);
-
-         // Step 11. We create a JMS MessageProducer object on server 0
-         MessageProducer producer = session0.createProducer(queue);
-
-         // Step 12. We send some messages to server 0
-
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session0.createTextMessage("This is text message " + i);
-
-            producer.send(message);
-
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 13. We now consume half the messages on consumer0
-         // note that the other half of the messages will have been sent to server1 for consumer1
-         for (int i = 0; i < numMessages / 2; i++) {
-            TextMessage message0 = (TextMessage) consumer0.receive(5000);
-
-            System.out.println("Got message: " + message0.getText() + " from node 0");
-         }
-
-         // Step 14.close the consumer so it doesnt get any messages
-         consumer1.close();
-
-         // Step 15.now kill server1, messages will be scaled down to server0
-         ServerUtil.killServer(server1);
-         Thread.sleep(5000);
-
-         // Step 16. we now receive the messages that were on server1 but were scaled down to server0
-         for (int i = 0; i < numMessages / 2; i++) {
-            TextMessage message0 = (TextMessage) consumer0.receive(5000);
-
-            System.out.println("Got message: " + message0.getText() + " from node 1");
-         }
-      }
-      finally {
-         // Step 17. Be sure to close our resources!
-
-         if (connection0 != null) {
-            connection0.close();
-         }
-
-         if (connection1 != null) {
-            connection1.close();
-         }
-
-         ServerUtil.killServer(server0);
-         ServerUtil.killServer(server1);
-      }
-   }
-
-   private static void waitForBackups(ConnectionFactory cf0, int backups) throws InterruptedException {
-      final CountDownLatch latch = new CountDownLatch(backups);
-      ((ActiveMQConnectionFactory) cf0).getServerLocator().addClusterTopologyListener(new ClusterTopologyListener() {
-         List<TransportConfiguration> backups = new ArrayList<TransportConfiguration>();
-
-         @Override
-         public void nodeUP(TopologyMember member, boolean last) {
-            if (member.getBackup() != null && !backups.contains(member.getBackup())) {
-               backups.add(member.getBackup());
-               latch.countDown();
-            }
-         }
-
-         @Override
-         public void nodeDown(long eventUID, String nodeID) {
-         }
-      });
-      latch.await(30000, TimeUnit.MILLISECONDS);
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/ha/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index db98aa0..0000000
--- a/examples/broker-features/ha/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?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.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="invm-connector">vm://0</connector>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-         <!-- connector to the server1 -->
-         <connector name="server1-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="invm-acceptor">vm://0</acceptor>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- HA configuration -->
-      <ha-policy>
-         <replication>
-            <colocated>
-               <max-backups>1</max-backups>
-               <request-backup>true</request-backup>
-               <backup-request-retry-interval>1000</backup-request-retry-interval>
-               <excludes>
-                  <connector-ref>invm-connector</connector-ref>
-                  <connector-ref>server1-connector</connector-ref>
-                  <connector-ref>netty-connector</connector-ref>
-               </excludes>
-               <master/>
-               <slave>
-                  <scale-down>
-                     <connectors>
-                        <connector-ref>invm-connector</connector-ref>
-                     </connectors>
-                  </scale-down>
-               </slave>
-            </colocated>
-         </replication>
-      </ha-policy>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <static-connectors>
-               <connector-ref>server1-connector</connector-ref>
-            </static-connectors>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="#">
-            <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"/>
-            <permission type="manage" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/ha/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 760ce0d..0000000
--- a/examples/broker-features/ha/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?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.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="invm-connector">vm://0</connector>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-         <!-- connector to the server0 -->
-         <connector name="server0-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="invm-acceptor">vm://0</acceptor>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- HA configuration -->
-      <ha-policy>
-         <replication>
-            <colocated>
-               <max-backups>1</max-backups>
-               <request-backup>true</request-backup>
-               <backup-request-retry-interval>1000</backup-request-retry-interval>
-               <excludes>
-                  <connector-ref>invm-connector</connector-ref>
-                  <connector-ref>server0-connector</connector-ref>
-                  <connector-ref>netty-connector</connector-ref>
-               </excludes>
-               <master/>
-               <slave>
-                  <scale-down>
-                     <connectors>
-                        <connector-ref>invm-connector</connector-ref>
-                     </connectors>
-                  </scale-down>
-               </slave>
-            </colocated>
-         </replication>
-      </ha-policy>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <static-connectors>
-               <connector-ref>server0-connector</connector-ref>
-            </static-connectors>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="#">
-            <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"/>
-            <permission type="manage" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/multiple-failover-failback/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/multiple-failover-failback/pom.xml b/examples/broker-features/ha/multiple-failover-failback/pom.xml
deleted file mode 100644
index fd04228..0000000
--- a/examples/broker-features/ha/multiple-failover-failback/pom.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>multiple-failover-failback</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Multiple Failover Failback Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
-   </dependencies>
-
-   <build>
-      <plugins>
-         <plugin>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-maven-plugin</artifactId>
-            <executions>
-               <execution>
-                  <id>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server0</instance>
-                     <sharedStore>true</sharedStore>
-                     <slave>false</slave>
-                     <dataFolder>../data</dataFolder>
-                     <failoverOnShutdown>true</failoverOnShutdown>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server1</instance>
-                     <sharedStore>true</sharedStore>
-                     <slave>true</slave>
-                     <dataFolder>../data</dataFolder>
-                     <failoverOnShutdown>true</failoverOnShutdown>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create2</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server2</instance>
-                     <sharedStore>true</sharedStore>
-                     <slave>true</slave>
-                     <dataFolder>../data</dataFolder>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.MultipleFailoverFailbackExample</clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                        <param>${basedir}/target/server1</param>
-                        <param>${basedir}/target/server2</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>multiple-failover-failback</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java b/examples/broker-features/ha/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java
deleted file mode 100644
index ab0baec..0000000
--- a/examples/broker-features/ha/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java
+++ /dev/null
@@ -1,142 +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 org.apache.activemq.artemis.util.ServerUtil;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-public class MultipleFailoverFailbackExample {
-
-   public static void main(final String[] args) throws Exception {
-      final int numMessages = 30;
-
-      Connection connection = null;
-
-      InitialContext initialContext = null;
-
-      Process[] servers = new Process[3];
-
-      try {
-         for (int i = 0; i < args.length; i++) {
-            servers[i] = ServerUtil.startServer(args[i], MultipleFailoverFailbackExample.class.getSimpleName() + i, i, 5000);
-         }
-
-         // Step 1. Get an initial context for looking up JNDI from the server #1
-         initialContext = new InitialContext();
-
-         // Step 2. Look up the JMS resources from JNDI
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 3. Create a JMS Connection
-         connection = connectionFactory.createConnection();
-
-         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
-         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
-         // Step 5. Start the connection to ensure delivery occurs
-         connection.start();
-
-         // Step 6. Create a JMS MessageProducer and a MessageConsumer
-         MessageProducer producer = session.createProducer(queue);
-         MessageConsumer consumer = session.createConsumer(queue);
-
-         // Step 7. Send some messages to server #1, the live server
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session.createTextMessage("This is text message " + i);
-            producer.send(message);
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 8. Receive and acknowledge a third of the sent messages
-         TextMessage message0 = null;
-         for (int i = 0; i < numMessages / 3; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-         message0.acknowledge();
-
-         // Step 9. Receive the rest third of the sent messages but *do not* acknowledge them yet
-         for (int i = numMessages / 3; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-
-         // Step 10. Crash server #1, the live server, and wait a little while to make sure
-         // it has really crashed
-         ServerUtil.killServer(servers[0]);
-
-         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
-         // backup server has occurred
-         try {
-            message0.acknowledge();
-         }
-         catch (JMSException e) {
-            System.err.println("Got exception while acknowledging message: " + e.getMessage());
-         }
-
-         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
-         for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
-         }
-         message0.acknowledge();
-
-         servers[0] = ServerUtil.startServer(args[0], MultipleFailoverFailbackExample.class.getSimpleName() + 0, 0, 5000);
-
-         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
-         // backup server has occurred
-         try {
-            message0.acknowledge();
-         }
-         catch (JMSException e) {
-            System.err.println("Got exception while acknowledging message: " + e.getMessage());
-         }
-
-         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
-         for (int i = (numMessages / 3) * 2; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
-         }
-         message0.acknowledge();
-      }
-      finally {
-         // Step 13. Be sure to close our resources!
-
-         if (connection != null) {
-            connection.close();
-         }
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-
-         for (int i = 0; i < args.length; i++) {
-            ServerUtil.killServer(servers[i]);
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/multiple-failover-failback/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/multiple-failover-failback/src/main/resources/jndi.properties b/examples/broker-features/ha/multiple-failover-failback/src/main/resources/jndi.properties
deleted file mode 100644
index 7f7a19f..0000000
--- a/examples/broker-features/ha/multiple-failover-failback/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/ha/multiple-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/multiple-failover/pom.xml b/examples/broker-features/ha/multiple-failover/pom.xml
deleted file mode 100644
index a9a0b03..0000000
--- a/examples/broker-features/ha/multiple-failover/pom.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>multiple-failover</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Multiple Failover Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
-   </dependencies>
-
-   <build>
-      <plugins>
-         <plugin>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-maven-plugin</artifactId>
-            <executions>
-               <execution>
-                  <id>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server0</instance>
-                     <sharedStore>true</sharedStore>
-                     <slave>false</slave>
-                     <dataFolder>../data</dataFolder>
-                     <failoverOnShutdown>true</failoverOnShutdown>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server1</instance>
-                     <sharedStore>true</sharedStore>
-                     <slave>true</slave>
-                     <dataFolder>../data</dataFolder>
-                     <failoverOnShutdown>true</failoverOnShutdown>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create2</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server2</instance>
-                     <sharedStore>true</sharedStore>
-                     <slave>true</slave>
-                     <dataFolder>../data</dataFolder>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.MultipleFailoverExample</clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                        <param>${basedir}/target/server1</param>
-                        <param>${basedir}/target/server2</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>multiple-failover</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java b/examples/broker-features/ha/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java
deleted file mode 100644
index 41d9e52..0000000
--- a/examples/broker-features/ha/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java
+++ /dev/null
@@ -1,142 +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 org.apache.activemq.artemis.util.ServerUtil;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-public class MultipleFailoverExample {
-
-   public static void main(final String[] args) throws Exception {
-      final int numMessages = 30;
-
-      Connection connection = null;
-
-      InitialContext initialContext = null;
-
-      Process[] servers = new Process[3];
-
-      try {
-         for (int i = 0; i < args.length; i++) {
-            servers[i] = ServerUtil.startServer(args[i], MultipleFailoverExample.class.getSimpleName() + i, i, 5000);
-         }
-
-         // Step 1. Get an initial context for looking up JNDI from the server #1
-         initialContext = new InitialContext();
-
-         // Step 2. Look up the JMS resources from JNDI
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 3. Create a JMS Connection
-         connection = connectionFactory.createConnection();
-
-         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
-         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
-         // Step 5. Start the connection to ensure delivery occurs
-         connection.start();
-
-         // Step 6. Create a JMS MessageProducer and a MessageConsumer
-         MessageProducer producer = session.createProducer(queue);
-         MessageConsumer consumer = session.createConsumer(queue);
-
-         // Step 7. Send some messages to server #1, the live server
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session.createTextMessage("This is text message " + i);
-            producer.send(message);
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 8. Receive and acknowledge a third of the sent messages
-         TextMessage message0 = null;
-         for (int i = 0; i < numMessages / 3; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-         message0.acknowledge();
-
-         // Step 9. Receive the rest third of the sent messages but *do not* acknowledge them yet
-         for (int i = numMessages / 3; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-
-         // Step 10. Crash server #1, the live server, and wait a little while to make sure
-         // it has really crashed
-         ServerUtil.killServer(servers[0]);
-
-         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
-         // backup server has occurred
-         try {
-            message0.acknowledge();
-         }
-         catch (JMSException e) {
-            System.err.println("Got exception while acknowledging message: " + e.getMessage());
-         }
-
-         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
-         for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
-         }
-         message0.acknowledge();
-
-         ServerUtil.killServer(servers[ServerUtil.getServer(connection)]);
-
-         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
-         // backup server has occurred
-         try {
-            message0.acknowledge();
-         }
-         catch (JMSException e) {
-            throw new IllegalStateException("Got exception while acknowledging message: " + e.getMessage());
-         }
-
-         // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
-         for (int i = (numMessages / 3) * 2; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
-         }
-         message0.acknowledge();
-      }
-      finally {
-         // Step 13. Be sure to close our resources!
-
-         if (connection != null) {
-            connection.close();
-         }
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-
-         for (int i = 0; i < args.length; i++) {
-            ServerUtil.killServer(servers[i]);
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/multiple-failover/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/multiple-failover/src/main/resources/jndi.properties b/examples/broker-features/ha/multiple-failover/src/main/resources/jndi.properties
deleted file mode 100644
index 7f7a19f..0000000
--- a/examples/broker-features/ha/multiple-failover/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/ha/non-transaction-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/non-transaction-failover/pom.xml b/examples/broker-features/ha/non-transaction-failover/pom.xml
deleted file mode 100644
index 1b5a600..0000000
--- a/examples/broker-features/ha/non-transaction-failover/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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.failover</groupId>
-      <artifactId>broker-failover</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>non-transaction-failover</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Non Transaction Failover Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server0</instance>
-                     <sharedStore>true</sharedStore>
-                     <slave>false</slave>
-                     <dataFolder>../data</dataFolder>
-                     <failoverOnShutdown>true</failoverOnShutdown>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <instance>${basedir}/target/server1</instance>
-                     <sharedStore>true</sharedStore>
-                     <slave>true</slave>
-                     <dataFolder>../data</dataFolder>
-                     <failoverOnShutdown>true</failoverOnShutdown>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.NonTransactionFailoverExample</clientClass>
-                     <args>
-                        <param>${basedir}/target/server0</param>
-                        <param>${basedir}/target/server1</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.failover</groupId>
-                  <artifactId>non-transaction-failover</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/non-transaction-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/non-transaction-failover/readme.html b/examples/broker-features/ha/non-transaction-failover/readme.html
deleted file mode 100644
index 647e7b8..0000000
--- a/examples/broker-features/ha/non-transaction-failover/readme.html
+++ /dev/null
@@ -1,157 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Failover Without Transactions 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 Failover Without Transactions Example</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
-
-
-     <p>This example demonstrates two servers coupled as a live-backup pair for high availability (HA), and a client
-     connection failing over from live to backup when the live server is crashed.</p>
-     <p>Failover behavior differs whether the JMS session is transacted or not.</p>
-     <p>When a <em>non-transacted</em> JMS session is used, once and only once delivery is not guaranteed
-        and it is possible some messages will be lost or delivered twice, depending when the failover to the backup server occurs.</p>
-     <p>It is up to the client to deal with such cases. To ensure once and only once delivery, the client must
-        use transacted JMS sessions (as shown in the example for <a href="../transaction-failover/readme.html">failover with transactions</a>).</p>
-     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
-     section of the user manual.</p>
-
-     <h2>Example step-by-step</h2>
-     <p>In this example, the live server is server 1, and the backup server is server 0</p>
-     <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
-     seamlessly on server 0, the backup server.</p>
-     <ol>
-        <li>Get an initial context for looking up JNDI from server #1.</li>
-        <pre class="prettyprint">
-           initialContext = getContext(1);
-        </pre>
-
-        <li>Look up the JMS resources from JNDI on server #1.</li>
-        <pre class="prettyprint">
-           Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-           ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-        </pre>
-
-        <li>Create a JMS Connection</li>
-        <pre class="prettyprint">
-           connection = connectionFactory.createConnection();
-        </pre>
-
-        <li>Create a JMS <em>non-transacted</em> Session with client acknowledgement</li>
-        <pre class="prettyprint">
-           Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-        </pre>
-
-        <li>Start the connection to ensure delivery occurs</li>
-        <pre class="prettyprint">
-           connection.start();
-        </pre>
-
-        <li>Create a JMS MessageProducer and MessageConsumer</li>
-        <pre class="prettyprint">
-           MessageProducer producer = session.createProducer(queue);
-           MessageConsumer consumer = session.createConsumer(queue);
-        </pre>
-
-        <li>Send some messages to server #1</li>
-        <pre class="prettyprint">
-           for (int i = 0; i &lt; numMessages; i++)
-           {
-              TextMessage message = session.createTextMessage("This is text message " + i);
-              producer.send(message);
-              System.out.println("Sent message: " + message.getText());
-           }
-        </pre>
-
-        <li>Receive and acknowledge half of the sent messages</li>
-        <pre class="prettyprint">
-           TextMessage message0 = null;
-           for (int i = 0; i &lt; numMessages / 2; i++)
-           {
-              message0 = (TextMessage)consumer.receive(5000);
-              System.out.println("Got message: " + message0.getText());
-           }
-           message0.acknowledge();
-        </pre>
-
-        <li>Receive the second half of the sent messages but <em>do not acknowledge them yet</em></li>
-        <pre class="prettyprint">
-           for (int i = numMessages / 2; i &lt; numMessages; i++)
-           {
-              message0 = (TextMessage)consumer.receive(5000);
-              System.out.println("Got message: " + message0.getText());
-           }
-        </pre>
-
-        <li>Crash server #1, the live server, and wait a little while to make sure it has really crashed.</li>
-        <pre class="prettyprint">
-           killServer(1);
-           Thread.sleep(2000);
-        </pre>
-
-        <li>Acknowledging the second half of the sent messages will fail as failover to the backup server has occurred</li>
-        <pre class="prettyprint">
-           try
-           {
-              message0.acknowledge();
-           }
-           catch (JMSException e)
-           {
-              System.err.println("Got exception while acknowledging message: " + e.getMessage());
-           }
-        </pre>
-
-         <li>Consume again the second half of the messages againg. Note that they are not considered as redelivered</li>
-        <pre class="prettyprint">
-           for (int i = numMessages / 2; i &lt; numMessages; i++)
-           {
-              message0 = (TextMessage)consumer.receive(5000);
-              System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-           }
-           message0.acknowledge();
-        </pre>
-
-        <li>And finally, <strong>always</strong> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           finally
-           {
-              if (connection != null)
-              {
-                 connection.close();
-              }
-
-              if (initialContext != null)
-              {
-                 initialContext.close();
-              }
-           }
-        </pre>
-
-     </ol>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java b/examples/broker-features/ha/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java
deleted file mode 100644
index 9352ac5..0000000
--- a/examples/broker-features/ha/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java
+++ /dev/null
@@ -1,128 +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 org.apache.activemq.artemis.util.ServerUtil;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-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 example that demonstrates failover of the JMS connection from one node to another
- * when the live server crashes using a JMS <em>non-transacted</em> session.
- */
-public class NonTransactionFailoverExample {
-
-   public static void main(final String[] args) throws Exception {
-      final int numMessages = 10;
-
-      Connection connection = null;
-
-      InitialContext initialContext = null;
-
-      Process[] servers = new Process[2];
-
-      try {
-         for (int i = 0; i < args.length; i++) {
-            servers[i] = ServerUtil.startServer(args[i], NonTransactionFailoverExample.class.getSimpleName() + i, i, 5000);
-         }
-
-         // Step 1. Get an initial context for looking up JNDI from the server #1
-         initialContext = new InitialContext();
-
-         // Step 2. Look up the JMS resources from JNDI
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 3. Create a JMS Connection
-         connection = connectionFactory.createConnection();
-
-         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
-         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
-         // Step 5. Start the connection to ensure delivery occurs
-         connection.start();
-
-         // Step 6. Create a JMS MessageProducer and a MessageConsumer
-         MessageProducer producer = session.createProducer(queue);
-         MessageConsumer consumer = session.createConsumer(queue);
-
-         // Step 7. Send some messages to server #1, the live server
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session.createTextMessage("This is text message " + i);
-            producer.send(message);
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 8. Receive and acknowledge half of the sent messages
-         TextMessage message0 = null;
-         for (int i = 0; i < numMessages / 2; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-         message0.acknowledge();
-
-         // Step 9. Receive the 2nd half of the sent messages but *do not* acknowledge them yet
-         for (int i = numMessages / 2; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.println("Got message: " + message0.getText());
-         }
-
-         // Step 10. Crash server #1, the live server, and wait a little while to make sure
-         // pending Acks are on the server's side
-         ServerUtil.killServer(servers[0]);
-
-         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
-         // backup server has occurred
-         try {
-            message0.acknowledge();
-         }
-         catch (JMSException e) {
-            System.err.println("Got exception while acknowledging message: " + e.getMessage());
-         }
-
-         // Step 12. Consume again the 2nd half of the messages again. Note that they are not considered as redelivered.
-         for (int i = numMessages / 2; i < numMessages; i++) {
-            message0 = (TextMessage) consumer.receive(5000);
-            System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
-         }
-         message0.acknowledge();
-      }
-      finally {
-         // Step 13. Be sure to close our resources!
-
-         if (connection != null) {
-            connection.close();
-         }
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-
-         for (int i = 0; i < args.length; i++) {
-            ServerUtil.killServer(servers[i]);
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/ha/non-transaction-failover/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/ha/non-transaction-failover/src/main/resources/jndi.properties b/examples/broker-features/ha/non-transaction-failover/src/main/resources/jndi.properties
deleted file mode 100644
index 7f7a19f..0000000
--- a/examples/broker-features/ha/non-transaction-failover/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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


[30/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/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
deleted file mode 100644
index 73d278d..0000000
--- a/examples/broker-features/standard/request-reply/readme.html
+++ /dev/null
@@ -1,180 +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.
--->
-
-<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/6b17d966/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
deleted file mode 100644
index 5d2e4dc..0000000
--- a/examples/broker-features/standard/request-reply/src/main/java/org/apache/activemq/artemis/jms/example/RequestReplyExample.java
+++ /dev/null
@@ -1,202 +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.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/6b17d966/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
deleted file mode 100644
index 7f7a19f..0000000
--- a/examples/broker-features/standard/request-reply/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/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
deleted file mode 100644
index 0e794b8..0000000
--- a/examples/broker-features/standard/rest/dup-send/README.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-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/6b17d966/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
deleted file mode 100644
index f31240a..0000000
--- a/examples/broker-features/standard/rest/dup-send/pom.xml
+++ /dev/null
@@ -1,170 +0,0 @@
-<?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/6b17d966/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
deleted file mode 100644
index 2b938f7..0000000
--- a/examples/broker-features/standard/rest/dup-send/src/main/java/Order.java
+++ /dev/null
@@ -1,69 +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.
- */
-
-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/6b17d966/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
deleted file mode 100644
index a864e44..0000000
--- a/examples/broker-features/standard/rest/dup-send/src/main/java/PostOrder.java
+++ /dev/null
@@ -1,69 +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.
- */
-
-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/6b17d966/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
deleted file mode 100644
index 6b610e7..0000000
--- a/examples/broker-features/standard/rest/dup-send/src/main/java/PostOrderWithId.java
+++ /dev/null
@@ -1,45 +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.
- */
-
-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/6b17d966/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
deleted file mode 100644
index a00d110..0000000
--- a/examples/broker-features/standard/rest/dup-send/src/main/java/ReceiveOrder.java
+++ /dev/null
@@ -1,51 +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.
- */
-
-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/6b17d966/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
deleted file mode 100644
index 6fe4547..0000000
--- a/examples/broker-features/standard/rest/dup-send/src/main/resources/activemq-client.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?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/6b17d966/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
deleted file mode 100644
index c1a7f21..0000000
--- a/examples/broker-features/standard/rest/dup-send/src/main/resources/activemq-rest.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?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>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/dup-send/src/main/resources/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/dup-send/src/main/resources/artemis-roles.properties b/examples/broker-features/standard/rest/dup-send/src/main/resources/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/broker-features/standard/rest/dup-send/src/main/resources/artemis-roles.properties
+++ /dev/null
@@ -1,17 +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.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/dup-send/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/dup-send/src/main/resources/broker.xml b/examples/broker-features/standard/rest/dup-send/src/main/resources/broker.xml
deleted file mode 100644
index 8cc0fa6..0000000
--- a/examples/broker-features/standard/rest/dup-send/src/main/resources/broker.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?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="orders"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <persistence-enabled>false</persistence-enabled>
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="in-vm">vm://0</connector>
-      </connectors>
-
-      <acceptors>
-         <acceptor name="in-vm">vm://0</acceptor>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="#">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/dup-send/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/dup-send/src/main/webapp/WEB-INF/web.xml b/examples/broker-features/standard/rest/dup-send/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index ffb38b5..0000000
--- a/examples/broker-features/standard/rest/dup-send/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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.
--->
-
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
-        "http://java.sun.com/dtd/web-app_2_3.dtd">
-
-<web-app>
-    <context-param>
-        <param-name>rest.messaging.config.file</param-name>
-        <param-value>activemq-rest.xml</param-value>
-    </context-param>
-
-    <filter>
-        <filter-name>Rest-Messaging</filter-name>
-        <filter-class>
-            org.jboss.resteasy.plugins.server.servlet.FilterDispatcher
-        </filter-class>
-    </filter>
-
-    <filter-mapping>
-        <filter-name>Rest-Messaging</filter-name>
-        <url-pattern>/*</url-pattern>
-    </filter-mapping>
-
-    <listener>
-        <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
-    </listener>
-
-    <listener>
-        <listener-class>org.apache.activemq.rest.integration.ActiveMQBootstrapListener</listener-class>
-    </listener>
-
-    <listener>
-        <listener-class>org.apache.activemq.rest.integration.RestMessagingBootstrapListener</listener-class>
-    </listener>
-
-</web-app>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/javascript-chat/README.txt
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/javascript-chat/README.txt b/examples/broker-features/standard/rest/javascript-chat/README.txt
deleted file mode 100644
index ae0e57c..0000000
--- a/examples/broker-features/standard/rest/javascript-chat/README.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-System Requirements:
-You will need JDK 1.6, Maven, and a browser 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 producing and consuming messages through a topic.  The client is Javascript code within your browser.
-The example is a very simple chat application between two browser windows.
-
-Step 1:
-$ mvn jetty:run
-
-This will bring up ActiveMQ Artemis and the ActiveMQ Artemis REST Interface.
-
-Step 2:
-Bring up two browsers and point them to http://localhost:9095.  In the textbox type a message you want to send.  Click
-the "Click to send message" button and you'll see the message show up in both browser windows.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/javascript-chat/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/javascript-chat/pom.xml b/examples/broker-features/standard/rest/javascript-chat/pom.xml
deleted file mode 100644
index ca7306c..0000000
--- a/examples/broker-features/standard/rest/javascript-chat/pom.xml
+++ /dev/null
@@ -1,184 +0,0 @@
-<?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>javascript-chat</artifactId>
-   <packaging>war</packaging>
-   <name>Browser Chat App</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>chat</finalName>
-            <plugins>
-               <!--
-               <plugin>
-                   <groupId>org.mortbay.jetty</groupId>
-                   <artifactId>maven-jetty-plugin</artifactId>
-                   <version>6.1.15</version>
-                   <configuration>
-                       <contextPath>/</contextPath>
-                       <scanIntervalSeconds>2</scanIntervalSeconds>
-                       <connectors>
-                           <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
-                               <port>9095</port>
-                               <maxIdleTime>60000</maxIdleTime>
-                           </connector>
-                       </connectors>
-                       <systemProperties>
-                           <systemProperty>
-                               <name>log4j.configuration</name>
-                               <value>
-                                   file:./src/test/resources/log4j.properties
-                               </value>
-                           </systemProperty>
-                       </systemProperties>
-                   </configuration>
-               </plugin>
-       -->
-               <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.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>
-         <version>4.1</version>
-         <scope>test</scope>
-      </dependency>
-   </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/javascript-chat/src/main/resources/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/javascript-chat/src/main/resources/artemis-roles.properties b/examples/broker-features/standard/rest/javascript-chat/src/main/resources/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/broker-features/standard/rest/javascript-chat/src/main/resources/artemis-roles.properties
+++ /dev/null
@@ -1,17 +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.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/javascript-chat/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/javascript-chat/src/main/resources/broker.xml b/examples/broker-features/standard/rest/javascript-chat/src/main/resources/broker.xml
deleted file mode 100644
index e5e1364..0000000
--- a/examples/broker-features/standard/rest/javascript-chat/src/main/resources/broker.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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-->
-      <topic name="chat"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <persistence-enabled>false</persistence-enabled>
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="in-vm">vm://0</connector>
-      </connectors>
-
-      <acceptors>
-         <acceptor name="in-vm">vm://0</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="#">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/javascript-chat/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/javascript-chat/src/main/webapp/WEB-INF/web.xml b/examples/broker-features/standard/rest/javascript-chat/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index e82738a..0000000
--- a/examples/broker-features/standard/rest/javascript-chat/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?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.
--->
-
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
-        "http://java.sun.com/dtd/web-app_2_3.dtd">
-
-<web-app>
-
-    <filter>
-        <filter-name>Rest-Messaging</filter-name>
-        <filter-class>
-            org.jboss.resteasy.plugins.server.servlet.FilterDispatcher
-        </filter-class>
-    </filter>
-
-    <filter-mapping>
-        <filter-name>Rest-Messaging</filter-name>
-        <url-pattern>/*</url-pattern>
-    </filter-mapping>
-
-    <listener>
-        <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
-    </listener>
-
-    <listener>
-        <listener-class>org.apache.activemq.rest.integration.ActiveMQBootstrapListener</listener-class>
-    </listener>
-
-    <listener>
-        <listener-class>org.apache.activemq.rest.integration.RestMessagingBootstrapListener</listener-class>
-    </listener>
-
-</web-app>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/javascript-chat/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/javascript-chat/src/main/webapp/index.html b/examples/broker-features/standard/rest/javascript-chat/src/main/webapp/index.html
deleted file mode 100644
index f74e0ee..0000000
--- a/examples/broker-features/standard/rest/javascript-chat/src/main/webapp/index.html
+++ /dev/null
@@ -1,189 +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.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-        "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <script type="text/javascript">
-        <!--
-
-        function createXHR()
-        {
-            var request = false;
-            try
-            {
-                request = new ActiveXObject('Msxml2.XMLHTTP');
-            }
-            catch (err2)
-            {
-                try
-                {
-                    request = new ActiveXObject('Microsoft.XMLHTTP');
-                }
-                catch (err3)
-                {
-                    try
-                    {
-                        request = new XMLHttpRequest();
-                    }
-                    catch (err1)
-                    {
-                        request = false;
-                    }
-                }
-            }
-            return request;
-        }
-
-        var topicSender;
-        var nextMessage;
-        var subscriptions;
-        var count = 0;
-        var reconnect = true;
-
-        function initializeSenderAndTop(topic)
-        {
-            var xhr = createXHR();
-            xhr.open("HEAD", "topics/" + topic, true);
-            xhr.onreadystatechange = function()
-            {
-                if (xhr.readyState == 4)
-                {
-                    if (xhr.status == 200)
-                    {
-                       // getting the links from the rest resource
-                       topicSender = xhr.getResponseHeader("msg-create");
-                       subscriptions = xhr.getResponseHeader("msg-pull-subscriptions");
-
-                       // just adding the report
-                       document.getElementById("errors").innerHTML = "Subscriptions URL: " + subscriptions;
-                    }
-                }
-            }
-            
-            // this will send the request from javascript
-            xhr.send(null);
-        }
-
-        function postMessage(user, message)
-        {
-            var xhr = createXHR();
-            xhr.open("POST", topicSender, false);
-            xhr.setRequestHeader("Content-Type", "text/plain");
-            xhr.send(user + ": " + message);
-            if (xhr.status == 201)
-            {
-               topicSender = xhr.getResponseHeader("msg-create-next");
-            }
-            else
-            {
-               document.getElementById("errors").innerHTML = "Failed to send message: " + topicSender;
-            }
-        }
-
-        function receiveMessage()
-        {
-            var xhr = createXHR();
-            if (reconnect)
-            {
-               document.getElementById("connection").innerHTML = "Trying to reconnect: " + subscriptions + " retries: " + count++;
-               xhr.open("POST", subscriptions, true);
-               xhr.onreadystatechange = function()
-               {
-                  if (xhr.readyState == 4)
-                  {
-                    var status = xhr.status;
-                    if (status == 201)
-                    {
-                       nextMessage = xhr.getResponseHeader("msg-consume-next");
-                       document.getElementById("connection").innerHTML = "Connected to: " + nextMessage;
-                       count = 1;
-                       reconnect = false;
-                    }
-                    setTimeout("receiveMessage()", 800);
-                  }
-               }
-               xhr.send(null);
-            }
-            else
-            {
-               xhr.open("POST", nextMessage, true);
-               xhr.setRequestHeader("Accept-Wait", "10")
-               xhr.onreadystatechange = function()
-               {
-                  if (xhr.readyState == 4)
-                  {
-                    var status = xhr.status;
-                    if (status == 200)
-                    {
-                        document.getElementById("next").innerHTML = xhr.responseText + "\n" + document.getElementById("next").innerHTML;
-                        nextMessage = xhr.getResponseHeader("msg-consume-next");
-                    }
-                    else
-                    {
-                       reconnect = true;
-                    }
-                    setTimeout("receiveMessage()", 800);
-                  }
-               }
-               xhr.send(null);
-            }
-        }
-
-        initializeSenderAndTop('jms.topic.chat');
-
-
-        setTimeout("receiveMessage()", 800);
-
-
-        // -->
-    </script>
-    <title>Ajax Chat Demo</title></head>
-
-
-<body bgcolor="#FFFFFF">
-
-<p><font size="+3">Ajax Chat Demo</font></p>
-<hr>
-<FORM name="ajax" method="POST" action="">
-
-    <p>
-        Username: <input type="text" name="user" value="Billy" size="10"><br/>
-        <input type="text" name="message">
-        <INPUT type="BUTTON" value=" Click to send message "
-               ONCLICK="postMessage(this.form.user.value, this.form.message.value)">
-    </p>
-
-</FORM>
-<div id="connection"></div>
-<br>
-
-<div id="errors"></div>
-
-<p>
-
-<h2>Messages:</h2></p>
-<pre>
-<div id="next"></div>
-</pre>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/javascript-chat/src/test/java/org/jboss/resteasy/messaging/test/AutoAckTopicTest.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/javascript-chat/src/test/java/org/jboss/resteasy/messaging/test/AutoAckTopicTest.java b/examples/broker-features/standard/rest/javascript-chat/src/test/java/org/jboss/resteasy/messaging/test/AutoAckTopicTest.java
deleted file mode 100644
index e1609bb..0000000
--- a/examples/broker-features/standard/rest/javascript-chat/src/test/java/org/jboss/resteasy/messaging/test/AutoAckTopicTest.java
+++ /dev/null
@@ -1,88 +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.jboss.resteasy.messaging.test;
-
-import org.jboss.resteasy.client.ClientRequest;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.spi.Link;
-import org.apache.activemq.artemis.rest.util.LinkStrategy;
-import org.junit.Assert;
-
-public class AutoAckTopicTest {
-
-   public static Link getLinkByTitle(LinkStrategy strategy, ClientResponse response, String title) {
-      return response.getLinkHeader().getLinkByTitle(title);
-   }
-
-   //todo fix
-   //@Test
-   public void testSuccessFirst() throws Exception {
-      ClientRequest request = new ClientRequest("http://localhost:9095/topics/jms.topic.chat");
-
-      ClientResponse response = request.head();
-      Assert.assertEquals("*****", 200, response.getStatus());
-      Link sender = getLinkByTitle(null, response, "create");
-      Link subscriptions = getLinkByTitle(null, response, "subscriptions");
-
-       /*
-      ClientResponse res = subscriptions.request().post();
-      Assert.assertEquals(201, res.getStatus());
-      Link sub1 = res.getLocation();
-      Assert.assertNotNull(sub1);
-      Link consumeNext1 = MessageTestBase.getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next");
-      Assert.assertNotNull(consumeNext1);
-      System.out.println("consumeNext1: " + consumeNext1);
-
-
-      res = subscriptions.request().post();
-      Assert.assertEquals(201, res.getStatus());
-      Link sub2 = res.getLocation();
-      Assert.assertNotNull(sub2);
-      Link consumeNext2 = MessageTestBase.getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next");
-      Assert.assertNotNull(consumeNext1);
-
-
-      res = sender.request().body("text/plain", Integer.toString(1)).post();
-      Assert.assertEquals(201, res.getStatus());
-      res = sender.request().body("text/plain", Integer.toString(2)).post();
-      Assert.assertEquals(201, res.getStatus());
-
-      res = consumeNext1.request().post(String.class);
-      Assert.assertEquals(200, res.getStatus());
-      Assert.assertEquals("1", res.getEntity(String.class));
-      consumeNext1 = MessageTestBase.getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next");
-
-      res = consumeNext1.request().post(String.class);
-      Assert.assertEquals(200, res.getStatus());
-      Assert.assertEquals("2", res.getEntity(String.class));
-      consumeNext1 = MessageTestBase.getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next");
-
-      res = consumeNext2.request().post(String.class);
-      Assert.assertEquals(200, res.getStatus());
-      Assert.assertEquals("1", res.getEntity(String.class));
-      consumeNext2 = MessageTestBase.getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next");
-
-      res = consumeNext2.request().post(String.class);
-      Assert.assertEquals(200, res.getStatus());
-      Assert.assertEquals("2", res.getEntity(String.class));
-      consumeNext2 = MessageTestBase.getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next");
-      Assert.assertEquals(204, sub1.request().delete().getStatus());
-      Assert.assertEquals(204, sub2.request().delete().getStatus());
-      */
-   }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/jms-to-rest/README.txt
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/jms-to-rest/README.txt b/examples/broker-features/standard/rest/jms-to-rest/README.txt
deleted file mode 100644
index f012d94..0000000
--- a/examples/broker-features/standard/rest/jms-to-rest/README.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-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 mixing JMS producers and consumers with REST producers and consumers.  The REST clients have been
-written in both Java using RESTEasy's client library and within the Python language.  You will need Python 2.6.1 or higher
-to be able to run the Python clients.
-
-To run the example you will need 5 shell-script windows (or you'll need to run 4 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="RestReceive"
-
-This will bring up a Java REST client that is continuously pulling the server through a consume-next (see doco for details).
-
-Step 3:
-$ mvn exec:java -Dexec.mainClass="JmsReceive"
-
-This will bring up a Java JMS consumer that is using the MessageListener interface to consume messages.  It will
-extract a Order instance from the JMS Message it receives.
-
-Step 4:
-
-$ python receiveOrder.py
-
-This runs a very simple Python program to consume messages
-
-Step 5:
-Use one of these three commands to post messages to the system.  One of the receive clients will consume the message.
-
-$ mvn exec:java -Dexec.mainClass="JmsSend"
-
-A JMS client will create an Order object and send it to the queue.  You'll see one of the 4 clients receive the message.
-Notice that the REST clients automatically cause the Order object to be transformed on the server and passed as XML
-to the REST client.
-
-$ mvn exec:java -Dexec.mainClass="RestSend"
-
-THis is a REST client that uses the Acknowledgement protocol to receive a message from the queue.
-
-$ python postOrder.py
-
-This is a Python client that posts one message to the queue RESTfully (of course ;) )

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/jms-to-rest/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/jms-to-rest/pom.xml b/examples/broker-features/standard/rest/jms-to-rest/pom.xml
deleted file mode 100644
index ecc94dc..0000000
--- a/examples/broker-features/standard/rest/jms-to-rest/pom.xml
+++ /dev/null
@@ -1,170 +0,0 @@
-<?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>mixed-jms-rest</artifactId>
-   <packaging>war</packaging>
-   <name>Mixed JMS and REST Producers/Consumers</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>


[07/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/queue-selector/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue-selector/src/main/resources/jndi.properties b/examples/features/standard/queue-selector/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue/pom.xml b/examples/features/standard/queue/pom.xml
new file mode 100644
index 0000000..e20a38c
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue/readme.html b/examples/features/standard/queue/readme.html
new file mode 100644
index 0000000..0cdbd5f
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/queue/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java b/examples/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/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/6b17d966/examples/features/standard/queue/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue/src/main/resources/jndi.properties b/examples/features/standard/queue/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/reattach-node/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/reattach-node/pom.xml b/examples/features/standard/reattach-node/pom.xml
new file mode 100644
index 0000000..4683e86
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/reattach-node/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/reattach-node/readme.html b/examples/features/standard/reattach-node/readme.html
new file mode 100644
index 0000000..bc7d090
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java b/examples/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/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/6b17d966/examples/features/standard/reattach-node/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/reattach-node/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/reattach-node/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..d82bc7e
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/reattach-node/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/reattach-node/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/reattach-node/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..07e09bb
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/reattach-node/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/reattach-node/src/main/resources/jndi.properties b/examples/features/standard/reattach-node/src/main/resources/jndi.properties
new file mode 100644
index 0000000..b6f8ff8
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/request-reply/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/request-reply/pom.xml b/examples/features/standard/request-reply/pom.xml
new file mode 100644
index 0000000..b4474b0
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/request-reply/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/request-reply/readme.html b/examples/features/standard/request-reply/readme.html
new file mode 100644
index 0000000..73d278d
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/request-reply/src/main/java/org/apache/activemq/artemis/jms/example/RequestReplyExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/request-reply/src/main/java/org/apache/activemq/artemis/jms/example/RequestReplyExample.java b/examples/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/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/6b17d966/examples/features/standard/request-reply/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/request-reply/src/main/resources/jndi.properties b/examples/features/standard/request-reply/src/main/resources/jndi.properties
new file mode 100644
index 0000000..7f7a19f
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/rest/dup-send/README.txt
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/dup-send/README.txt b/examples/features/standard/rest/dup-send/README.txt
new file mode 100644
index 0000000..0e794b8
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/rest/dup-send/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/dup-send/pom.xml b/examples/features/standard/rest/dup-send/pom.xml
new file mode 100644
index 0000000..f31240a
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/rest/dup-send/src/main/java/Order.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/dup-send/src/main/java/Order.java b/examples/features/standard/rest/dup-send/src/main/java/Order.java
new file mode 100644
index 0000000..2b938f7
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/rest/dup-send/src/main/java/PostOrder.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/dup-send/src/main/java/PostOrder.java b/examples/features/standard/rest/dup-send/src/main/java/PostOrder.java
new file mode 100644
index 0000000..a864e44
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/rest/dup-send/src/main/java/PostOrderWithId.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/dup-send/src/main/java/PostOrderWithId.java b/examples/features/standard/rest/dup-send/src/main/java/PostOrderWithId.java
new file mode 100644
index 0000000..6b610e7
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/rest/dup-send/src/main/java/ReceiveOrder.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/dup-send/src/main/java/ReceiveOrder.java b/examples/features/standard/rest/dup-send/src/main/java/ReceiveOrder.java
new file mode 100644
index 0000000..a00d110
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/rest/dup-send/src/main/resources/activemq-client.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/dup-send/src/main/resources/activemq-client.xml b/examples/features/standard/rest/dup-send/src/main/resources/activemq-client.xml
new file mode 100644
index 0000000..6fe4547
--- /dev/null
+++ b/examples/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/6b17d966/examples/features/standard/rest/dup-send/src/main/resources/activemq-rest.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/dup-send/src/main/resources/activemq-rest.xml b/examples/features/standard/rest/dup-send/src/main/resources/activemq-rest.xml
new file mode 100644
index 0000000..c1a7f21
--- /dev/null
+++ b/examples/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>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/dup-send/src/main/resources/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/dup-send/src/main/resources/artemis-roles.properties b/examples/features/standard/rest/dup-send/src/main/resources/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/rest/dup-send/src/main/resources/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/dup-send/src/main/resources/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/dup-send/src/main/resources/artemis-users.properties b/examples/features/standard/rest/dup-send/src/main/resources/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/rest/dup-send/src/main/resources/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/6b17d966/examples/features/standard/rest/dup-send/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/dup-send/src/main/resources/broker.xml b/examples/features/standard/rest/dup-send/src/main/resources/broker.xml
new file mode 100644
index 0000000..8cc0fa6
--- /dev/null
+++ b/examples/features/standard/rest/dup-send/src/main/resources/broker.xml
@@ -0,0 +1,59 @@
+<?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="orders"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <persistence-enabled>false</persistence-enabled>
+      <!-- Connectors -->
+
+      <connectors>
+         <connector name="in-vm">vm://0</connector>
+      </connectors>
+
+      <acceptors>
+         <acceptor name="in-vm">vm://0</acceptor>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="#">
+            <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-settings>
+
+   </core>
+</configuration>


[06/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/dup-send/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/dup-send/src/main/webapp/WEB-INF/web.xml b/examples/features/standard/rest/dup-send/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..ffb38b5
--- /dev/null
+++ b/examples/features/standard/rest/dup-send/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,55 @@
+<?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.
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+        "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+    <context-param>
+        <param-name>rest.messaging.config.file</param-name>
+        <param-value>activemq-rest.xml</param-value>
+    </context-param>
+
+    <filter>
+        <filter-name>Rest-Messaging</filter-name>
+        <filter-class>
+            org.jboss.resteasy.plugins.server.servlet.FilterDispatcher
+        </filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>Rest-Messaging</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <listener>
+        <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>org.apache.activemq.rest.integration.ActiveMQBootstrapListener</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>org.apache.activemq.rest.integration.RestMessagingBootstrapListener</listener-class>
+    </listener>
+
+</web-app>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/javascript-chat/README.txt
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/javascript-chat/README.txt b/examples/features/standard/rest/javascript-chat/README.txt
new file mode 100644
index 0000000..ae0e57c
--- /dev/null
+++ b/examples/features/standard/rest/javascript-chat/README.txt
@@ -0,0 +1,16 @@
+System Requirements:
+You will need JDK 1.6, Maven, and a browser 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 producing and consuming messages through a topic.  The client is Javascript code within your browser.
+The example is a very simple chat application between two browser windows.
+
+Step 1:
+$ mvn jetty:run
+
+This will bring up ActiveMQ Artemis and the ActiveMQ Artemis REST Interface.
+
+Step 2:
+Bring up two browsers and point them to http://localhost:9095.  In the textbox type a message you want to send.  Click
+the "Click to send message" button and you'll see the message show up in both browser windows.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/javascript-chat/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/javascript-chat/pom.xml b/examples/features/standard/rest/javascript-chat/pom.xml
new file mode 100644
index 0000000..ca7306c
--- /dev/null
+++ b/examples/features/standard/rest/javascript-chat/pom.xml
@@ -0,0 +1,184 @@
+<?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>javascript-chat</artifactId>
+   <packaging>war</packaging>
+   <name>Browser Chat App</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>chat</finalName>
+            <plugins>
+               <!--
+               <plugin>
+                   <groupId>org.mortbay.jetty</groupId>
+                   <artifactId>maven-jetty-plugin</artifactId>
+                   <version>6.1.15</version>
+                   <configuration>
+                       <contextPath>/</contextPath>
+                       <scanIntervalSeconds>2</scanIntervalSeconds>
+                       <connectors>
+                           <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+                               <port>9095</port>
+                               <maxIdleTime>60000</maxIdleTime>
+                           </connector>
+                       </connectors>
+                       <systemProperties>
+                           <systemProperty>
+                               <name>log4j.configuration</name>
+                               <value>
+                                   file:./src/test/resources/log4j.properties
+                               </value>
+                           </systemProperty>
+                       </systemProperties>
+                   </configuration>
+               </plugin>
+       -->
+               <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.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>
+         <version>4.1</version>
+         <scope>test</scope>
+      </dependency>
+   </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/javascript-chat/src/main/resources/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/javascript-chat/src/main/resources/artemis-roles.properties b/examples/features/standard/rest/javascript-chat/src/main/resources/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/rest/javascript-chat/src/main/resources/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/javascript-chat/src/main/resources/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/javascript-chat/src/main/resources/artemis-users.properties b/examples/features/standard/rest/javascript-chat/src/main/resources/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/rest/javascript-chat/src/main/resources/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/6b17d966/examples/features/standard/rest/javascript-chat/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/javascript-chat/src/main/resources/broker.xml b/examples/features/standard/rest/javascript-chat/src/main/resources/broker.xml
new file mode 100644
index 0000000..e5e1364
--- /dev/null
+++ b/examples/features/standard/rest/javascript-chat/src/main/resources/broker.xml
@@ -0,0 +1,58 @@
+<?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-->
+      <topic name="chat"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <persistence-enabled>false</persistence-enabled>
+      <!-- Connectors -->
+
+      <connectors>
+         <connector name="in-vm">vm://0</connector>
+      </connectors>
+
+      <acceptors>
+         <acceptor name="in-vm">vm://0</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="#">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/javascript-chat/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/javascript-chat/src/main/webapp/WEB-INF/web.xml b/examples/features/standard/rest/javascript-chat/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..e82738a
--- /dev/null
+++ b/examples/features/standard/rest/javascript-chat/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,51 @@
+<?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.
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+        "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+    <filter>
+        <filter-name>Rest-Messaging</filter-name>
+        <filter-class>
+            org.jboss.resteasy.plugins.server.servlet.FilterDispatcher
+        </filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>Rest-Messaging</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <listener>
+        <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>org.apache.activemq.rest.integration.ActiveMQBootstrapListener</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>org.apache.activemq.rest.integration.RestMessagingBootstrapListener</listener-class>
+    </listener>
+
+</web-app>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/javascript-chat/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/javascript-chat/src/main/webapp/index.html b/examples/features/standard/rest/javascript-chat/src/main/webapp/index.html
new file mode 100644
index 0000000..f74e0ee
--- /dev/null
+++ b/examples/features/standard/rest/javascript-chat/src/main/webapp/index.html
@@ -0,0 +1,189 @@
+<!--
+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.
+-->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+        "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <script type="text/javascript">
+        <!--
+
+        function createXHR()
+        {
+            var request = false;
+            try
+            {
+                request = new ActiveXObject('Msxml2.XMLHTTP');
+            }
+            catch (err2)
+            {
+                try
+                {
+                    request = new ActiveXObject('Microsoft.XMLHTTP');
+                }
+                catch (err3)
+                {
+                    try
+                    {
+                        request = new XMLHttpRequest();
+                    }
+                    catch (err1)
+                    {
+                        request = false;
+                    }
+                }
+            }
+            return request;
+        }
+
+        var topicSender;
+        var nextMessage;
+        var subscriptions;
+        var count = 0;
+        var reconnect = true;
+
+        function initializeSenderAndTop(topic)
+        {
+            var xhr = createXHR();
+            xhr.open("HEAD", "topics/" + topic, true);
+            xhr.onreadystatechange = function()
+            {
+                if (xhr.readyState == 4)
+                {
+                    if (xhr.status == 200)
+                    {
+                       // getting the links from the rest resource
+                       topicSender = xhr.getResponseHeader("msg-create");
+                       subscriptions = xhr.getResponseHeader("msg-pull-subscriptions");
+
+                       // just adding the report
+                       document.getElementById("errors").innerHTML = "Subscriptions URL: " + subscriptions;
+                    }
+                }
+            }
+            
+            // this will send the request from javascript
+            xhr.send(null);
+        }
+
+        function postMessage(user, message)
+        {
+            var xhr = createXHR();
+            xhr.open("POST", topicSender, false);
+            xhr.setRequestHeader("Content-Type", "text/plain");
+            xhr.send(user + ": " + message);
+            if (xhr.status == 201)
+            {
+               topicSender = xhr.getResponseHeader("msg-create-next");
+            }
+            else
+            {
+               document.getElementById("errors").innerHTML = "Failed to send message: " + topicSender;
+            }
+        }
+
+        function receiveMessage()
+        {
+            var xhr = createXHR();
+            if (reconnect)
+            {
+               document.getElementById("connection").innerHTML = "Trying to reconnect: " + subscriptions + " retries: " + count++;
+               xhr.open("POST", subscriptions, true);
+               xhr.onreadystatechange = function()
+               {
+                  if (xhr.readyState == 4)
+                  {
+                    var status = xhr.status;
+                    if (status == 201)
+                    {
+                       nextMessage = xhr.getResponseHeader("msg-consume-next");
+                       document.getElementById("connection").innerHTML = "Connected to: " + nextMessage;
+                       count = 1;
+                       reconnect = false;
+                    }
+                    setTimeout("receiveMessage()", 800);
+                  }
+               }
+               xhr.send(null);
+            }
+            else
+            {
+               xhr.open("POST", nextMessage, true);
+               xhr.setRequestHeader("Accept-Wait", "10")
+               xhr.onreadystatechange = function()
+               {
+                  if (xhr.readyState == 4)
+                  {
+                    var status = xhr.status;
+                    if (status == 200)
+                    {
+                        document.getElementById("next").innerHTML = xhr.responseText + "\n" + document.getElementById("next").innerHTML;
+                        nextMessage = xhr.getResponseHeader("msg-consume-next");
+                    }
+                    else
+                    {
+                       reconnect = true;
+                    }
+                    setTimeout("receiveMessage()", 800);
+                  }
+               }
+               xhr.send(null);
+            }
+        }
+
+        initializeSenderAndTop('jms.topic.chat');
+
+
+        setTimeout("receiveMessage()", 800);
+
+
+        // -->
+    </script>
+    <title>Ajax Chat Demo</title></head>
+
+
+<body bgcolor="#FFFFFF">
+
+<p><font size="+3">Ajax Chat Demo</font></p>
+<hr>
+<FORM name="ajax" method="POST" action="">
+
+    <p>
+        Username: <input type="text" name="user" value="Billy" size="10"><br/>
+        <input type="text" name="message">
+        <INPUT type="BUTTON" value=" Click to send message "
+               ONCLICK="postMessage(this.form.user.value, this.form.message.value)">
+    </p>
+
+</FORM>
+<div id="connection"></div>
+<br>
+
+<div id="errors"></div>
+
+<p>
+
+<h2>Messages:</h2></p>
+<pre>
+<div id="next"></div>
+</pre>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/javascript-chat/src/test/java/org/jboss/resteasy/messaging/test/AutoAckTopicTest.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/javascript-chat/src/test/java/org/jboss/resteasy/messaging/test/AutoAckTopicTest.java b/examples/features/standard/rest/javascript-chat/src/test/java/org/jboss/resteasy/messaging/test/AutoAckTopicTest.java
new file mode 100644
index 0000000..e1609bb
--- /dev/null
+++ b/examples/features/standard/rest/javascript-chat/src/test/java/org/jboss/resteasy/messaging/test/AutoAckTopicTest.java
@@ -0,0 +1,88 @@
+/*
+ * 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.jboss.resteasy.messaging.test;
+
+import org.jboss.resteasy.client.ClientRequest;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.spi.Link;
+import org.apache.activemq.artemis.rest.util.LinkStrategy;
+import org.junit.Assert;
+
+public class AutoAckTopicTest {
+
+   public static Link getLinkByTitle(LinkStrategy strategy, ClientResponse response, String title) {
+      return response.getLinkHeader().getLinkByTitle(title);
+   }
+
+   //todo fix
+   //@Test
+   public void testSuccessFirst() throws Exception {
+      ClientRequest request = new ClientRequest("http://localhost:9095/topics/jms.topic.chat");
+
+      ClientResponse response = request.head();
+      Assert.assertEquals("*****", 200, response.getStatus());
+      Link sender = getLinkByTitle(null, response, "create");
+      Link subscriptions = getLinkByTitle(null, response, "subscriptions");
+
+       /*
+      ClientResponse res = subscriptions.request().post();
+      Assert.assertEquals(201, res.getStatus());
+      Link sub1 = res.getLocation();
+      Assert.assertNotNull(sub1);
+      Link consumeNext1 = MessageTestBase.getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next");
+      Assert.assertNotNull(consumeNext1);
+      System.out.println("consumeNext1: " + consumeNext1);
+
+
+      res = subscriptions.request().post();
+      Assert.assertEquals(201, res.getStatus());
+      Link sub2 = res.getLocation();
+      Assert.assertNotNull(sub2);
+      Link consumeNext2 = MessageTestBase.getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next");
+      Assert.assertNotNull(consumeNext1);
+
+
+      res = sender.request().body("text/plain", Integer.toString(1)).post();
+      Assert.assertEquals(201, res.getStatus());
+      res = sender.request().body("text/plain", Integer.toString(2)).post();
+      Assert.assertEquals(201, res.getStatus());
+
+      res = consumeNext1.request().post(String.class);
+      Assert.assertEquals(200, res.getStatus());
+      Assert.assertEquals("1", res.getEntity(String.class));
+      consumeNext1 = MessageTestBase.getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next");
+
+      res = consumeNext1.request().post(String.class);
+      Assert.assertEquals(200, res.getStatus());
+      Assert.assertEquals("2", res.getEntity(String.class));
+      consumeNext1 = MessageTestBase.getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next");
+
+      res = consumeNext2.request().post(String.class);
+      Assert.assertEquals(200, res.getStatus());
+      Assert.assertEquals("1", res.getEntity(String.class));
+      consumeNext2 = MessageTestBase.getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next");
+
+      res = consumeNext2.request().post(String.class);
+      Assert.assertEquals(200, res.getStatus());
+      Assert.assertEquals("2", res.getEntity(String.class));
+      consumeNext2 = MessageTestBase.getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next");
+      Assert.assertEquals(204, sub1.request().delete().getStatus());
+      Assert.assertEquals(204, sub2.request().delete().getStatus());
+      */
+   }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/jms-to-rest/README.txt
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/README.txt b/examples/features/standard/rest/jms-to-rest/README.txt
new file mode 100644
index 0000000..f012d94
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/README.txt
@@ -0,0 +1,49 @@
+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 mixing JMS producers and consumers with REST producers and consumers.  The REST clients have been
+written in both Java using RESTEasy's client library and within the Python language.  You will need Python 2.6.1 or higher
+to be able to run the Python clients.
+
+To run the example you will need 5 shell-script windows (or you'll need to run 4 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="RestReceive"
+
+This will bring up a Java REST client that is continuously pulling the server through a consume-next (see doco for details).
+
+Step 3:
+$ mvn exec:java -Dexec.mainClass="JmsReceive"
+
+This will bring up a Java JMS consumer that is using the MessageListener interface to consume messages.  It will
+extract a Order instance from the JMS Message it receives.
+
+Step 4:
+
+$ python receiveOrder.py
+
+This runs a very simple Python program to consume messages
+
+Step 5:
+Use one of these three commands to post messages to the system.  One of the receive clients will consume the message.
+
+$ mvn exec:java -Dexec.mainClass="JmsSend"
+
+A JMS client will create an Order object and send it to the queue.  You'll see one of the 4 clients receive the message.
+Notice that the REST clients automatically cause the Order object to be transformed on the server and passed as XML
+to the REST client.
+
+$ mvn exec:java -Dexec.mainClass="RestSend"
+
+THis is a REST client that uses the Acknowledgement protocol to receive a message from the queue.
+
+$ python postOrder.py
+
+This is a Python client that posts one message to the queue RESTfully (of course ;) )

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/jms-to-rest/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/pom.xml b/examples/features/standard/rest/jms-to-rest/pom.xml
new file mode 100644
index 0000000..ecc94dc
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/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>mixed-jms-rest</artifactId>
+   <packaging>war</packaging>
+   <name>Mixed JMS and REST Producers/Consumers</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/6b17d966/examples/features/standard/rest/jms-to-rest/postOrder.py
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/postOrder.py b/examples/features/standard/rest/jms-to-rest/postOrder.py
new file mode 100644
index 0000000..3580986
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/postOrder.py
@@ -0,0 +1,44 @@
+# 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 httplib, urlparse
+
+conn = httplib.HTTPConnection("localhost:9095")
+conn.request("HEAD", "/queues/jms.queue.orders")
+res = conn.getresponse()
+createLink = res.getheader("msg-create")
+print createLink
+conn.close()
+
+createParsed = urlparse.urlparse(createLink)
+conn = httplib.HTTPConnection(createParsed.netloc)
+headers = {'Content-Type' : 'application/xml'}
+xml = """<?xml version="1.0"?>
+<order>
+   <name>Bill</name>
+   <amount>$199.99</amount>
+   <item>iPhone4</item>
+</order>"""
+conn.request("POST", createParsed.path, xml, headers)
+res = conn.getresponse()
+print res.status, res.reason
+
+
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/jms-to-rest/receiveOrder.py
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/receiveOrder.py b/examples/features/standard/rest/jms-to-rest/receiveOrder.py
new file mode 100644
index 0000000..ce73f5c
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/receiveOrder.py
@@ -0,0 +1,68 @@
+# 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 httplib, urlparse
+
+conn = httplib.HTTPConnection("localhost:9095")
+conn.request("HEAD", "/queues/jms.queue.orders")
+res = conn.getresponse()
+consumersLink = res.getheader("msg-pull-consumers")
+consumersParsed = urlparse.urlparse(consumersLink)
+conn = httplib.HTTPConnection(consumersParsed.netloc)
+conn.request("POST", consumersParsed.path)
+res = conn.getresponse()
+consumeLink = res.getheader("msg-consume-next")
+session = res.getheader("Location")
+print consumeLink
+conn.close()
+
+headers = {"Accept-Wait" : "3", "Accept" : "application/xml"}
+
+try:
+    print "Waiting..."
+    while True:
+        createParsed = urlparse.urlparse(consumeLink)
+        conn = httplib.HTTPConnection(createParsed.netloc)
+        conn.request("POST", createParsed.path, None, headers)
+        res = conn.getresponse()
+        if res.status == 503:
+            consumeLink = res.getheader("msg-consume-next")
+        elif res.status == 200:
+            print "Success!"
+            data = res.read()
+            print data
+            consumeLink = res.getheader("msg-consume-next")
+            print "Waiting"
+        else:
+            raise Exception('failed')
+finally:
+    if session != None:
+        print "deleting activemq session..."
+        createParsed = urlparse.urlparse(session)
+        conn = httplib.HTTPConnection(createParsed.netloc)
+        conn.request("DELETE", createParsed.path)
+        res = conn.getresponse()
+        
+        
+    
+
+
+
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/jms-to-rest/src/main/java/JmsHelper.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/src/main/java/JmsHelper.java b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsHelper.java
new file mode 100644
index 0000000..ef7a575
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsHelper.java
@@ -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.
+ */
+
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
+import org.apache.activemq.artemis.core.config.FileDeploymentManager;
+import org.apache.activemq.artemis.core.config.impl.FileConfiguration;
+import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory;
+
+import javax.jms.ConnectionFactory;
+
+public class JmsHelper {
+
+   public static ConnectionFactory createConnectionFactory(String configFile) throws Exception {
+      FileConfiguration config = new FileConfiguration();
+      FileDeploymentManager deploymentManager = new FileDeploymentManager(configFile);
+      deploymentManager.addDeployable(config);
+      deploymentManager.readConfiguration();
+      TransportConfiguration transport = config.getConnectorConfigurations().get("netty-connector");
+      return new ActiveMQJMSConnectionFactory(ActiveMQClient.createServerLocatorWithoutHA(transport));
+
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java
new file mode 100644
index 0000000..d3c05b2
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java
@@ -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.
+ */
+
+import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
+import org.apache.activemq.artemis.rest.Jms;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.Session;
+
+public class JmsReceive {
+
+   public static void main(String[] args) throws Exception {
+      System.out.println("Receive Setup...");
+      ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml");
+      Destination destination = (ActiveMQDestination) ActiveMQDestination.fromAddress("jms.queue.orders");
+
+      Connection conn = factory.createConnection();
+      try {
+         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer consumer = session.createConsumer(destination);
+         consumer.setMessageListener(new MessageListener() {
+               @Override
+               public void onMessage(Message message) {
+                  System.out.println("Received Message: ");
+                  Order order = Jms.getEntity(message, Order.class);
+                  System.out.println(order);
+               }
+            });
+         conn.start();
+         Thread.sleep(1000000);
+      }
+      finally {
+         conn.close();
+      }
+   }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/jms-to-rest/src/main/java/JmsSend.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/src/main/java/JmsSend.java b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsSend.java
new file mode 100644
index 0000000..bf3370e
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsSend.java
@@ -0,0 +1,47 @@
+/*
+ * 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.apache.activemq.artemis.jms.client.ActiveMQDestination;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Session;
+
+public class JmsSend {
+
+   public static void main(String[] args) throws Exception {
+      ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml");
+      Destination destination = (ActiveMQDestination) ActiveMQDestination.fromAddress("jms.queue.orders");
+
+      Connection conn = factory.createConnection();
+      try {
+         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer producer = session.createProducer(destination);
+         ObjectMessage message = session.createObjectMessage();
+
+         Order order = new Order("Bill", "$199.99", "iPhone4");
+         message.setObject(order);
+         producer.send(message);
+      }
+      finally {
+         conn.close();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/jms-to-rest/src/main/java/Order.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/src/main/java/Order.java b/examples/features/standard/rest/jms-to-rest/src/main/java/Order.java
new file mode 100644
index 0000000..2b938f7
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/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/6b17d966/examples/features/standard/rest/jms-to-rest/src/main/java/RestReceive.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/src/main/java/RestReceive.java b/examples/features/standard/rest/jms-to-rest/src/main/java/RestReceive.java
new file mode 100644
index 0000000..4fc493a
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/src/main/java/RestReceive.java
@@ -0,0 +1,52 @@
+/*
+ * 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 RestReceive {
+
+   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 = pullConsumers.request().formParameter("autoAck", "false").post();
+      Link ackNext = res.getHeaderAsLink("msg-acknowledge-next");
+      res.releaseConnection();
+      while (true) {
+         System.out.println("Waiting...");
+         res = ackNext.request().header("Accept-Wait", "10").header("Accept", "application/xml").post();
+         if (res.getStatus() == 503) {
+            System.out.println("Timeout...");
+            ackNext = res.getHeaderAsLink("msg-acknowledge-next");
+         }
+         else if (res.getStatus() == 200) {
+            Order order = (Order) res.getEntity(Order.class);
+            System.out.println(order);
+            Link ack = res.getHeaderAsLink("msg-acknowledgement");
+            res = ack.request().formParameter("acknowledge", "true").post();
+            ackNext = res.getHeaderAsLink("msg-acknowledge-next");
+         }
+         else {
+            throw new RuntimeException("Failure! " + res.getStatus());
+         }
+         res.releaseConnection();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/jms-to-rest/src/main/java/RestSend.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/src/main/java/RestSend.java b/examples/features/standard/rest/jms-to-rest/src/main/java/RestSend.java
new file mode 100644
index 0000000..902c4f7
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/src/main/java/RestSend.java
@@ -0,0 +1,40 @@
+/*
+ * 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 RestSend {
+
+   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 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() != 201)
+         throw new RuntimeException("Failed to post");
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/jms-to-rest/src/main/resources/activemq-client.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/src/main/resources/activemq-client.xml b/examples/features/standard/rest/jms-to-rest/src/main/resources/activemq-client.xml
new file mode 100644
index 0000000..6fe4547
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/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/6b17d966/examples/features/standard/rest/jms-to-rest/src/main/resources/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/src/main/resources/artemis-roles.properties b/examples/features/standard/rest/jms-to-rest/src/main/resources/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/src/main/resources/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/jms-to-rest/src/main/resources/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/src/main/resources/artemis-users.properties b/examples/features/standard/rest/jms-to-rest/src/main/resources/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/src/main/resources/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/6b17d966/examples/features/standard/rest/jms-to-rest/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/src/main/resources/broker.xml b/examples/features/standard/rest/jms-to-rest/src/main/resources/broker.xml
new file mode 100644
index 0000000..8cc0fa6
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/src/main/resources/broker.xml
@@ -0,0 +1,59 @@
+<?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="orders"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <persistence-enabled>false</persistence-enabled>
+      <!-- Connectors -->
+
+      <connectors>
+         <connector name="in-vm">vm://0</connector>
+      </connectors>
+
+      <acceptors>
+         <acceptor name="in-vm">vm://0</acceptor>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="#">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/jms-to-rest/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/src/main/webapp/WEB-INF/web.xml b/examples/features/standard/rest/jms-to-rest/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..e82738a
--- /dev/null
+++ b/examples/features/standard/rest/jms-to-rest/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,51 @@
+<?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.
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+        "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+    <filter>
+        <filter-name>Rest-Messaging</filter-name>
+        <filter-class>
+            org.jboss.resteasy.plugins.server.servlet.FilterDispatcher
+        </filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>Rest-Messaging</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <listener>
+        <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>org.apache.activemq.rest.integration.ActiveMQBootstrapListener</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>org.apache.activemq.rest.integration.RestMessagingBootstrapListener</listener-class>
+    </listener>
+
+</web-app>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/pom.xml b/examples/features/standard/rest/pom.xml
new file mode 100644
index 0000000..bb6c81e
--- /dev/null
+++ b/examples/features/standard/rest/pom.xml
@@ -0,0 +1,45 @@
+<?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>
+
+   <groupId>org.apache.activemq.examples.rest</groupId>
+   <artifactId>artemis-rests-pom</artifactId>
+   <packaging>pom</packaging>
+   <name>ActiveMQ Artemis REST Examples</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <modules>
+      <module>javascript-chat</module>
+      <module>jms-to-rest</module>
+      <module>push</module>
+      <module>dup-send</module>
+   </modules>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/push/README.txt
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/README.txt b/examples/features/standard/rest/push/README.txt
new file mode 100644
index 0000000..307e444
--- /dev/null
+++ b/examples/features/standard/rest/push/README.txt
@@ -0,0 +1,32 @@
+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 having the ActiveMQ Artemis REST interface forward a posted message to a registered URL.
+
+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.  Two queues will be created.  An "order" queue and a "shipping"
+queue.  The server will forward posted messages to the "shipping" queue through a registered push subscription.
+
+Step 2:
+$ mvn exec:java -Dexec.mainClass="ReceiveShipping"
+
+This will bring up a JMS client registers a MessageListener consumer to receive Order objects.  It will automatically
+convert a posted HTTP message into an Order object using JAX-RS content handlers.
+
+Step 3:
+$ mvn exec:java -Dexec.mainClass="PushReg"
+
+This creates a push registration that listens on the "order" queue and forwards messages posted to it to a URL.  This
+URL is the REST resource of the "shipping" queue.
+
+Step 4:
+
+$ mvn exec:java -Dexec.mainClass="PostOrder"
+
+This posts an order to the "order" queue.  You'll see it eventually consumed by the ReceiveShipping process.

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/push/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/pom.xml b/examples/features/standard/rest/push/pom.xml
new file mode 100644
index 0000000..49eba5e
--- /dev/null
+++ b/examples/features/standard/rest/push/pom.xml
@@ -0,0 +1,176 @@
+<?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>push</artifactId>
+   <packaging>war</packaging>
+   <name>Push Subscriptions</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>
+                     <userRealms>
+                        <userRealm implementation="org.mortbay.jetty.security.HashUserRealm">
+                           <name>Test</name>
+                           <config>${project.build.outputDirectory}/test-realm.properties</config>
+                        </userRealm>
+                     </userRealms>
+                  </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/6b17d966/examples/features/standard/rest/push/src/main/java/JmsHelper.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/src/main/java/JmsHelper.java b/examples/features/standard/rest/push/src/main/java/JmsHelper.java
new file mode 100644
index 0000000..add00c2
--- /dev/null
+++ b/examples/features/standard/rest/push/src/main/java/JmsHelper.java
@@ -0,0 +1,37 @@
+/*
+ * 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.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
+import org.apache.activemq.artemis.core.config.FileDeploymentManager;
+import org.apache.activemq.artemis.core.config.impl.FileConfiguration;
+import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory;
+
+import javax.jms.ConnectionFactory;
+
+public class JmsHelper {
+
+   public static ConnectionFactory createConnectionFactory(String configFile) throws Exception {
+      FileConfiguration config = new FileConfiguration();
+      FileDeploymentManager deploymentManager = new FileDeploymentManager(configFile);
+      deploymentManager.addDeployable(config);
+      deploymentManager.readConfiguration();
+      TransportConfiguration transport = config.getConnectorConfigurations().get("netty-connector");
+      return new ActiveMQJMSConnectionFactory(ActiveMQClient.createServerLocatorWithoutHA(transport));
+
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/rest/push/src/main/java/Order.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/src/main/java/Order.java b/examples/features/standard/rest/push/src/main/java/Order.java
new file mode 100644
index 0000000..2b938f7
--- /dev/null
+++ b/examples/features/standard/rest/push/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/6b17d966/examples/features/standard/rest/push/src/main/java/PostOrder.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/src/main/java/PostOrder.java b/examples/features/standard/rest/push/src/main/java/PostOrder.java
new file mode 100644
index 0000000..96786e6
--- /dev/null
+++ b/examples/features/standard/rest/push/src/main/java/PostOrder.java
@@ -0,0 +1,47 @@
+/*
+ * 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.apache.activemq.artemis.jms.client.ActiveMQDestination;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Session;
+
+public class PostOrder {
+
+   public static void main(String[] args) throws Exception {
+      ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml");
+      Destination destination = (ActiveMQDestination) ActiveMQDestination.fromAddress("jms.queue.orders");
+
+      Connection conn = factory.createConnection();
+      try {
+         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer producer = session.createProducer(destination);
+         ObjectMessage message = session.createObjectMessage();
+
+         Order order = new Order("Bill", "$199.99", "iPhone4");
+         message.setObject(order);
+         producer.send(message);
+      }
+      finally {
+         conn.close();
+      }
+   }
+}


[21/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..6fc6f32
--- /dev/null
+++ b/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,107 @@
+<?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:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>ON_DEMAND</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+      <address-settings>
+         <!-- We set a redistribution delay of zero on all jms queues and topic subscriptions
+         Default redistribution delay as -1 which means "disable redistribution"
+         Setting it to a value > 0 means how long to wait before redistributing, if a consumer is closed
+         then another one quickly recreated you might want to set it thus, to avoid unnecessary
+         redistribution -->
+         <address-setting match="jms.#">
+            <redistribution-delay>0</redistribution-delay>
+         </address-setting>
+      </address-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/symmetric-cluster/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/pom.xml b/examples/features/clustered/symmetric-cluster/pom.xml
new file mode 100644
index 0000000..5be9c1d
--- /dev/null
+++ b/examples/features/clustered/symmetric-cluster/pom.xml
@@ -0,0 +1,320 @@
+<?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.clustered</groupId>
+      <artifactId>broker-clustered</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>symmetric-cluster</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Symmetric Cluster 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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <instance>${basedir}/target/server2</instance>
+                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create3</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <instance>${basedir}/target/server3</instance>
+                     <configuration>${basedir}/target/classes/activemq/server3</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create4</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <instance>${basedir}/target/server4</instance>
+                     <configuration>${basedir}/target/classes/activemq/server4</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create5</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <instance>${basedir}/target/server5</instance>
+                     <configuration>${basedir}/target/classes/activemq/server5</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server2</location>
+                     <testURI>tcp://localhost:61618</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server2</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start3</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server3</location>
+                     <testURI>tcp://localhost:61619</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server3</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start4</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server4</location>
+                     <testURI>tcp://localhost:61620</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server4</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start5</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server5</location>
+                     <testURI>tcp://localhost:61621</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server5</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.SymmetricClusterExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <location>${basedir}/target/server2</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop3</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <location>${basedir}/target/server3</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop4</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <location>${basedir}/target/server4</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop5</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <location>${basedir}/target/server5</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <artifactId>symmetric-cluster</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/symmetric-cluster/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/readme.html b/examples/features/clustered/symmetric-cluster/readme.html
new file mode 100644
index 0000000..043057d
--- /dev/null
+++ b/examples/features/clustered/symmetric-cluster/readme.html
@@ -0,0 +1,74 @@
+<!--
+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 Symmetric Cluster 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 Symmetric Cluster 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 examples demonstrates a <b>symmetric cluster</b> set-up with ActiveMQ Artemis.</p>
+     <p>ActiveMQ Artemis has extremely flexible clustering which allows you to set-up servers in
+     many different topologies.</p>
+     <p>The most common topology that you'll perhaps be familiar with if you are used to application
+     server clustering is a <b>symmetric cluster</b>.</p>
+     <p>With a symmetric cluster, the cluster is homogeneous, i.e. each node is configured the same
+     as every other node, and every node is connected to every other node in the cluster.</p>
+     <p>By connecting node in such a way, we can, from a JMS point of view, give the impression of distributed
+     JMS queues and topics.</p>
+     <p>The configuration used in this example is very similar to the configuration used by ActiveMQ
+     when installed as a clustered profile in JBoss Application Server.</p>
+     <p>To set up ActiveMQ Artemis to form a symmetric cluster we simply need to mark each server as <code>clustered</code>
+     and we need to define a <code>cluster-connection</code> in <code>broker.xml</code>.</p>
+     <p>The <code>cluster-connection</code> tells the nodes what other nodes to make connections to.
+     With a <code>cluster-connection</code> each node that we connect to can either be specified
+     indivually, or we can use UDP discovery to find out what other nodes are in the cluster.</p>
+     <p>Using UDP discovery makes configuration simpler since we don't have to know what nodes are
+     available at any one time.</p>
+     <p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster
+     with the other nodes:</p>
+     <pre class="prettyprint">
+     <code>
+   &lt;cluster-connection name="my-cluster"&gt;
+      &lt;address&gt;jms&lt;/address&gt;
+      &lt;connector-ref>netty-connector&lt;/connector-ref>
+	   &lt;retry-interval&gt;500&lt;/retry-interval&gt;
+	   &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
+	   &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
+	   &lt;max-hops&gt;1&lt;/max-hops&gt;
+	   &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
+   &lt;/cluster-connection&gt;
+   </code>
+     </pre>
+     <p>In this example we create a symmetric cluster of six live nodes, and we also pair each live node
+     with it's own backup node. (A backup node is not strictly necessary for a symmetric cluster).</p>
+    <p>In this example will we will demonstrate this by deploying a JMS topic and Queue on all nodes of the cluster
+     , sending messages to the queue and topic from different nodes, and verifying messages are received correctly
+     by consumers on different nodes.</p>
+    <p>For more information on configuring ActiveMQ Artemis clustering in general, please see the clustering
+     section of the user manual.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java b/examples/features/clustered/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java
new file mode 100644
index 0000000..1163ec8
--- /dev/null
+++ b/examples/features/clustered/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java
@@ -0,0 +1,222 @@
+/*
+ * 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.jms.Topic;
+
+import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory;
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.api.jms.JMSFactoryType;
+
+/**
+ * This example demonstrates a cluster of three nodes set up in a symmetric topology - i.e. each
+ * node is connected to every other node in the cluster. Also each node, has it's own backup node.
+ * <p>
+ * This is probably the most obvious clustering topology and the one most people will be familiar
+ * with from using clustering in an app server, where every node has pretty much identical
+ * configuration to every other node.
+ * <p>
+ * By clustering nodes symmetrically, ActiveMQ Artemis can give the impression of clustered queues, topics
+ * and durable subscriptions.
+ * <p>
+ * In this example we send some messages to a distributed queue and topic and kill all the live
+ * servers at different times, and verify that they transparently fail over onto their backup
+ * servers.
+ * <p>
+ * Please see the readme.html file for more information.
+ */
+public class SymmetricClusterExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection0 = null;
+
+      Connection connection1 = null;
+
+      Connection connection2 = null;
+
+      Connection connection3 = null;
+
+      Connection connection4 = null;
+
+      Connection connection5 = null;
+
+      try {
+         // Step 1 - We instantiate a connection factory directly, specifying the UDP address and port for discovering
+         // the list of servers in the cluster.
+         // We could use JNDI to look-up a connection factory, but we'd need to know the JNDI server host and port for
+         // the
+         // specific server to do that, and that server might not be available at the time. By creating the
+         // connection factory directly we avoid having to worry about a JNDI look-up.
+         // In an app server environment you could use HA-JNDI to lookup from the clustered JNDI servers without
+         // having to know about a specific one.
+         UDPBroadcastEndpointFactory udpCfg = new UDPBroadcastEndpointFactory();
+         udpCfg.setGroupAddress("231.7.7.7").setGroupPort(9876);
+         DiscoveryGroupConfiguration groupConfiguration = new DiscoveryGroupConfiguration();
+         groupConfiguration.setBroadcastEndpointFactory(udpCfg);
+
+         ConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithHA(groupConfiguration, JMSFactoryType.CF);
+
+         // We give a little while for each server to broadcast its whereabouts to the client
+         Thread.sleep(2000);
+
+         // Step 2. Directly instantiate JMS Queue and Topic objects
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         Topic topic = ActiveMQJMSClient.createTopic("exampleTopic");
+
+         // Step 3. We create six connections, they should be to different nodes of the cluster in a round-robin fashion
+         // and start them
+         connection0 = cf.createConnection();
+
+         connection1 = cf.createConnection();
+
+         connection2 = cf.createConnection();
+
+         connection3 = cf.createConnection();
+
+         connection4 = cf.createConnection();
+
+         connection5 = cf.createConnection();
+
+         connection0.start();
+
+         connection1.start();
+
+         connection2.start();
+
+         connection3.start();
+
+         connection4.start();
+
+         connection5.start();
+
+         // Step 4. We create a session on each connection
+
+         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         Session session3 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         Session session4 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         Session session5 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 5. We create a topic subscriber on each server
+
+         MessageConsumer subscriber0 = session0.createConsumer(topic);
+
+         MessageConsumer subscriber1 = session1.createConsumer(topic);
+
+         MessageConsumer subscriber2 = session2.createConsumer(topic);
+
+         MessageConsumer subscriber3 = session3.createConsumer(topic);
+
+         MessageConsumer subscriber4 = session4.createConsumer(topic);
+
+         MessageConsumer subscriber5 = session5.createConsumer(topic);
+
+         // Step 6. We create a queue consumer on server 0
+
+         MessageConsumer consumer0 = session0.createConsumer(queue);
+
+         // Step 7. We create an anonymous message producer on just one server 2
+
+         MessageProducer producer2 = session2.createProducer(null);
+
+         // Step 8. We send 500 messages each to the queue and topic
+
+         final int numMessages = 500;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message1 = session2.createTextMessage("Topic message " + i);
+
+            producer2.send(topic, message1);
+
+            TextMessage message2 = session2.createTextMessage("Queue message " + i);
+
+            producer2.send(queue, message2);
+         }
+
+         // Step 9. Verify all subscribers and the consumer receive the messages
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage received0 = (TextMessage) subscriber0.receive(5000);
+
+            if (received0 == null) {
+               throw new IllegalStateException("Message is null!");
+            }
+
+            TextMessage received1 = (TextMessage) subscriber1.receive(5000);
+
+            if (received1 == null) {
+               throw new IllegalStateException("Message is null!");
+            }
+
+            TextMessage received2 = (TextMessage) subscriber2.receive(5000);
+
+            if (received2 == null) {
+               throw new IllegalStateException("Message is null!");
+            }
+
+            TextMessage received3 = (TextMessage) subscriber3.receive(5000);
+
+            if (received3 == null) {
+               throw new IllegalStateException("Message is null!");
+            }
+
+            TextMessage received4 = (TextMessage) subscriber4.receive(5000);
+
+            if (received4 == null) {
+               throw new IllegalStateException("Message is null!");
+            }
+
+            TextMessage received5 = (TextMessage) subscriber5.receive(5000);
+
+            if (received5 == null) {
+               throw new IllegalStateException("Message is null!");
+            }
+
+            TextMessage received6 = (TextMessage) consumer0.receive(5000);
+
+            if (received6 == null) {
+               throw new IllegalStateException("Message is null!");
+            }
+         }
+      }
+      finally {
+         // Step 15. Be sure to close our resources!
+
+         connection0.close();
+         connection1.close();
+         connection2.close();
+         connection3.close();
+         connection4.close();
+         connection5.close();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..cd89de7
--- /dev/null
+++ b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,99 @@
+<?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">
+      <queue name="exampleQueue"/>
+
+      <topic name="exampleTopic"/>
+   </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>
+
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>ON_DEMAND</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!-- Default JMS security -->
+         <security-setting match="jms.#">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..d95a1cd
--- /dev/null
+++ b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,97 @@
+<?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">
+      <queue name="exampleQueue"/>
+
+      <topic name="exampleTopic"/>
+   </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:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>ON_DEMAND</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!-- Default JMS security -->
+         <security-setting match="jms.#">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server2/broker.xml b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server2/broker.xml
new file mode 100644
index 0000000..ef006fd
--- /dev/null
+++ b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server2/broker.xml
@@ -0,0 +1,97 @@
+<?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">
+      <queue name="exampleQueue"/>
+
+      <topic name="exampleTopic"/>
+   </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:61618</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>ON_DEMAND</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!-- Default JMS security -->
+         <security-setting match="jms.#">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server3/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server3/broker.xml b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server3/broker.xml
new file mode 100644
index 0000000..a780ace
--- /dev/null
+++ b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server3/broker.xml
@@ -0,0 +1,97 @@
+<?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">
+      <queue name="exampleQueue"/>
+
+      <topic name="exampleTopic"/>
+   </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:61619</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61619</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>ON_DEMAND</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!-- Default JMS security -->
+         <security-setting match="jms.#">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server4/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server4/broker.xml b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server4/broker.xml
new file mode 100644
index 0000000..20b622e
--- /dev/null
+++ b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server4/broker.xml
@@ -0,0 +1,96 @@
+<?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">
+      <queue name="exampleQueue"/>
+
+      <topic name="exampleTopic"/>
+   </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:61620</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61620</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>ON_DEMAND</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!-- Default JMS security -->
+         <security-setting match="jms.#">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server5/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server5/broker.xml b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server5/broker.xml
new file mode 100644
index 0000000..033af43
--- /dev/null
+++ b/examples/features/clustered/symmetric-cluster/src/main/resources/activemq/server5/broker.xml
@@ -0,0 +1,96 @@
+<?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">
+      <queue name="exampleQueue"/>
+
+      <topic name="exampleTopic"/>
+   </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:61621</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61621</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>ON_DEMAND</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!-- Default JMS security -->
+         <security-setting match="jms.#">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/application-layer-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/application-layer-failover/pom.xml b/examples/features/ha/application-layer-failover/pom.xml
new file mode 100644
index 0000000..c0d9b84
--- /dev/null
+++ b/examples/features/ha/application-layer-failover/pom.xml
@@ -0,0 +1,102 @@
+<?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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>application-layer-failover</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Application Layer Failover Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <portOffset>1</portOffset>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ApplicationLayerFailoverExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>application-layer-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/application-layer-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/ha/application-layer-failover/readme.html b/examples/features/ha/application-layer-failover/readme.html
new file mode 100644
index 0000000..b60a66d
--- /dev/null
+++ b/examples/features/ha/application-layer-failover/readme.html
@@ -0,0 +1,169 @@
+<!--
+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 Application-Layer Failover 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>Application-Layer Failover Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory. This example will always spawn and stop multiple servers.</pre>
+
+     <p>ActiveMQ Artemis implements fully transparent <b>automatic</b> failover of connections from a live node to a backup node which requires
+     no special coding. This is described in a different example and requires server replication.</p>
+     <p>However, ActiveMQ Artemis also supports <b>Application-Layer</b> failover which is useful in the case where replication is not enabled.</p>
+     <p>With Application-Layer failover, it's up to the application to register a JMS ExceptionListener with ActiveMQ Artemis.
+         This listener will then be called by ActiveMQ Artemis in the event that connection failure is detected.</p>
+     <p>User code in the ExceptionListener can then recreate any JMS Connection, Session, etc on another node and the application
+     can continue.</p>
+     <p>Application-Layer failover is an alternative approach to High Availabilty (HA).</p>
+     <p>Application-Layer failover differs from automatic failover in that some client side coding is required in order
+     to implement this. Also, with Application-Layer failover, since the old Session object dies and a new is created, any uncommitted
+     work in the old Session will be lost, and any unacknowledged messages might be redelivered.</p>
+     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
+     section of the user manual.</p>
+
+     <h2>Example step-by-step</h2>
+     <p>In this example, the live server is server 1, which will failover onto server 0.</p>
+     <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
+     on server 0, the new  server. With Application-Layer failover the node that is failed over onto, does not need to
+     be specially configured as a backup server, it can be any node.</p>
+
+     <ol>
+        <li> We create our JMS Connection, Session, MessageProducer and MessageConsumer on server 1</li>
+        <pre class="prettyprint">
+           <code>createJMSObjects(1);</code>
+        </pre>
+
+        <li>We set a JMS ExceptionListener on the connection. On failure this will be called and the connection,
+         session, etc. will be manually recreated on the backup node.</li>
+        <pre class="prettyprint">
+           <code>connection.setExceptionListener(new ExampleListener());</code>
+        </pre>
+
+        <li>We send some messages to server 1, the live server.</li>
+        <pre class="prettyprint">
+           <code>
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++)
+         {
+            TextMessage message = session.createTextMessage("This is text message " + i);
+
+            producer.send(message);
+
+            System.out.println("Sent message: " + message.getText());
+         }
+           </code>
+        </pre>
+
+        <li>We consume those messages on server 1.</li>
+        <pre class="prettyprint">
+          <code>
+          for (int i = 0; i < numMessages; i++)
+         {
+            TextMessage message0 = (TextMessage)consumer.receive(5000);
+
+            System.out.println("Got message: " + message0.getText());
+         }
+          </code>
+        </pre>
+
+        <li>We now cause server 1, the live server to crash. After a little while the connection's
+            ExceptionListener will register the failure and reconnection will occur.</li>
+        <pre class="prettyprint">
+           <code>killServer(1);</code>
+        </pre>
+
+        <li>The connection's ExceptionListener gets called, and we lookup the JMS objects and
+        recreate the connection, session, etc on the other node 0.</li>
+        <pre class="prettyprint">
+           <code>
+   private class ExampleListener implements ExceptionListener
+   {
+      public void onException(JMSException exception)
+      {
+         try
+         {
+            // Close the old resources
+
+            closeResources();
+
+            // Create new JMS objects on the backup server
+
+            createJMSObjects(0);
+
+            failoverLatch.countDown();
+         }
+         catch (Exception e)
+         {
+            System.err.println("Failed to handle failover");
+
+            e.printStackTrace();
+         }
+      }
+   }
+           </code>
+        </pre>
+
+        <li>We are now connected to the other node. We now send some more messages.</li>
+        <pre class="prettyprint">
+           <code>
+   for (int i = numMessages; i < numMessages * 2; i++)
+         {
+            TextMessage message = session.createTextMessage("This is text message " + i);
+
+            producer.send(message);
+
+            System.out.println("Sent message: " + message.getText());
+         }
+           </code>
+        </pre>
+
+        <li>And consume them.</li>
+        <pre class="prettyprint">
+           <code>
+   for (int i = 0; i < numMessages; i++)
+         {
+            TextMessage message0 = (TextMessage)consumer.receive(5000);
+
+            System.out.println("Got message: " + message0.getText());
+         }
+           </code>
+        </pre>
+
+
+        <li>And finally (no pun intended), <b>always</b> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
+
+        <pre class="prettyprint">
+           <code>
+	finally
+	{
+	   closeResources();
+	}
+           </code>
+        </pre>
+
+     </ol>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java b/examples/features/ha/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java
new file mode 100644
index 0000000..2d0dc0c
--- /dev/null
+++ b/examples/features/ha/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java
@@ -0,0 +1,221 @@
+/*
+ * 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.ExceptionListener;
+import javax.jms.JMSException;
+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 javax.naming.NamingException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.util.ServerUtil;
+
+/**
+ * A simple example that demonstrates application-layer failover of the JMS connection from one node to another
+ * when the live server crashes
+ */
+public class ApplicationLayerFailoverExample {
+
+   private static InitialContext initialContext;
+
+   private static Connection connection;
+
+   private static Session session;
+
+   private static MessageConsumer consumer;
+
+   private static MessageProducer producer;
+
+   private static final CountDownLatch failoverLatch = new CountDownLatch(1);
+
+   private static Process server0;
+
+   private static Process server1;
+
+   public static void main(final String[] args) throws Exception {
+      try {
+         server0 = ServerUtil.startServer(args[0], ApplicationLayerFailoverExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], ApplicationLayerFailoverExample.class.getSimpleName() + "1", 1, 5000);
+
+         // Step 1. We create our JMS Connection, Session, MessageProducer and MessageConsumer on server 1.
+         createJMSObjects(0);
+
+         // Step 2. We set a JMS ExceptionListener on the connection. On failure this will be called and the connection,
+         // session, etc. will be then recreated on the backup node.
+         connection.setExceptionListener(new ExampleListener());
+
+         System.out.println("The initial JMS objects have been created, and the ExceptionListener set");
+
+         // Step 3. We send some messages to server 1, the live server
+
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session.createTextMessage("This is text message " + i);
+
+            producer.send(message);
+
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 4. We consume those messages on server 1.
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message0 = (TextMessage) consumer.receive(5000);
+
+            System.out.println("Got message: " + message0.getText());
+         }
+
+         // Step 5. We now cause server 1, the live server to crash. After a little while the connection's
+         // ExceptionListener will register the failure and reconnection will occur.
+
+         System.out.println("Killing the server");
+
+         ServerUtil.killServer(server0);
+
+         // Step 6. Wait for the client side to register the failure and reconnect
+
+         boolean ok = failoverLatch.await(5000, TimeUnit.MILLISECONDS);
+
+         System.out.println("Reconnection has occurred. Now sending more messages.");
+
+         // Step 8. We now send some more messages
+
+         for (int i = numMessages; i < numMessages * 2; i++) {
+            TextMessage message = session.createTextMessage("This is text message " + i);
+
+            producer.send(message);
+
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 9. And consume them.
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message0 = (TextMessage) consumer.receive(5000);
+
+            System.out.println("Got message: " + message0.getText());
+         }
+      }
+      catch (Throwable t) {
+         t.printStackTrace();
+      }
+      finally {
+         // Step 14. Be sure to close our resources!
+         closeResources();
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
+      }
+   }
+
+   private static void createJMSObjects(final int server) throws Exception {
+      // Step 1. Instantiate a JMS Connection Factory object from JNDI on server 1
+      ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://127.0.0.1:" + (61616 + server));
+
+      // Step 2. We create a JMS Connection connection
+      connection = connectionFactory.createConnection();
+
+      // Step 3. We start the connection to ensure delivery occurs
+      connection.start();
+
+      // Step 4. We create a JMS Session
+      session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+      // Step 5. Look-up the JMS Queue object from JNDI
+      Queue queue = session.createQueue("exampleQueue");
+
+      // Step 6. We create a JMS MessageConsumer object
+      consumer = session.createConsumer(queue);
+
+      // Step 7. We create a JMS MessageProducer object
+      producer = session.createProducer(queue);
+   }
+
+   private static void closeResources() {
+      if (initialContext != null) {
+         try {
+            initialContext.close();
+         }
+         catch (NamingException e) {
+            e.printStackTrace();
+         }
+      }
+
+      if (connection != null) {
+         try {
+            connection.close();
+         }
+         catch (JMSException e) {
+            e.printStackTrace();
+         }
+      }
+   }
+
+   private static class ExampleListener implements ExceptionListener {
+
+      public void onException(final JMSException exception) {
+         try {
+            connection.close();
+         }
+         catch (JMSException e) {
+            //ignore
+         }
+         for (int i = 0; i < 10; i++) {
+            try {
+               // Step 7. The ExceptionListener gets called and we recreate the JMS objects on the new node
+
+               System.out.println("Connection failure has been detected on a the client.");
+
+               // Close the old resources
+
+               // closeResources();
+
+               System.out.println("The old resources have been closed.");
+
+               // Create new JMS objects on the backup server
+
+               createJMSObjects(1);
+
+               System.out.println("The new resources have been created.");
+
+               failoverLatch.countDown();
+
+               return;
+            }
+            catch (Exception e) {
+               System.out.println("Failed to handle failover, trying again.");
+               try {
+                  Thread.sleep(500);
+               }
+               catch (InterruptedException e1) {
+                  //ignored
+               }
+            }
+         }
+         System.out.println("tried 10 times to reconnect, giving up");
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/client-side-failoverlistener/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/client-side-failoverlistener/pom.xml b/examples/features/ha/client-side-failoverlistener/pom.xml
new file mode 100644
index 0000000..03101ac
--- /dev/null
+++ b/examples/features/ha/client-side-failoverlistener/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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>client-side-fileoverlistener</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Client Side Failover listener Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <dataFolder>../shared</dataFolder>
+                     <sharedStore>true</sharedStore>
+                     <slave>false</slave>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <dataFolder>../shared</dataFolder>
+                     <sharedStore>true</sharedStore>
+                     <slave>true</slave>
+                     <portOffset>1</portOffset>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ClientSideFailoverListerExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>client-side-fileoverlistener</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/client-side-failoverlistener/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/ha/client-side-failoverlistener/readme.html b/examples/features/ha/client-side-failoverlistener/readme.html
new file mode 100644
index 0000000..3fe1f4d
--- /dev/null
+++ b/examples/features/ha/client-side-failoverlistener/readme.html
@@ -0,0 +1,37 @@
+<!--
+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 Client Side Failover Listener 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>Client Side Kickoff Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory. This example will always spawn and stop multiple servers.</pre>
+
+     <p>This example demonstrates how you can listen on failover event on the client side.</p>
+
+     <p>In this example there are two nodes running in a cluster, both server will be running for start,
+        but after a while the first server will crash. This will trigger a fail-over event.</p>
+
+  </body>
+</html>


[24/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/ExampleVerticle.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/ExampleVerticle.java b/examples/broker-features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/ExampleVerticle.java
deleted file mode 100644
index ac6ccdc..0000000
--- a/examples/broker-features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/ExampleVerticle.java
+++ /dev/null
@@ -1,54 +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.core.example;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.vertx.java.core.Handler;
-import org.vertx.java.core.eventbus.EventBus;
-import org.vertx.java.core.eventbus.Message;
-import org.vertx.java.platform.Verticle;
-
-public class ExampleVerticle extends Verticle {
-
-   @Override
-   public void start() {
-      EventBus eventBus = vertx.eventBus();
-
-      final CountDownLatch latch0 = new CountDownLatch(1);
-
-      // Register a handler on the outgoing connector's address
-      eventBus.registerHandler(VertxConnectorExample.OUTGOING, new Handler<Message<?>>() {
-         @Override
-         public void handle(Message<?> startMsg) {
-            Object body = startMsg.body();
-            System.out.println("Verticle receives a message: " + body);
-            VertxConnectorExample.result.set(VertxConnectorExample.MSG.equals(body));
-            latch0.countDown();
-            //Tell the example to finish.
-            VertxConnectorExample.latch.countDown();
-         }
-      });
-
-      try {
-         latch0.await(5000, TimeUnit.MILLISECONDS);
-      }
-      catch (InterruptedException e) {
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/VertxConnectorExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/VertxConnectorExample.java b/examples/broker-features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/VertxConnectorExample.java
deleted file mode 100644
index e7f6d62..0000000
--- a/examples/broker-features/sub-modules/vertx/src/main/java/org/apache/activemq/artemis/core/example/VertxConnectorExample.java
+++ /dev/null
@@ -1,105 +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.core.example;
-
-import java.net.URL;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.vertx.java.core.AsyncResult;
-import org.vertx.java.core.Handler;
-import org.vertx.java.core.eventbus.EventBus;
-import org.vertx.java.platform.PlatformLocator;
-import org.vertx.java.platform.PlatformManager;
-import org.vertx.java.spi.cluster.impl.hazelcast.HazelcastClusterManagerFactory;
-
-/**
- * A simple example of using Vert.x connector service.
- */
-public class VertxConnectorExample {
-
-   public static final String INCOMING = "incoming.vertx.address";
-   public static final String OUTGOING = "outgoing.vertx.address";
-   public static final String MSG = "Welcome to Vertx world!";
-
-   public static final CountDownLatch latch = new CountDownLatch(1);
-   public static final AtomicBoolean result = new AtomicBoolean(false);
-
-   private static final String HOST = "127.0.0.1";
-   private static final int PORT = 0;
-
-   public static void main(final String[] args) throws Exception {
-      System.setProperty("vertx.clusterManagerFactory", HazelcastClusterManagerFactory.class.getName());
-      PlatformManager platformManager = null;
-
-      try {
-         // Step 1 Create a Vert.x PlatformManager
-         platformManager = PlatformLocator.factory.createPlatformManager(PORT, HOST);
-
-         final CountDownLatch latch0 = new CountDownLatch(1);
-
-         // Step 2 Deploy a Verticle to receive message
-         String verticle = "org.apache.activemq.artemis.core.example.ExampleVerticle";
-         platformManager.deployVerticle(verticle, null, new URL[0], 1, null, new Handler<AsyncResult<String>>() {
-
-            @Override
-            public void handle(AsyncResult<String> result) {
-               if (!result.succeeded()) {
-                  throw new RuntimeException("failed to deploy verticle", result.cause());
-               }
-               latch0.countDown();
-            }
-
-         });
-
-         latch0.await();
-
-         // Step 3 Send a message to the incoming connector's address
-         EventBus bus = platformManager.vertx().eventBus();
-         bus.send(INCOMING, MSG);
-
-         // Step 4 Waiting for the Verticle to process the message
-         latch.await(10000, TimeUnit.MILLISECONDS);
-      }
-      finally {
-         if (platformManager != null) {
-            platformManager.undeployAll(null);
-            platformManager.stop();
-         }
-         reportResultAndExit();
-      }
-   }
-
-   private static void reportResultAndExit() {
-      if (!result.get()) {
-         System.err.println();
-         System.err.println("#####################");
-         System.err.println("###    FAILURE!   ###");
-         System.err.println("#####################");
-         System.exit(1);
-      }
-      else {
-         System.out.println();
-         System.out.println("#####################");
-         System.out.println("###    SUCCESS!   ###");
-         System.out.println("#####################");
-         System.exit(0);
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/sub-modules/vertx/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/sub-modules/vertx/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/sub-modules/vertx/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 9be6726..0000000
--- a/examples/broker-features/sub-modules/vertx/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?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">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-   <core xmlns="urn:activemq:core">
-      <bindings-directory>target/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>target/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>target/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>target/server0/data/messaging/paging</paging-directory>
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="queue.vertxQueue">
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-      <queues>
-         <queue name="queue.vertxQueue">
-            <address>queue.vertxQueue</address>
-         </queue>
-      </queues>
-
-      <connector-services>
-         <connector-service name="my-incoming-vertx">
-            <factory-class>org.apache.activemq.artemis.integration.vertx.VertxIncomingConnectorServiceFactory</factory-class>
-            <param key="queue" value="queue.vertxQueue"/>
-            <param key="host" value="localhost"/>
-            <param key="port" value="0"/>
-            <param key="vertx-address" value="incoming.vertx.address"/>
-         </connector-service>
-         <connector-service name="my-outgoing-vertx">
-            <factory-class>org.apache.activemq.artemis.integration.vertx.VertxOutgoingConnectorServiceFactory</factory-class>
-            <param key="queue" value="queue.vertxQueue"/>
-            <param key="host" value="localhost"/>
-            <param key="port" value="0"/>
-            <param key="vertx-address" value="outgoing.vertx.address"/>
-         </connector-service>
-      </connector-services>
-   </core>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/client-side-load-balancing/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/client-side-load-balancing/pom.xml b/examples/features/clustered/client-side-load-balancing/pom.xml
new file mode 100644
index 0000000..c2993b2
--- /dev/null
+++ b/examples/features/clustered/client-side-load-balancing/pom.xml
@@ -0,0 +1,196 @@
+<?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.clustered</groupId>
+      <artifactId>broker-clustered</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>client-side-load-balancing</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Client Side Load Balancing 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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <clustered>true</clustered>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <clustered>true</clustered>
+                     <portOffset>1</portOffset>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server2</instance>
+                     <clustered>true</clustered>
+                     <portOffset>2</portOffset>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <spawn>true</spawn>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server2</location>
+                     <testURI>tcp://localhost:61618</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server2</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ClientSideLoadBalancingExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server2</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <artifactId>client-side-load-balancing</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/client-side-load-balancing/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/client-side-load-balancing/readme.html b/examples/features/clustered/client-side-load-balancing/readme.html
new file mode 100644
index 0000000..9d3aba5
--- /dev/null
+++ b/examples/features/clustered/client-side-load-balancing/readme.html
@@ -0,0 +1,49 @@
+<!--
+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 Client-Side Load-Balancing 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 Client-Side Load-Balancing 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 connnections created from a single JMS Connection factory can be created
+     to different nodes of the cluster. In other words it demonstrates how ActiveMQ Artemis does <b>client side load balancing</b> of
+     connections across the cluster.</p>
+     <p>The particular load-balancing policy can be chosen to be random, round-robin or user-defined. Please see the user
+     guide for more details of how to configure the specific load-balancing policy. In this example we will use
+     the default round-robin load balancing policy.</p>
+     <p>The list of servers over which ActiveMQ Artemis will round-robin the connections can either be specified explicitly
+     in the connection factory when instantiating it directly, when configuring it on the server or configured
+     to use UDP discovery to discover the list of servers over which to round-robin. This example will use UDP
+     discovery to obtain the list.</p>
+     <p>This example starts three servers which all broadcast their location using UDP discovery. The UDP broadcast configuration
+     can be seen in the <code>broker.xml</code> file.</p>
+     <p>A JMS ConnectionFactory is deployed on each server specifying the discovery group that will be used by that
+     connection factory.</p>
+     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
+     section of the user manual.</p>
+
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java
----------------------------------------------------------------------
diff --git a/examples/features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java b/examples/features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java
new file mode 100644
index 0000000..1281017
--- /dev/null
+++ b/examples/features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java
@@ -0,0 +1,138 @@
+/*
+ * 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.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+/**
+ * This example demonstrates how sessions created from a single connection can be load
+ * balanced across the different nodes of the cluster.
+ *
+ * In this example there are three nodes and we use a round-robin client side load-balancing
+ * policy.
+ */
+public class ClientSideLoadBalancingExample {
+
+   public static void main(final String[] args) throws Exception {
+      InitialContext initialContext = null;
+
+      Connection connectionA = null;
+      Connection connectionB = null;
+      Connection connectionC = null;
+
+      try {
+         // Step 1. Get an initial context for looking up JNDI from server 0
+         initialContext = new InitialContext();
+
+         // Step 2. Look-up the JMS Queue object from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+
+         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 4. We create 3 JMS connections from the same connection factory. Since we are using round-robin
+         // load-balancing this should result in each sessions being connected to a different node of the cluster
+         Connection conn = connectionFactory.createConnection();
+         // Wait a little while to make sure broadcasts from all nodes have reached the client
+         Thread.sleep(5000);
+         connectionA = connectionFactory.createConnection();
+         connectionB = connectionFactory.createConnection();
+         connectionC = connectionFactory.createConnection();
+         conn.close();
+
+         // Step 5. We create JMS Sessions
+         Session sessionA = connectionA.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         Session sessionB = connectionB.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         Session sessionC = connectionC.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         System.out.println("Session A - " + ((org.apache.activemq.artemis.core.client.impl.DelegatingSession) ((org.apache.activemq.artemis.jms.client.ActiveMQSession) sessionA).getCoreSession()).getConnection().getRemoteAddress());
+         System.out.println("Session B - " + ((org.apache.activemq.artemis.core.client.impl.DelegatingSession) ((org.apache.activemq.artemis.jms.client.ActiveMQSession) sessionB).getCoreSession()).getConnection().getRemoteAddress());
+         System.out.println("Session C - " + ((org.apache.activemq.artemis.core.client.impl.DelegatingSession) ((org.apache.activemq.artemis.jms.client.ActiveMQSession) sessionC).getCoreSession()).getConnection().getRemoteAddress());
+
+         // Step 6. We create JMS MessageProducer objects on the sessions
+         MessageProducer producerA = sessionA.createProducer(queue);
+         MessageProducer producerB = sessionB.createProducer(queue);
+         MessageProducer producerC = sessionC.createProducer(queue);
+
+         // Step 7. We send some messages on each producer
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage messageA = sessionA.createTextMessage("A:This is text message " + i);
+            producerA.send(messageA);
+            System.out.println("Sent message: " + messageA.getText());
+
+            TextMessage messageB = sessionB.createTextMessage("B:This is text message " + i);
+            producerB.send(messageB);
+            System.out.println("Sent message: " + messageB.getText());
+
+            TextMessage messageC = sessionC.createTextMessage("C:This is text message " + i);
+            producerC.send(messageC);
+            System.out.println("Sent message: " + messageC.getText());
+         }
+
+         // Step 8. We start the connection to consume messages
+         connectionA.start();
+         connectionB.start();
+         connectionC.start();
+
+         // Step 9. We consume messages from the 3 session, one at a time.
+         // We try to consume one more message than expected from each session. If
+         // the session were not properly load-balanced, we would be missing a
+         // message from one of the sessions at the end.
+         consume(sessionA, queue, numMessages, "A");
+         consume(sessionB, queue, numMessages, "B");
+         consume(sessionC, queue, numMessages, "C");
+      }
+      finally {
+         // Step 10. Be sure to close our resources!
+
+         if (connectionA != null) {
+            connectionA.close();
+         }
+         if (connectionB != null) {
+            connectionB.close();
+         }
+         if (connectionC != null) {
+            connectionC.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+      }
+   }
+
+   private static void consume(Session session, Queue queue, int numMessages, String node) throws JMSException {
+      MessageConsumer consumer = session.createConsumer(queue);
+
+      for (int i = 0; i < numMessages; i++) {
+         TextMessage message = (TextMessage) consumer.receive(2000);
+         System.out.println("Got message: " + message.getText() + " from node " + node);
+      }
+
+      System.out.println("receive other message from node " + node + ": " + consumer.receive(2000));
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/client-side-load-balancing/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/clustered/client-side-load-balancing/src/main/resources/jndi.properties b/examples/features/clustered/client-side-load-balancing/src/main/resources/jndi.properties
new file mode 100644
index 0000000..d3f932c
--- /dev/null
+++ b/examples/features/clustered/client-side-load-balancing/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=udp://231.7.7.7:9876
+queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-durable-subscription/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-durable-subscription/pom.xml b/examples/features/clustered/clustered-durable-subscription/pom.xml
new file mode 100644
index 0000000..8f28710
--- /dev/null
+++ b/examples/features/clustered/clustered-durable-subscription/pom.xml
@@ -0,0 +1,158 @@
+<?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.clustered</groupId>
+      <artifactId>broker-clustered</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>clustered-durable-subscription</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Clustered Durable Subscription 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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <clustered>true</clustered>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <clustered>true</clustered>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                     <portOffset>1</portOffset>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ClusteredDurableSubscriptionExample
+                     </clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <artifactId>clustered-durable-subscription</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-durable-subscription/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-durable-subscription/readme.html b/examples/features/clustered/clustered-durable-subscription/readme.html
new file mode 100644
index 0000000..d50b2b2
--- /dev/null
+++ b/examples/features/clustered/clustered-durable-subscription/readme.html
@@ -0,0 +1,66 @@
+<!--
+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 Durable Subscription 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 Durable Subscription 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 a clustered JMS durable subscription.
+     Normally durable subscriptions exist on a single node and can only have one subscriber at any one time,
+     however, with ActiveMQ Artemis it's possible to create durable subscription instances with the same name and client-id
+     on different nodes of the cluster, and consume from them simultaneously.
+     This allows the work of processing messages from a durable subscription to be spread across the cluster in
+     a similar way to how JMS Queues can be load balanced across the cluster
+     </p>
+     <p>In this example we first configure the two nodes to form a cluster, then we then create a durable subscriber
+     with the same name and client-id on both nodes, and we create a producer on only one of the nodes.</p>
+     <p>We then send some messages via the producer, and we verify that the messages are round robin'd between
+     the two subscription instances. Note that each durable subscription instance with the same name and client-id
+     <b>does not</b> receive its own copy of the messages. This is because the instances on different nodes form a
+     single "logical" durable subscription, in the same way multiple JMS Queue instances on different nodes
+     form a single "local" JMS Queue</p>
+     <p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
+     JNDI, these could be instantiated directly.
+     <p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster between the two nodes
+     and to load balance the messages between the nodes.</p>
+     <p>The cli create method will define this section by default if you use --clustered as a parameter</p>
+     <pre class="prettyprint">
+     <code>&lt;cluster-connection name="my-cluster"&gt;
+        &lt;address&gt;jms&lt;/address&gt;
+        &lt;retry-interval&gt;500&lt;/retry-interval&gt;
+        &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
+        &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
+        &lt;max-hops&gt;1&lt;/max-hops&gt;
+        &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
+     &lt;/cluster-connection&gt;
+     </code>
+     </pre>
+     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
+     section of the user manual.</p>
+
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java b/examples/features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
new file mode 100644
index 0000000..6af9577
--- /dev/null
+++ b/examples/features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
@@ -0,0 +1,130 @@
+/*
+ * 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.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * A simple example that shows a JMS Durable Subscription across two nodes of a cluster.
+ *
+ * The same durable subscription can exist on more than one node of the cluster, and messages
+ * sent to the topic will be load-balanced in a round-robin fashion between the two nodes
+ */
+public class ClusteredDurableSubscriptionExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection0 = null;
+
+      Connection connection1 = null;
+
+      try {
+         // Step 1. Instantiate the connection factory on server 0
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
+
+         // Step 2. nstantiate the connection factory on server 1
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
+
+         // Step 3. We create a JMS Connection connection0 which is a connection to server 0
+         // and set the client-id
+         connection0 = cf0.createConnection();
+
+         final String clientID = "my-client-id";
+
+         connection0.setClientID(clientID);
+
+         // Step 4. We create a JMS Connection connection1 which is a connection to server 1
+         // and set the same client-id
+         connection1 = cf1.createConnection();
+
+         connection1.setClientID(clientID);
+
+         // Step 5. We create a JMS Session on server 0
+         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 6. We create a JMS Session on server 1
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 7. We start the connections to ensure delivery occurs on them
+         connection0.start();
+
+         connection1.start();
+
+         // Step 8. We create JMS durable subscriptions with the same name and client-id on both nodes
+         // of the cluster
+
+         final String subscriptionName = "my-subscription";
+
+         // Step 9. lookup the topic
+         Topic topic = session0.createTopic("exampleTopic");
+
+         MessageConsumer subscriber0 = session0.createDurableSubscriber(topic, subscriptionName);
+
+         MessageConsumer subscriber1 = session1.createDurableSubscriber(topic, subscriptionName);
+
+         Thread.sleep(1000);
+
+         // Step 10. We create a JMS MessageProducer object on server 0
+         MessageProducer producer = session0.createProducer(topic);
+
+         // Step 11. We send some messages to server 0
+
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session0.createTextMessage("This is text message " + i);
+
+            producer.send(message);
+
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 12. We now consume those messages on *both* server 0 and server 1.
+         // Note that the messages have been load-balanced between the two nodes, with some
+         // messages on node 0 and others on node 1.
+         // The "logical" subscription is distributed across the cluster and contains exactly one copy of all the
+         // messages
+
+         for (int i = 0; i < numMessages; i += 2) {
+            TextMessage message0 = (TextMessage) subscriber0.receive(5000);
+
+            System.out.println("Got message: " + message0.getText() + " from node 0");
+
+            TextMessage message1 = (TextMessage) subscriber1.receive(5000);
+
+            System.out.println("Got message: " + message1.getText() + " from node 1");
+         }
+      }
+      finally {
+         // Step 15. Be sure to close our JMS resources!
+         if (connection0 != null) {
+            connection0.close();
+         }
+
+         if (connection1 != null) {
+            connection1.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..2bfaeae
--- /dev/null
+++ b/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,96 @@
+<?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 topic used by the example-->
+      <topic name="exampleTopic"/>
+   </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>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!--  other configuration -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.topic.exampleTopic">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..8134f27
--- /dev/null
+++ b/examples/features/clustered/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,96 @@
+<?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 topic used by the example-->
+      <topic name="exampleTopic"/>
+   </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:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broacast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!--  other configuration -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.topic.exampleTopic">
+            <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-settings>
+
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-grouping/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-grouping/pom.xml b/examples/features/clustered/clustered-grouping/pom.xml
new file mode 100644
index 0000000..b41a2ad
--- /dev/null
+++ b/examples/features/clustered/clustered-grouping/pom.xml
@@ -0,0 +1,194 @@
+<?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.clustered</groupId>
+      <artifactId>broker-clustered</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>clustered-grouping</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS CLustered Grouping 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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server2</instance>
+                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server2</location>
+                     <testURI>tcp://localhost:61618</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server2</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ClusteredGroupingExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server2</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <artifactId>clustered-grouping</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-grouping/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-grouping/readme.html b/examples/features/clustered/clustered-grouping/readme.html
new file mode 100644
index 0000000..7bce8f2
--- /dev/null
+++ b/examples/features/clustered/clustered-grouping/readme.html
@@ -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.
+-->
+
+<html>
+  <head>
+    <title>ActiveMQ Artemis JMS Clustered Grouping Example</title>
+    <link rel="stylesheet" type="text/css" href="../../../common/common.css">
+  </head>
+  <body>
+     <h1>JMS Clustered Grouping 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 to ensure strict ordering across a cluster using clustered message grouping</p>
+     <p>We create 3 nodes each with a grouping message handler, one with a Local handler and 2 with a Remote handler.</p>
+     <p>The local handler acts as an arbitrator for the 2 remote handlers, holding the information on routes and communicating
+         the routing info with the remote handlers on the other 2 nodes</p>
+     <p>We then send some messages to each node with the same group id set and ensure the same consumer receives all of them</p>
+     <p>Here's the relevant snippet from the server configuration that has the local handler</p>
+     <pre>
+     <code>
+       &lt;cluster-connections&gt;
+          &lt;cluster-connection name="my-cluster"&gt;
+             &lt;address&gt;jms&lt;/address&gt;
+             &lt;connector-ref>netty-connector&lt;/connector-ref>
+             &lt;retry-interval&gt;500&lt;/retry-interval&gt;
+             &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
+             &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
+             &lt;max-hops&gt;1&lt;/max-hops&gt;
+             &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
+          &lt;/cluster-connection&gt;
+       &lt;/cluster-connections&gt;
+
+       &lt;grouping-handler name="my-grouping-handler"&gt;
+          &lt;type&gt;LOCAL&lt;/type&gt;
+          &lt;address&gt;jms&lt;/address&gt;
+          &lt;timeout&gt;5000&lt;/timeout&gt;
+       &lt;/grouping-handler&gt;
+     </code>
+     </pre>
+
+     <p>Here's the relevant snippet from the server configuration that has the remote handlers</p>
+     <pre>
+     <code>
+       &lt;cluster-connections&gt;
+          &lt;cluster-connection name="my-cluster"&gt;
+             &lt;address&gt;jms&lt;/address&gt;
+             &lt;retry-interval&gt;500&lt;/retry-interval&gt;
+             &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
+             &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
+             &lt;max-hops&gt;1&lt;/max-hops&gt;
+             &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
+          &lt;/cluster-connection&gt;
+       &lt;/cluster-connections&gt;
+
+       &lt;grouping-handler name="my-grouping-handler"&gt;
+          &lt;type&gt;REMOTE&lt;/type&gt;
+          &lt;address&gt;jms&lt;/address&gt;
+          &lt;timeout&gt;5000&lt;/timeout&gt;
+       &lt;/grouping-handler&gt;
+     </code>
+     </pre>
+
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java b/examples/features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
new file mode 100644
index 0000000..dfadef5
--- /dev/null
+++ b/examples/features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
@@ -0,0 +1,153 @@
+/*
+ * 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 org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
+ * nodes of the cluster.
+ */
+public class ClusteredGroupingExample {
+
+   public static void main(String[] args) throws Exception {
+      Connection connection0 = null;
+
+      Connection connection1 = null;
+
+      Connection connection2 = null;
+
+      try {
+         // Step 1. We will instantiate the queue object directly on this example
+         //         This could be done through JNDI or JMSession.createQueue
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // Step 2. create a connection factory towards server 0.
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
+
+         // Step 3. create a connection factory towards server 1.
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
+
+         // Step 4.  create a connection factory towards server 2.
+         ConnectionFactory cf2 = new ActiveMQConnectionFactory("tcp://localhost:61618");
+
+         // Step 5. We create a JMS Connection connection0 which is a connection to server 0
+         connection0 = cf0.createConnection();
+
+         // Step 6. We create a JMS Connection connection1 which is a connection to server 1
+         connection1 = cf1.createConnection();
+
+         // Step 7. We create a JMS Connection connection2 which is a connection to server 2
+         connection2 = cf2.createConnection();
+
+         // Step 8. We create a JMS Session on server 0
+         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 9. We create a JMS Session on server 1
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 10. We create a JMS Session on server 2
+         Session session2 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 11. We start the connections to ensure delivery occurs on them
+         connection0.start();
+
+         connection1.start();
+
+         connection2.start();
+
+         // Step 12. We create JMS MessageConsumer objects on server 0
+         MessageConsumer consumer = session0.createConsumer(queue);
+
+         // Step 13. We create a JMS MessageProducer object on server 0, 1 and 2
+         MessageProducer producer0 = session0.createProducer(queue);
+
+         MessageProducer producer1 = session1.createProducer(queue);
+
+         MessageProducer producer2 = session2.createProducer(queue);
+
+         // Step 14. We send some messages to server 0, 1 and 2 with the same groupid set
+
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session0.createTextMessage("This is text message " + i);
+
+            message.setStringProperty("JMSXGroupID", "Group-0");
+
+            producer0.send(message);
+
+            System.out.println("Sent messages: " + message.getText() + " to node 0");
+         }
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session1.createTextMessage("This is text message " + (i + 10));
+
+            message.setStringProperty("JMSXGroupID", "Group-0");
+
+            producer1.send(message);
+
+            System.out.println("Sent messages: " + message.getText() + " to node 1");
+
+         }
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session2.createTextMessage("This is text message " + (i + 20));
+
+            message.setStringProperty("JMSXGroupID", "Group-0");
+
+            producer2.send(message);
+
+            System.out.println("Sent messages: " + message.getText() + " to node 2");
+         }
+
+         // Step 15. We now consume those messages from server 0
+         // We note the messages have all been sent to the same consumer on the same node
+
+         for (int i = 0; i < numMessages * 3; i++) {
+            TextMessage message0 = (TextMessage) consumer.receive(5000);
+
+            System.out.println("Got message: " + message0.getText() + " from node 0");
+
+         }
+      }
+      finally {
+         // Step 17. Be sure to close our resources!
+
+         if (connection0 != null) {
+            connection0.close();
+         }
+
+         if (connection1 != null) {
+            connection1.close();
+         }
+
+         if (connection2 != null) {
+            connection2.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..4520059
--- /dev/null
+++ b/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,105 @@
+<?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>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <grouping-handler name="my-grouping-handler">
+         <type>LOCAL</type>
+         <address>jms</address>
+         <timeout>5000</timeout>
+         <group-timeout>-1</group-timeout>
+         <reaper-period>30000</reaper-period>
+      </grouping-handler>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..4765f7a
--- /dev/null
+++ b/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,102 @@
+<?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:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <grouping-handler name="my-grouping-handler">
+         <type>REMOTE</type>
+         <address>jms</address>
+         <timeout>5000</timeout>
+      </grouping-handler>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml b/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml
new file mode 100644
index 0000000..16bf2eb
--- /dev/null
+++ b/examples/features/clustered/clustered-grouping/src/main/resources/activemq/server2/broker.xml
@@ -0,0 +1,102 @@
+<?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:61618</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <grouping-handler name="my-grouping-handler">
+         <type>REMOTE</type>
+         <address>jms</address>
+         <timeout>5000</timeout>
+      </grouping-handler>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>


[04/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/send-acknowledgements/src/main/java/org/apache/activemq/artemis/jms/example/SendAcknowledgementsExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/send-acknowledgements/src/main/java/org/apache/activemq/artemis/jms/example/SendAcknowledgementsExample.java b/examples/features/standard/send-acknowledgements/src/main/java/org/apache/activemq/artemis/jms/example/SendAcknowledgementsExample.java
new file mode 100644
index 0000000..578d198
--- /dev/null
+++ b/examples/features/standard/send-acknowledgements/src/main/java/org/apache/activemq/artemis/jms/example/SendAcknowledgementsExample.java
@@ -0,0 +1,104 @@
+/*
+ * 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.DeliveryMode;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.naming.InitialContext;
+
+import org.apache.activemq.artemis.api.core.Message;
+import org.apache.activemq.artemis.api.core.client.ClientSession;
+import org.apache.activemq.artemis.api.core.client.SendAcknowledgementHandler;
+import org.apache.activemq.artemis.jms.client.ActiveMQSession;
+
+/**
+ * Asynchronous Send Acknowledgements are an advanced feature of ActiveMQ Artemis which allow you to
+ * receive acknowledgements that messages were successfully received at the server in a separate stream
+ * to the stream of messages being sent to the server.
+ * For more information please see the readme.html file
+ */
+public class SendAcknowledgementsExample {
+
+   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. Define a SendAcknowledgementHandler which will receive asynchronous acknowledgements
+         class MySendAcknowledgementsHandler implements SendAcknowledgementHandler {
+
+            int count = 0;
+
+            public void sendAcknowledged(final Message message) {
+               System.out.println("Received send acknowledgement for message " + count++);
+            }
+         }
+
+         // Step 6. Create a JMS Session
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 7. Set the handler on the underlying core session
+
+         ClientSession coreSession = ((ActiveMQSession) session).getCoreSession();
+
+         coreSession.setSendAcknowledgementHandler(new MySendAcknowledgementsHandler());
+
+         // Step 6. Create a JMS Message Producer
+         MessageProducer producer = session.createProducer(queue);
+
+         producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+         // Step 7. Send 5000 messages, the handler will get called asynchronously some time later after the messages
+         // are sent.
+
+         final int numMessages = 5000;
+
+         for (int i = 0; i < numMessages; i++) {
+            javax.jms.Message jmsMessage = session.createMessage();
+
+            producer.send(jmsMessage);
+
+            System.out.println("Sent message " + i);
+         }
+      }
+      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/6b17d966/examples/features/standard/send-acknowledgements/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/send-acknowledgements/src/main/resources/jndi.properties b/examples/features/standard/send-acknowledgements/src/main/resources/jndi.properties
new file mode 100644
index 0000000..8421f25
--- /dev/null
+++ b/examples/features/standard/send-acknowledgements/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?confirmationWindowSize=1048576
+queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/spring-integration/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/spring-integration/pom.xml b/examples/features/standard/spring-integration/pom.xml
new file mode 100644
index 0000000..238a550
--- /dev/null
+++ b/examples/features/standard/spring-integration/pom.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.
+-->
+
+<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>spring-integration</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Spring Integration Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-spring-integration</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.geronimo.specs</groupId>
+         <artifactId>geronimo-jms_2.0_spec</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.springframework</groupId>
+         <artifactId>spring-context</artifactId>
+      </dependency>
+   </dependencies>
+
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.SpringExample</clientClass>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.broker</groupId>
+                  <artifactId>spring-integration</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/spring-integration/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/spring-integration/readme.html b/examples/features/standard/spring-integration/readme.html
new file mode 100644
index 0000000..a3855d0
--- /dev/null
+++ b/examples/features/standard/spring-integration/readme.html
@@ -0,0 +1,36 @@
+<!--
+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 Spring 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>ActiveMQ Artemis Spring Example</h1>
+
+      <p>This examples shows how to setup and run an embedded JMS server within a Spring ApplicationContext using ActiveMQ Artemis along with ActiveMQ Artemis configuration files.</p>
+
+      <h2>Example step-by-step</h2>
+      <p><i><b>YOU MUST DOWNLOAD THE SPRING LIBRARIES TO RUN THIS EXAMPLE!!!</b>  You must also modify the build.xml file to include the spring jars.  You'll see the placeholder that is already there.</i></p>
+      <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/ExampleListener.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/ExampleListener.java b/examples/features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/ExampleListener.java
new file mode 100644
index 0000000..3d4e063
--- /dev/null
+++ b/examples/features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/ExampleListener.java
@@ -0,0 +1,37 @@
+/*
+ * 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.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.TextMessage;
+
+public class ExampleListener implements MessageListener {
+
+   protected static String lastMessage = null;
+
+   public void onMessage(Message message) {
+      try {
+         lastMessage = ((TextMessage) message).getText();
+      }
+      catch (JMSException e) {
+         throw new RuntimeException(e);
+      }
+      System.out.println("MESSAGE RECEIVED: " + lastMessage);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/MessageSender.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/MessageSender.java b/examples/features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/MessageSender.java
new file mode 100644
index 0000000..594c69b
--- /dev/null
+++ b/examples/features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/MessageSender.java
@@ -0,0 +1,71 @@
+/*
+ * 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.Destination;
+import javax.jms.JMSException;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+public class MessageSender {
+
+   private ConnectionFactory connectionFactory;
+   private Destination destination;
+
+   public ConnectionFactory getConnectionFactory() {
+      return connectionFactory;
+   }
+
+   public void setConnectionFactory(ConnectionFactory connectionFactory) {
+      this.connectionFactory = connectionFactory;
+   }
+
+   public Destination getDestination() {
+      return destination;
+   }
+
+   public void setDestination(Destination destination) {
+      this.destination = destination;
+   }
+
+   public void send(String msg) {
+      Connection conn = null;
+      try {
+         conn = connectionFactory.createConnection();
+         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer producer = session.createProducer(destination);
+         TextMessage message = session.createTextMessage(msg);
+         producer.send(message);
+      }
+      catch (Exception ex) {
+         ex.printStackTrace();
+      }
+      finally {
+         if (conn != null) {
+            try {
+               conn.close();
+            }
+            catch (JMSException e) {
+               e.printStackTrace();
+            }
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/SpringExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/SpringExample.java b/examples/features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/SpringExample.java
new file mode 100644
index 0000000..cf3ec49
--- /dev/null
+++ b/examples/features/standard/spring-integration/src/main/java/org/apache/activemq/artemis/jms/example/SpringExample.java
@@ -0,0 +1,32 @@
+/*
+ * 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 org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class SpringExample {
+
+   public static void main(String[] args) throws Exception {
+      System.out.println("Creating bean factory...");
+      ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"spring-jms-beans.xml"});
+      MessageSender sender = (MessageSender) context.getBean("MessageSender");
+      System.out.println("Sending message...");
+      sender.send("Hello world");
+      Thread.sleep(100);
+      context.destroy();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/spring-integration/src/main/resources/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/spring-integration/src/main/resources/artemis-roles.properties b/examples/features/standard/spring-integration/src/main/resources/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/spring-integration/src/main/resources/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/spring-integration/src/main/resources/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/spring-integration/src/main/resources/artemis-users.properties b/examples/features/standard/spring-integration/src/main/resources/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/spring-integration/src/main/resources/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/6b17d966/examples/features/standard/spring-integration/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/spring-integration/src/main/resources/broker.xml b/examples/features/standard/spring-integration/src/main/resources/broker.xml
new file mode 100644
index 0000000..2970329
--- /dev/null
+++ b/examples/features/standard/spring-integration/src/main/resources/broker.xml
@@ -0,0 +1,53 @@
+<?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">
+
+      <persistence-enabled>false</persistence-enabled>
+
+      <acceptors>
+         <acceptor name="in-vm">vm://0</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="#">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/spring-integration/src/main/resources/spring-jms-beans.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/spring-integration/src/main/resources/spring-jms-beans.xml b/examples/features/standard/spring-integration/src/main/resources/spring-jms-beans.xml
new file mode 100644
index 0000000..a67de73
--- /dev/null
+++ b/examples/features/standard/spring-integration/src/main/resources/spring-jms-beans.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
+
+   <bean id="securityManager" class="org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl">
+      <constructor-arg>
+         <bean class="org.apache.activemq.artemis.core.config.impl.SecurityConfiguration">
+            <constructor-arg name="users">
+               <map>
+                  <entry key="guest" value="guest"/>
+               </map>
+            </constructor-arg>
+            <constructor-arg name="roles">
+               <map>
+                  <entry key="guest">
+                     <list>
+                        <value>guest</value>
+                     </list>
+                  </entry>
+               </map>
+            </constructor-arg>
+            <property name="DefaultUser" value="guest"/>
+         </bean>
+      </constructor-arg>
+   </bean>
+
+   <bean id="EmbeddedJms" class="org.apache.activemq.artemis.integration.spring.SpringJmsBootstrap" init-method="start"
+         destroy-method="stop">
+       <property name="SecurityManager" ref="securityManager"/>
+   </bean>
+
+   <bean id="connectionFactory" class="org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory">
+      <constructor-arg value="false"/>
+      <constructor-arg>
+         <bean class="org.apache.activemq.artemis.api.core.TransportConfiguration">
+            <constructor-arg value="org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory"/>
+         </bean>
+      </constructor-arg>
+   </bean>
+
+   <bean id="exampleQueue" class="org.apache.activemq.artemis.jms.client.ActiveMQQueue">
+      <constructor-arg index="0" value="exampleQueue"/>
+   </bean>
+
+   <bean id="listener" class="org.apache.activemq.artemis.jms.example.ExampleListener"/>
+
+   <bean id="MessageSender" class="org.apache.activemq.artemis.jms.example.MessageSender">
+      <property name="connectionFactory" ref="connectionFactory"/>
+      <property name="destination" ref="exampleQueue"/>
+   </bean>
+
+   <bean id="listenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
+      <property name="connectionFactory" ref="connectionFactory"/>
+      <property name="destination" ref="exampleQueue"/>
+      <property name="messageListener" ref="listener"/>
+   </bean>
+</beans>
+

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/ssl-enabled/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/ssl-enabled/pom.xml b/examples/features/standard/ssl-enabled/pom.xml
new file mode 100644
index 0000000..7a76435
--- /dev/null
+++ b/examples/features/standard/ssl-enabled/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>ssl-enabled</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS SSL Enabled 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>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <testURI>tcp://localhost:5500?sslEnabled=true&amp;trustStorePath=activemq/server0/activemq.example.truststore&amp;trustStorePassword=activemqexample</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.SSLExample</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>ssl-enabled</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/ssl-enabled/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/ssl-enabled/readme.html b/examples/features/standard/ssl-enabled/readme.html
new file mode 100644
index 0000000..bb5e724
--- /dev/null
+++ b/examples/features/standard/ssl-enabled/readme.html
@@ -0,0 +1,56 @@
+<!--
+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 SSL 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 SSL 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 configure SSL with ActiveMQ Artemis to send and receive message. </p>
+
+     <p>Using SSL can make your messaging applications interact with ActiveMQ Artemis securely. An application can
+     be secured transparently without extra coding effort. To secure your messaging application with SSL, you need to configure connector and acceptor as follows:</p>
+
+     <p>
+        <pre class="prettyprint">
+           <code>
+      &lt;!-- Connector --&gt;
+
+      &lt;connector name=&quot;netty-ssl-connector&quot;&gt;tcp://localhost:5500?sslEnabled=true;keyStorePath=activemq/server0/activemq.example.keystore;keyStorePassword=activemqexample&lt;/connector&gt;
+
+      &lt;!-- Acceptor --&gt;
+
+      &lt;acceptor name=&quot;netty-ssl-acceptor&quot;&gt;tcp://localhost:5500?sslEnabled=true;keyStorePath=activemq/server0/activemq.example.keystore;keyStorePassword=activemqexample&lt;/acceptor&gt;
+
+           </code>
+        </pre>
+     </p>
+
+     <p>In the configuration, the activemq.example.keystore is the key store file holding the server's certificate. The activemq.example.truststore
+     is the file holding the certificates which the client trusts (i.e. the server's certificate exported from activemq.example.keystore). They are pre-generated for illustration purpose<a id="fnr1" href="readme.html#fn1"><sup>1</sup></a>.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/ssl-enabled/src/main/java/org/apache/activemq/artemis/jms/example/SSLExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/ssl-enabled/src/main/java/org/apache/activemq/artemis/jms/example/SSLExample.java b/examples/features/standard/ssl-enabled/src/main/java/org/apache/activemq/artemis/jms/example/SSLExample.java
new file mode 100644
index 0000000..27bf739
--- /dev/null
+++ b/examples/features/standard/ssl-enabled/src/main/java/org/apache/activemq/artemis/jms/example/SSLExample.java
@@ -0,0 +1,86 @@
+/*
+ * 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 uses SSL secure transport.
+ */
+public class SSLExample {
+
+   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());
+
+         initialContext.close();
+      }
+      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/6b17d966/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.keystore
----------------------------------------------------------------------
diff --git a/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.keystore b/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.keystore
new file mode 100644
index 0000000..50de681
Binary files /dev/null and b/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.keystore differ

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.truststore
----------------------------------------------------------------------
diff --git a/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.truststore b/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.truststore
new file mode 100644
index 0000000..129391a
Binary files /dev/null and b/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/activemq.example.truststore differ

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/ssl-enabled/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/ssl-enabled/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/6b17d966/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..f0de0fc
--- /dev/null
+++ b/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,60 @@
+<?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.dir}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-ssl-acceptor">tcp://localhost:5500?sslEnabled=true;keyStorePath=activemq/server0/activemq.example.keystore;keyStorePassword=activemqexample</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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/ssl-enabled/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/ssl-enabled/src/main/resources/jndi.properties b/examples/features/standard/ssl-enabled/src/main/resources/jndi.properties
new file mode 100644
index 0000000..7929c7c
--- /dev/null
+++ b/examples/features/standard/ssl-enabled/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:5500?sslEnabled=true&trustStorePath=activemq/server0/activemq.example.truststore&trustStorePassword=activemqexample
+queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/static-selector/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/static-selector/pom.xml b/examples/features/standard/static-selector/pom.xml
new file mode 100644
index 0000000..1ce08e6
--- /dev/null
+++ b/examples/features/standard/static-selector/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>static-selector</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis Static Selector 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>
+                     <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.StaticSelectorExample</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>static-selector</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/static-selector/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/static-selector/readme.html b/examples/features/standard/static-selector/readme.html
new file mode 100644
index 0000000..0dca49f
--- /dev/null
+++ b/examples/features/standard/static-selector/readme.html
@@ -0,0 +1,60 @@
+<!--
+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 Static Message Selector 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>Static Message Selector Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
+     <p>This example shows you how to configure a ActiveMQ Artemis queue with static message selectors (filters)
+        (to configure a static selector directly on a <em>JMS</em> queue, please see the
+        <a href="../static-selector-jms/readme.html">static-selector-jms example</a>).</p>
+
+     <p>Static message selectors are ActiveMQ's extension to message selectors as defined in JMS spec 1.1.
+     Rather than specifying the selector in the application code, static message selectors are defined in one of
+     ActiveMQ's configuration files, broker.xml, as an element called 'filter' inside each queue
+     definition, like</p>
+
+     <pre class="prettyprint"><code>
+      &lt;queues&gt;
+      	&lt;queue name=&quot;jms.queue.selectorQueue&quot;&gt;
+      	    &lt;address&gt;jms.queue.selectorQueue&lt;/address&gt;
+      	    &lt;filter string=&quot;color='red'&quot;/&gt;
+      	&lt;/queue&gt;
+      &lt;/queues&gt;
+     </code></pre>
+
+     <p>Once configured the queue 'selectorQueue' only delivers messages that are selected against the filter, i.e.,
+     only the messages whose 'color' properties are of 'red' values can be received by its consumers. Those that don't match
+     the filter will be dropped by the queue and therefore will never be delivered to any of its consumers.</p>
+
+     <p>In the example code, five messages with different 'color' property values are sent to queue 'selectorQueue'. One consumer
+     is created to receive messages from the queue. Of the five sent messages, two are of 'red' color properties, one is 'blue',
+     one is 'green' and one has not the 'color' property at all. The result is that the consumer only gets the two 'red' messages.</p>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/static-selector/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/static-selector/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorExample.java b/examples/features/standard/static-selector/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorExample.java
new file mode 100644
index 0000000..08f9db9
--- /dev/null
+++ b/examples/features/standard/static-selector/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorExample.java
@@ -0,0 +1,137 @@
+/*
+ * 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 shows how static message selectors work.
+ */
+public class StaticSelectorExample {
+
+   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, this is the queue that has filter configured with it.
+         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 6. Create a JMS Session
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         Session producerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 7. Create a JMS Message Producer
+         MessageProducer producer = producerSession.createProducer(queue);
+
+         // Step 8. Create a JMS Message Consumer that receives 'red' messages
+         MessageConsumer redConsumer = session.createConsumer(queue);
+         redConsumer.setMessageListener(new SimpleMessageListener("red", result));
+
+         // Step 9. Create five messages with different 'color' properties
+         TextMessage redMessage1 = session.createTextMessage("Red-1");
+         redMessage1.setStringProperty("color", "red");
+         TextMessage redMessage2 = session.createTextMessage("Red-2");
+         redMessage2.setStringProperty("color", "red");
+         TextMessage greenMessage = session.createTextMessage("Green");
+         greenMessage.setStringProperty("color", "green");
+         TextMessage blueMessage = session.createTextMessage("Blue");
+         blueMessage.setStringProperty("color", "blue");
+         TextMessage normalMessage = session.createTextMessage("No color");
+
+         // Step 10. Send the Messages
+         producer.send(redMessage1);
+         System.out.println("Message sent: " + redMessage1.getText());
+         producer.send(greenMessage);
+         System.out.println("Message sent: " + greenMessage.getText());
+         producer.send(blueMessage);
+         System.out.println("Message sent: " + blueMessage.getText());
+         producer.send(redMessage2);
+         System.out.println("Message sent: " + redMessage2.getText());
+         producer.send(normalMessage);
+         System.out.println("Message sent: " + normalMessage.getText());
+
+         // Step 11. Waiting for the message listener to check the received messages.
+         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 != null && !colorProp.equals(name)) {
+            result.set(false);
+         }
+      }
+      catch (JMSException e) {
+         e.printStackTrace();
+         result.set(false);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/static-selector/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/static-selector/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/static-selector/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/static-selector/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/static-selector/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/static-selector/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/static-selector/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/static-selector/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/6b17d966/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..ca09b3b
--- /dev/null
+++ b/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,67 @@
+<?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.dir}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <queues>
+         <queue name="jms.queue.exampleQueue">
+            <address>jms.queue.exampleQueue</address>
+            <filter string="color='red'"/>
+         </queue>
+      </queues>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/static-selector/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/static-selector/src/main/resources/jndi.properties b/examples/features/standard/static-selector/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/static-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/6b17d966/examples/features/standard/temp-queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/temp-queue/pom.xml b/examples/features/standard/temp-queue/pom.xml
new file mode 100644
index 0000000..624d8ed
--- /dev/null
+++ b/examples/features/standard/temp-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>temp-queue</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Temporary 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>
+                     <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.TemporaryQueueExample</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>temp-queue</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/temp-queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/temp-queue/readme.html b/examples/features/standard/temp-queue/readme.html
new file mode 100644
index 0000000..4b4d5c8
--- /dev/null
+++ b/examples/features/standard/temp-queue/readme.html
@@ -0,0 +1,40 @@
+<!--
+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 Temporary 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 Temporary 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 use a TemporaryQueue with ActiveMQ Artemis. First a temporary queue is created to send and receive a message and then deleted.
+         Then another temporary queue is created and used after its connection is closed to illustrate its scope.</p>
+     <p>A TemporaryQueue is a JMS queue that exists only within the lifetime of its connection. It is often used in request-reply
+         type messaging where the reply is sent through a temporary destination. The temporary queue is often created as
+         a server resource, so after using, the user should call delete() method to release the resources.
+         Please consult the JMS 1.1 specification for full details.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/temp-queue/src/main/java/org/apache/activemq/artemis/jms/example/TemporaryQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/temp-queue/src/main/java/org/apache/activemq/artemis/jms/example/TemporaryQueueExample.java b/examples/features/standard/temp-queue/src/main/java/org/apache/activemq/artemis/jms/example/TemporaryQueueExample.java
new file mode 100644
index 0000000..5747fae
--- /dev/null
+++ b/examples/features/standard/temp-queue/src/main/java/org/apache/activemq/artemis/jms/example/TemporaryQueueExample.java
@@ -0,0 +1,118 @@
+/*
+ * 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.MessageConsumer;
+import javax.jms.MessageProducer;
+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 temporary queues.
+ */
+public class TemporaryQueueExample {
+
+   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. Look-up the JMS connection factory
+         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 3. Create a JMS Connection
+         connection = cf.createConnection();
+
+         // Step 4. Start the connection
+         connection.start();
+
+         // Step 5. Create a JMS session with AUTO_ACKNOWLEDGE mode
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 6. Create a Temporary Queue
+         TemporaryQueue tempQueue = session.createTemporaryQueue();
+
+         System.out.println("Temporary queue is created: " + tempQueue);
+
+         // Step 7. Create a JMS message producer
+         MessageProducer messageProducer = session.createProducer(tempQueue);
+
+         // Step 8. Create a text message
+         TextMessage message = session.createTextMessage("This is a text message");
+
+         // Step 9. Send the text message to the queue
+         messageProducer.send(message);
+
+         System.out.println("Sent message: " + message.getText());
+
+         // Step 11. Create a message consumer
+         MessageConsumer messageConsumer = session.createConsumer(tempQueue);
+
+         // Step 12. Receive the message from the queue
+         message = (TextMessage) messageConsumer.receive(5000);
+
+         System.out.println("Received message: " + message.getText());
+
+         // Step 13. Close the consumer and producer
+         messageConsumer.close();
+         messageProducer.close();
+
+         // Step 14. Delete the temporary queue
+         tempQueue.delete();
+
+         // Step 15. Create another temporary queue.
+         TemporaryQueue tempQueue2 = session.createTemporaryQueue();
+
+         System.out.println("Another temporary queue is created: " + tempQueue2);
+
+         // Step 16. Close the connection.
+         connection.close();
+
+         // Step 17. Create a new connection.
+         connection = cf.createConnection();
+
+         // Step 18. Create a new session.
+         session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 19. Try to access the tempQueue2 outside its lifetime
+         try {
+            messageConsumer = session.createConsumer(tempQueue2);
+            throw new Exception("Temporary queue cannot be accessed outside its lifecycle!");
+         }
+         catch (JMSException e) {
+            System.out.println("Exception got when trying to access a temp queue outside its scope: " + e);
+         }
+      }
+      finally {
+         if (connection != null) {
+            // Step 20. Be sure to close our JMS resources!
+            connection.close();
+         }
+         if (initialContext != null) {
+            // Step 21. Also close the initialContext!
+            initialContext.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..2dd2df9
--- /dev/null
+++ b/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,65 @@
+<?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>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+      <security-settings>
+         <!--security for example queues -->
+         <security-setting match="jms.queue.#">
+            <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 settings for JMS temporary queue -->
+         <security-setting match="jms.tempqueue.#">
+            <permission type="createNonDurableQueue" roles="guest"/>
+            <permission type="deleteNonDurableQueue" roles="guest"/>
+            <permission type="consume" roles="guest"/>
+            <permission type="send" roles="guest"/>
+         </security-setting>
+      </security-settings>
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/temp-queue/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/temp-queue/src/main/resources/jndi.properties b/examples/features/standard/temp-queue/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/temp-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


[29/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/jms-to-rest/postOrder.py
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/jms-to-rest/postOrder.py b/examples/broker-features/standard/rest/jms-to-rest/postOrder.py
deleted file mode 100644
index 3580986..0000000
--- a/examples/broker-features/standard/rest/jms-to-rest/postOrder.py
+++ /dev/null
@@ -1,44 +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.
-import httplib, urlparse
-
-conn = httplib.HTTPConnection("localhost:9095")
-conn.request("HEAD", "/queues/jms.queue.orders")
-res = conn.getresponse()
-createLink = res.getheader("msg-create")
-print createLink
-conn.close()
-
-createParsed = urlparse.urlparse(createLink)
-conn = httplib.HTTPConnection(createParsed.netloc)
-headers = {'Content-Type' : 'application/xml'}
-xml = """<?xml version="1.0"?>
-<order>
-   <name>Bill</name>
-   <amount>$199.99</amount>
-   <item>iPhone4</item>
-</order>"""
-conn.request("POST", createParsed.path, xml, headers)
-res = conn.getresponse()
-print res.status, res.reason
-
-
-
-
-
-
-

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/jms-to-rest/receiveOrder.py
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/jms-to-rest/receiveOrder.py b/examples/broker-features/standard/rest/jms-to-rest/receiveOrder.py
deleted file mode 100644
index ce73f5c..0000000
--- a/examples/broker-features/standard/rest/jms-to-rest/receiveOrder.py
+++ /dev/null
@@ -1,68 +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.
-import httplib, urlparse
-
-conn = httplib.HTTPConnection("localhost:9095")
-conn.request("HEAD", "/queues/jms.queue.orders")
-res = conn.getresponse()
-consumersLink = res.getheader("msg-pull-consumers")
-consumersParsed = urlparse.urlparse(consumersLink)
-conn = httplib.HTTPConnection(consumersParsed.netloc)
-conn.request("POST", consumersParsed.path)
-res = conn.getresponse()
-consumeLink = res.getheader("msg-consume-next")
-session = res.getheader("Location")
-print consumeLink
-conn.close()
-
-headers = {"Accept-Wait" : "3", "Accept" : "application/xml"}
-
-try:
-    print "Waiting..."
-    while True:
-        createParsed = urlparse.urlparse(consumeLink)
-        conn = httplib.HTTPConnection(createParsed.netloc)
-        conn.request("POST", createParsed.path, None, headers)
-        res = conn.getresponse()
-        if res.status == 503:
-            consumeLink = res.getheader("msg-consume-next")
-        elif res.status == 200:
-            print "Success!"
-            data = res.read()
-            print data
-            consumeLink = res.getheader("msg-consume-next")
-            print "Waiting"
-        else:
-            raise Exception('failed')
-finally:
-    if session != None:
-        print "deleting activemq session..."
-        createParsed = urlparse.urlparse(session)
-        conn = httplib.HTTPConnection(createParsed.netloc)
-        conn.request("DELETE", createParsed.path)
-        res = conn.getresponse()
-        
-        
-    
-
-
-
-
-
-
-
-

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/jms-to-rest/src/main/java/JmsHelper.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/jms-to-rest/src/main/java/JmsHelper.java b/examples/broker-features/standard/rest/jms-to-rest/src/main/java/JmsHelper.java
deleted file mode 100644
index ef7a575..0000000
--- a/examples/broker-features/standard/rest/jms-to-rest/src/main/java/JmsHelper.java
+++ /dev/null
@@ -1,38 +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.
- */
-
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
-import org.apache.activemq.artemis.core.config.FileDeploymentManager;
-import org.apache.activemq.artemis.core.config.impl.FileConfiguration;
-import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory;
-
-import javax.jms.ConnectionFactory;
-
-public class JmsHelper {
-
-   public static ConnectionFactory createConnectionFactory(String configFile) throws Exception {
-      FileConfiguration config = new FileConfiguration();
-      FileDeploymentManager deploymentManager = new FileDeploymentManager(configFile);
-      deploymentManager.addDeployable(config);
-      deploymentManager.readConfiguration();
-      TransportConfiguration transport = config.getConnectorConfigurations().get("netty-connector");
-      return new ActiveMQJMSConnectionFactory(ActiveMQClient.createServerLocatorWithoutHA(transport));
-
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java b/examples/broker-features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java
deleted file mode 100644
index d3c05b2..0000000
--- a/examples/broker-features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java
+++ /dev/null
@@ -1,55 +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.
- */
-
-import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
-import org.apache.activemq.artemis.rest.Jms;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.Session;
-
-public class JmsReceive {
-
-   public static void main(String[] args) throws Exception {
-      System.out.println("Receive Setup...");
-      ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml");
-      Destination destination = (ActiveMQDestination) ActiveMQDestination.fromAddress("jms.queue.orders");
-
-      Connection conn = factory.createConnection();
-      try {
-         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageConsumer consumer = session.createConsumer(destination);
-         consumer.setMessageListener(new MessageListener() {
-               @Override
-               public void onMessage(Message message) {
-                  System.out.println("Received Message: ");
-                  Order order = Jms.getEntity(message, Order.class);
-                  System.out.println(order);
-               }
-            });
-         conn.start();
-         Thread.sleep(1000000);
-      }
-      finally {
-         conn.close();
-      }
-   }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/jms-to-rest/src/main/java/JmsSend.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/jms-to-rest/src/main/java/JmsSend.java b/examples/broker-features/standard/rest/jms-to-rest/src/main/java/JmsSend.java
deleted file mode 100644
index bf3370e..0000000
--- a/examples/broker-features/standard/rest/jms-to-rest/src/main/java/JmsSend.java
+++ /dev/null
@@ -1,47 +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.
- */
-
-import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Session;
-
-public class JmsSend {
-
-   public static void main(String[] args) throws Exception {
-      ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml");
-      Destination destination = (ActiveMQDestination) ActiveMQDestination.fromAddress("jms.queue.orders");
-
-      Connection conn = factory.createConnection();
-      try {
-         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageProducer producer = session.createProducer(destination);
-         ObjectMessage message = session.createObjectMessage();
-
-         Order order = new Order("Bill", "$199.99", "iPhone4");
-         message.setObject(order);
-         producer.send(message);
-      }
-      finally {
-         conn.close();
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/jms-to-rest/src/main/java/Order.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/jms-to-rest/src/main/java/Order.java b/examples/broker-features/standard/rest/jms-to-rest/src/main/java/Order.java
deleted file mode 100644
index 2b938f7..0000000
--- a/examples/broker-features/standard/rest/jms-to-rest/src/main/java/Order.java
+++ /dev/null
@@ -1,69 +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.
- */
-
-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/6b17d966/examples/broker-features/standard/rest/jms-to-rest/src/main/java/RestReceive.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/jms-to-rest/src/main/java/RestReceive.java b/examples/broker-features/standard/rest/jms-to-rest/src/main/java/RestReceive.java
deleted file mode 100644
index 4fc493a..0000000
--- a/examples/broker-features/standard/rest/jms-to-rest/src/main/java/RestReceive.java
+++ /dev/null
@@ -1,52 +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.
- */
-
-import org.jboss.resteasy.client.ClientRequest;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.spi.Link;
-
-public class RestReceive {
-
-   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 = pullConsumers.request().formParameter("autoAck", "false").post();
-      Link ackNext = res.getHeaderAsLink("msg-acknowledge-next");
-      res.releaseConnection();
-      while (true) {
-         System.out.println("Waiting...");
-         res = ackNext.request().header("Accept-Wait", "10").header("Accept", "application/xml").post();
-         if (res.getStatus() == 503) {
-            System.out.println("Timeout...");
-            ackNext = res.getHeaderAsLink("msg-acknowledge-next");
-         }
-         else if (res.getStatus() == 200) {
-            Order order = (Order) res.getEntity(Order.class);
-            System.out.println(order);
-            Link ack = res.getHeaderAsLink("msg-acknowledgement");
-            res = ack.request().formParameter("acknowledge", "true").post();
-            ackNext = res.getHeaderAsLink("msg-acknowledge-next");
-         }
-         else {
-            throw new RuntimeException("Failure! " + res.getStatus());
-         }
-         res.releaseConnection();
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/jms-to-rest/src/main/java/RestSend.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/jms-to-rest/src/main/java/RestSend.java b/examples/broker-features/standard/rest/jms-to-rest/src/main/java/RestSend.java
deleted file mode 100644
index 902c4f7..0000000
--- a/examples/broker-features/standard/rest/jms-to-rest/src/main/java/RestSend.java
+++ /dev/null
@@ -1,40 +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.
- */
-
-import org.jboss.resteasy.client.ClientRequest;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.spi.Link;
-
-public class RestSend {
-
-   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 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() != 201)
-         throw new RuntimeException("Failed to post");
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/jms-to-rest/src/main/resources/activemq-client.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/jms-to-rest/src/main/resources/activemq-client.xml b/examples/broker-features/standard/rest/jms-to-rest/src/main/resources/activemq-client.xml
deleted file mode 100644
index 6fe4547..0000000
--- a/examples/broker-features/standard/rest/jms-to-rest/src/main/resources/activemq-client.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?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/6b17d966/examples/broker-features/standard/rest/jms-to-rest/src/main/resources/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/jms-to-rest/src/main/resources/artemis-roles.properties b/examples/broker-features/standard/rest/jms-to-rest/src/main/resources/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/broker-features/standard/rest/jms-to-rest/src/main/resources/artemis-roles.properties
+++ /dev/null
@@ -1,17 +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.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/jms-to-rest/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/jms-to-rest/src/main/resources/broker.xml b/examples/broker-features/standard/rest/jms-to-rest/src/main/resources/broker.xml
deleted file mode 100644
index 8cc0fa6..0000000
--- a/examples/broker-features/standard/rest/jms-to-rest/src/main/resources/broker.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?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="orders"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <persistence-enabled>false</persistence-enabled>
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="in-vm">vm://0</connector>
-      </connectors>
-
-      <acceptors>
-         <acceptor name="in-vm">vm://0</acceptor>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="#">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/jms-to-rest/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/jms-to-rest/src/main/webapp/WEB-INF/web.xml b/examples/broker-features/standard/rest/jms-to-rest/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index e82738a..0000000
--- a/examples/broker-features/standard/rest/jms-to-rest/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?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.
--->
-
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
-        "http://java.sun.com/dtd/web-app_2_3.dtd">
-
-<web-app>
-
-    <filter>
-        <filter-name>Rest-Messaging</filter-name>
-        <filter-class>
-            org.jboss.resteasy.plugins.server.servlet.FilterDispatcher
-        </filter-class>
-    </filter>
-
-    <filter-mapping>
-        <filter-name>Rest-Messaging</filter-name>
-        <url-pattern>/*</url-pattern>
-    </filter-mapping>
-
-    <listener>
-        <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
-    </listener>
-
-    <listener>
-        <listener-class>org.apache.activemq.rest.integration.ActiveMQBootstrapListener</listener-class>
-    </listener>
-
-    <listener>
-        <listener-class>org.apache.activemq.rest.integration.RestMessagingBootstrapListener</listener-class>
-    </listener>
-
-</web-app>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/pom.xml b/examples/broker-features/standard/rest/pom.xml
deleted file mode 100644
index bb6c81e..0000000
--- a/examples/broker-features/standard/rest/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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>
-
-   <groupId>org.apache.activemq.examples.rest</groupId>
-   <artifactId>artemis-rests-pom</artifactId>
-   <packaging>pom</packaging>
-   <name>ActiveMQ Artemis REST Examples</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <modules>
-      <module>javascript-chat</module>
-      <module>jms-to-rest</module>
-      <module>push</module>
-      <module>dup-send</module>
-   </modules>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/push/README.txt
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/push/README.txt b/examples/broker-features/standard/rest/push/README.txt
deleted file mode 100644
index 307e444..0000000
--- a/examples/broker-features/standard/rest/push/README.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-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 having the ActiveMQ Artemis REST interface forward a posted message to a registered URL.
-
-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.  Two queues will be created.  An "order" queue and a "shipping"
-queue.  The server will forward posted messages to the "shipping" queue through a registered push subscription.
-
-Step 2:
-$ mvn exec:java -Dexec.mainClass="ReceiveShipping"
-
-This will bring up a JMS client registers a MessageListener consumer to receive Order objects.  It will automatically
-convert a posted HTTP message into an Order object using JAX-RS content handlers.
-
-Step 3:
-$ mvn exec:java -Dexec.mainClass="PushReg"
-
-This creates a push registration that listens on the "order" queue and forwards messages posted to it to a URL.  This
-URL is the REST resource of the "shipping" queue.
-
-Step 4:
-
-$ mvn exec:java -Dexec.mainClass="PostOrder"
-
-This posts an order to the "order" queue.  You'll see it eventually consumed by the ReceiveShipping process.

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/push/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/push/pom.xml b/examples/broker-features/standard/rest/push/pom.xml
deleted file mode 100644
index 49eba5e..0000000
--- a/examples/broker-features/standard/rest/push/pom.xml
+++ /dev/null
@@ -1,176 +0,0 @@
-<?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>push</artifactId>
-   <packaging>war</packaging>
-   <name>Push Subscriptions</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>
-                     <userRealms>
-                        <userRealm implementation="org.mortbay.jetty.security.HashUserRealm">
-                           <name>Test</name>
-                           <config>${project.build.outputDirectory}/test-realm.properties</config>
-                        </userRealm>
-                     </userRealms>
-                  </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/6b17d966/examples/broker-features/standard/rest/push/src/main/java/JmsHelper.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/push/src/main/java/JmsHelper.java b/examples/broker-features/standard/rest/push/src/main/java/JmsHelper.java
deleted file mode 100644
index add00c2..0000000
--- a/examples/broker-features/standard/rest/push/src/main/java/JmsHelper.java
+++ /dev/null
@@ -1,37 +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.
- */
-
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
-import org.apache.activemq.artemis.core.config.FileDeploymentManager;
-import org.apache.activemq.artemis.core.config.impl.FileConfiguration;
-import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory;
-
-import javax.jms.ConnectionFactory;
-
-public class JmsHelper {
-
-   public static ConnectionFactory createConnectionFactory(String configFile) throws Exception {
-      FileConfiguration config = new FileConfiguration();
-      FileDeploymentManager deploymentManager = new FileDeploymentManager(configFile);
-      deploymentManager.addDeployable(config);
-      deploymentManager.readConfiguration();
-      TransportConfiguration transport = config.getConnectorConfigurations().get("netty-connector");
-      return new ActiveMQJMSConnectionFactory(ActiveMQClient.createServerLocatorWithoutHA(transport));
-
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/push/src/main/java/Order.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/push/src/main/java/Order.java b/examples/broker-features/standard/rest/push/src/main/java/Order.java
deleted file mode 100644
index 2b938f7..0000000
--- a/examples/broker-features/standard/rest/push/src/main/java/Order.java
+++ /dev/null
@@ -1,69 +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.
- */
-
-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/6b17d966/examples/broker-features/standard/rest/push/src/main/java/PostOrder.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/push/src/main/java/PostOrder.java b/examples/broker-features/standard/rest/push/src/main/java/PostOrder.java
deleted file mode 100644
index 96786e6..0000000
--- a/examples/broker-features/standard/rest/push/src/main/java/PostOrder.java
+++ /dev/null
@@ -1,47 +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.
- */
-
-import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Session;
-
-public class PostOrder {
-
-   public static void main(String[] args) throws Exception {
-      ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml");
-      Destination destination = (ActiveMQDestination) ActiveMQDestination.fromAddress("jms.queue.orders");
-
-      Connection conn = factory.createConnection();
-      try {
-         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageProducer producer = session.createProducer(destination);
-         ObjectMessage message = session.createObjectMessage();
-
-         Order order = new Order("Bill", "$199.99", "iPhone4");
-         message.setObject(order);
-         producer.send(message);
-      }
-      finally {
-         conn.close();
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/push/src/main/java/PushReg.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/push/src/main/java/PushReg.java b/examples/broker-features/standard/rest/push/src/main/java/PushReg.java
deleted file mode 100644
index 2567826..0000000
--- a/examples/broker-features/standard/rest/push/src/main/java/PushReg.java
+++ /dev/null
@@ -1,52 +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.
- */
-
-import org.apache.activemq.artemis.rest.queue.push.xml.Authentication;
-import org.apache.activemq.artemis.rest.queue.push.xml.BasicAuth;
-import org.apache.activemq.artemis.rest.queue.push.xml.PushRegistration;
-import org.apache.activemq.artemis.rest.queue.push.xml.XmlLink;
-import org.jboss.resteasy.client.ClientRequest;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.spi.Link;
-
-public class PushReg {
-
-   public static void main(String[] args) throws Exception {
-      // get the push consumers factory resource
-      ClientRequest request = new ClientRequest("http://localhost:9095/queues/jms.queue.orders");
-      ClientResponse res = request.head();
-      Link pushConsumers = res.getHeaderAsLink("msg-push-consumers");
-
-      // next create the XML document that represents the registration
-      // Really, just create a link with the shipping URL and the type you want posted
-      PushRegistration reg = new PushRegistration();
-      BasicAuth authType = new BasicAuth();
-      authType.setUsername("guest");
-      authType.setPassword("guest");
-      Authentication auth = new Authentication();
-      auth.setType(authType);
-      reg.setAuthenticationMechanism(auth);
-      XmlLink target = new XmlLink();
-      target.setHref("http://localhost:9095/queues/jms.queue.shipping");
-      target.setType("application/xml");
-      target.setRelationship("destination");
-      reg.setTarget(target);
-
-      res = pushConsumers.request().body("application/xml", reg).post();
-      System.out.println("Create push registration.  Resource URL: " + res.getLocationLink().getHref());
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/push/src/main/java/ReceiveShipping.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/push/src/main/java/ReceiveShipping.java b/examples/broker-features/standard/rest/push/src/main/java/ReceiveShipping.java
deleted file mode 100644
index 80a3892..0000000
--- a/examples/broker-features/standard/rest/push/src/main/java/ReceiveShipping.java
+++ /dev/null
@@ -1,54 +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.
- */
-
-import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
-import org.apache.activemq.artemis.rest.Jms;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.Session;
-
-public class ReceiveShipping {
-
-   public static void main(String[] args) throws Exception {
-      ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml");
-      Destination destination = (ActiveMQDestination) ActiveMQDestination.fromAddress("jms.queue.shipping");
-
-      Connection conn = factory.createConnection();
-      try {
-         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageConsumer consumer = session.createConsumer(destination);
-         consumer.setMessageListener(new MessageListener() {
-               @Override
-               public void onMessage(Message message) {
-                  System.out.println("Received Message: ");
-                  Order order = Jms.getEntity(message, Order.class);
-                  System.out.println(order);
-               }
-            });
-         conn.start();
-         Thread.sleep(1000000);
-      }
-      finally {
-         conn.close();
-      }
-   }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/push/src/main/resources/activemq-client.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/push/src/main/resources/activemq-client.xml b/examples/broker-features/standard/rest/push/src/main/resources/activemq-client.xml
deleted file mode 100644
index 6fe4547..0000000
--- a/examples/broker-features/standard/rest/push/src/main/resources/activemq-client.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?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/6b17d966/examples/broker-features/standard/rest/push/src/main/resources/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/push/src/main/resources/artemis-roles.properties b/examples/broker-features/standard/rest/push/src/main/resources/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/broker-features/standard/rest/push/src/main/resources/artemis-roles.properties
+++ /dev/null
@@ -1,17 +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.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/push/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/push/src/main/resources/broker.xml b/examples/broker-features/standard/rest/push/src/main/resources/broker.xml
deleted file mode 100644
index 13f2f23..0000000
--- a/examples/broker-features/standard/rest/push/src/main/resources/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?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 queues used by the example-->
-      <queue name="orders"/>
-      <queue name="shipping"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <persistence-enabled>false</persistence-enabled>
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="in-vm">vm://0</connector>
-      </connectors>
-
-      <acceptors>
-         <acceptor name="in-vm">vm://0</acceptor>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="#">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/push/src/main/resources/test-realm.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/push/src/main/resources/test-realm.properties b/examples/broker-features/standard/rest/push/src/main/resources/test-realm.properties
deleted file mode 100644
index 65f2dd9..0000000
--- a/examples/broker-features/standard/rest/push/src/main/resources/test-realm.properties
+++ /dev/null
@@ -1,18 +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.
-
-guest: guest,admin

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/rest/push/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/rest/push/src/main/webapp/WEB-INF/web.xml b/examples/broker-features/standard/rest/push/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index d4ba92b..0000000
--- a/examples/broker-features/standard/rest/push/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?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.
--->
-
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
-        "http://java.sun.com/dtd/web-app_2_3.dtd">
-
-<web-app>
-
-    <filter>
-        <filter-name>Rest-Messaging</filter-name>
-        <filter-class>
-            org.jboss.resteasy.plugins.server.servlet.FilterDispatcher
-        </filter-class>
-    </filter>
-
-    <filter-mapping>
-        <filter-name>Rest-Messaging</filter-name>
-        <url-pattern>/*</url-pattern>
-    </filter-mapping>
-
-    <listener>
-        <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
-    </listener>
-
-    <listener>
-        <listener-class>org.apache.activemq.rest.integration.ActiveMQBootstrapListener</listener-class>
-    </listener>
-
-    <listener>
-        <listener-class>org.apache.activemq.rest.integration.RestMessagingBootstrapListener</listener-class>
-    </listener>
-
-    <security-constraint>
-        <web-resource-collection>
-            <web-resource-name>Resteasy</web-resource-name>
-            <url-pattern>/queues/jms.queue.shipping/*</url-pattern>
-        </web-resource-collection>
-        <auth-constraint>
-            <role-name>admin</role-name>
-        </auth-constraint>
-    </security-constraint>
-
-    <login-config>
-        <auth-method>BASIC</auth-method>
-        <realm-name>Test</realm-name>
-    </login-config>
-
-    <security-role>
-        <role-name>admin</role-name>
-    </security-role>
-
-</web-app>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/scheduled-message/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/scheduled-message/pom.xml b/examples/broker-features/standard/scheduled-message/pom.xml
deleted file mode 100644
index 7447f33..0000000
--- a/examples/broker-features/standard/scheduled-message/pom.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-<?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>scheduled-message</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Scheduled Message Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <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-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>
-                     <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.ScheduledMessageExample</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>scheduled-message</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/scheduled-message/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/scheduled-message/readme.html b/examples/broker-features/standard/scheduled-message/readme.html
deleted file mode 100644
index 9144f94..0000000
--- a/examples/broker-features/standard/scheduled-message/readme.html
+++ /dev/null
@@ -1,134 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Scheduled Message 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 Scheduled Message 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 a scheduled message to a JMS Queue using ActiveMQ Artemis.</p>
-     <p>A Scheduled Message is a message that will be delivered at a time specified by the sender. To do this,
-     simply set a HDR_SCHEDULED_DELIVERY_TIME header property. The value of the property should be the time of
-     delivery in milliseconds. </p>
-
-     <p>In this example, a message is created with the scheduled delivery time set to 5 seconds after the current time.</p>
-
-
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer producer = session.createProducer(queue);</code>
-       </pre>
-
-        <li>We create a JMS text message that we are going to send.</li>
-        <pre class="prettyprint">
-           <code>TextMessage message = session.createTextMessage("This is a scheduled message message which will be delivered in 5 sec.");</code>
-        </pre>
-
-        <li>We schedule the delivery time to be 5 sec later.</li>
-        <pre class="prettyprint">
-           <code>
-            long time = System.currentTimeMillis();
-            time += 5000;
-            message.setLongProperty(MessageImpl.HDR_SCHEDULED_DELIVERY_TIME.toString(), time);
-           </code>
-        </pre>
-
-        <li>We send message to the queue</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message);</code>
-        </pre>
-
-        <li>We create a JMS Message Consumer to receive the message.</li>
-          <pre class="prettyprint">
-           <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We use a blocking receive() to consume the message and see when the message arrives.</li>
-        <pre class="prettyprint">
-           <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive();</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>
-
-     <h2>More information</h2>
-
-     <ul>
-         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#scheduled-messages">Scheduled Messages chapter</a></li>
-     </ul>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/scheduled-message/src/main/java/org/apache/activemq/artemis/jms/example/ScheduledMessageExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/scheduled-message/src/main/java/org/apache/activemq/artemis/jms/example/ScheduledMessageExample.java b/examples/broker-features/standard/scheduled-message/src/main/java/org/apache/activemq/artemis/jms/example/ScheduledMessageExample.java
deleted file mode 100644
index ba86949..0000000
--- a/examples/broker-features/standard/scheduled-message/src/main/java/org/apache/activemq/artemis/jms/example/ScheduledMessageExample.java
+++ /dev/null
@@ -1,94 +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.text.SimpleDateFormat;
-import java.util.Date;
-
-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;
-
-import org.apache.activemq.artemis.api.core.Message;
-
-public class ScheduledMessageExample {
-
-   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 scheduled message message which will be delivered in 5 sec.");
-
-         // Step 8. Set the delivery time to be 5 sec later.
-         long time = System.currentTimeMillis();
-         time += 5000;
-         message.setLongProperty(Message.HDR_SCHEDULED_DELIVERY_TIME.toString(), time);
-
-         // Step 9. Send the Message
-         producer.send(message);
-
-         System.out.println("Sent message: " + message.getText());
-         SimpleDateFormat formatter = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss");
-         System.out.println("Time of send: " + formatter.format(new Date()));
-
-         // Step 10. Create a JMS Message Consumer
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-
-         // Step 11. Start the Connection
-         connection.start();
-
-         // Step 12. Receive the message
-         TextMessage messageReceived = (TextMessage) messageConsumer.receive();
-
-         System.out.println("Received message: " + messageReceived.getText());
-         System.out.println("Time of receive: " + formatter.format(new Date()));
-      }
-      finally {
-         // Step 13. 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/6b17d966/examples/broker-features/standard/scheduled-message/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/scheduled-message/src/main/resources/jndi.properties b/examples/broker-features/standard/scheduled-message/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/scheduled-message/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/security/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/security/pom.xml b/examples/broker-features/standard/security/pom.xml
deleted file mode 100644
index 13976db..0000000
--- a/examples/broker-features/standard/security/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?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>security</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Security 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>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <testUser>bill</testUser>
-                     <testPassword>activemq</testPassword>
-                     <args>
-                        <param>run</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.SecurityExample</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>security</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>


[31/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java b/examples/broker-features/standard/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java
deleted file mode 100644
index a7623bb..0000000
--- a/examples/broker-features/standard/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java
+++ /dev/null
@@ -1,106 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * This example demonstrates how a message producer can be limited to produce messages at a maximum rate
- * specified in messages per sec.
- */
-public class ProducerRateLimitExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection connection = null;
-      try {
-         // Step 2. Perfom a lookup on the queue
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         // Step 3. Perform a lookup on the Connection Factory
-         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?producerMaxRate=50");
-
-         // 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);
-
-         System.out.println("Will now send as many messages as we can in 10 seconds...");
-
-         // Step 7. Send as many messages as we can in 10 seconds
-
-         final long duration = 10000;
-
-         int i = 0;
-
-         long start = System.currentTimeMillis();
-
-         while (System.currentTimeMillis() - start <= duration) {
-            TextMessage message = session.createTextMessage("This is text message: " + i++);
-
-            producer.send(message);
-         }
-
-         long end = System.currentTimeMillis();
-
-         double rate = 1000 * (double) i / (end - start);
-
-         System.out.println("We sent " + i + " messages in " + (end - start) + " milliseconds");
-
-         System.out.println("Actual send rate was " + rate + " messages per second");
-
-         // Step 8. For good measure we consumer the messages we produced.
-
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-
-         connection.start();
-
-         System.out.println("Now consuming the messages...");
-
-         i = 0;
-         while (true) {
-            TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-
-            if (messageReceived == null) {
-               break;
-            }
-
-            i++;
-         }
-
-         System.out.println("Received " + i + " messages");
-      }
-      finally {
-         // Step 9. Be sure to close our resources!
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/producer-rate-limit/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/producer-rate-limit/src/main/resources/jndi.properties b/examples/broker-features/standard/producer-rate-limit/src/main/resources/jndi.properties
deleted file mode 100644
index 0e42b2a..0000000
--- a/examples/broker-features/standard/producer-rate-limit/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616?producerMaxRate=50
-queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/queue-requestor/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/queue-requestor/pom.xml b/examples/broker-features/standard/queue-requestor/pom.xml
deleted file mode 100644
index df59a6a..0000000
--- a/examples/broker-features/standard/queue-requestor/pom.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-<?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-requestor</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Queue Requestor 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>
-               </execution>
-               <execution>
-                  <id>start</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <spawn>true</spawn>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.QueueRequestorExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.broker</groupId>
-                  <artifactId>queue-requestor</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/queue-requestor/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/queue-requestor/readme.html b/examples/broker-features/standard/queue-requestor/readme.html
deleted file mode 100644
index 68a1c95..0000000
--- a/examples/broker-features/standard/queue-requestor/readme.html
+++ /dev/null
@@ -1,46 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS QueueRequestor Example</title>
-    <link rel="stylesheet" type="text/css" href="../../../common/common.css" />
-    <link rel="stylesheet" type="text/css" href="../../../common/prettify.css" />
-    <script type="text/javascript" src="../../../common/prettify.js"></script>
-  </head>
-  <body onload="prettyPrint()">
-     <h1>JMS QueueRequestor Example</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
-
-
-     <p>This example shows you how to use a <a href="http://java.sun.com/javaee/5/docs/api/javax/jms/QueueRequestor.html">QueueRequestor</a> with ActiveMQ Artemis.</p>
-     <p>JMS is mainly used to send messages asynchronously so that the producer of a message is not waiting for the result of the message consumption.
-        However, there are cases where it is necessary to have a synchronous behavior: the code sending a message requires a reply for this message
-        before continuing its execution.<br />
-        A QueueRequestor facilitates this use case by providing a simple request/reply abstraction on top of JMS.</p>
-     <p>The example consists in two classes:</p>
-     <dl>
-         <dt><code>TextReverserService</code></dt>
-         <dd>A JMS MessageListener which consumes text messages and sends replies containing the reversed text</dd>
-         <dt><code>QueueRequestorExample</code></dt>
-         <dd>A JMS Client which uses a QueueRequestor to send text requests to a queue and receive replies with the reversed text in a synchronous fashion</dd>
-    </dl>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/QueueRequestorExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/QueueRequestorExample.java b/examples/broker-features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/QueueRequestorExample.java
deleted file mode 100644
index 607d82f..0000000
--- a/examples/broker-features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/QueueRequestorExample.java
+++ /dev/null
@@ -1,96 +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.JMSException;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueRequestor;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-/**
- * A simple JMS example that shows how to use queues requestors.
- */
-public class QueueRequestorExample {
-
-   public static void main(final String[] args) throws Exception {
-      QueueConnection 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. Look-up the JMS queue connection factory
-         QueueConnectionFactory cf = (QueueConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 4. Create a TextReverserService which consumes messages from the queue and sends message with reversed
-         // text
-         TextReverserService reverserService = new TextReverserService(cf, queue);
-
-         // Step 5. Create a JMS QueueConnection
-         connection = cf.createQueueConnection();
-
-         // Step 6. Start the connection
-         connection.start();
-
-         // Step 7. Create a JMS queue session with AUTO_ACKNOWLEDGE mode
-         QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 8. Create a JMS queue requestor to send requests to the queue
-         QueueRequestor queueRequestor = new QueueRequestor(session, queue);
-
-         // Step 9. Create a JMS message to send as a request
-         TextMessage request = session.createTextMessage("Hello, World!");
-
-         // Step 10. Use the requestor to send the request and wait to receive a reply
-         TextMessage reply = (TextMessage) queueRequestor.request(request);
-
-         // Step 11. The reply's text contains the reversed request's text
-         System.out.println("Send request: " + request.getText());
-         System.out.println("Received reply:" + reply.getText());
-
-         // Step.12 close the queue requestor
-         queueRequestor.close();
-
-         // Step 13. close the text reverser service
-         reverserService.close();
-      }
-      finally {
-         if (connection != null) {
-            try {
-               // Step 14. Be sure to close the JMS resources!
-               connection.close();
-            }
-            catch (JMSException e) {
-               e.printStackTrace();
-            }
-         }
-
-         if (initialContext != null) {
-            // Also the InitialContext
-            initialContext.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/TextReverserService.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/TextReverserService.java b/examples/broker-features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/TextReverserService.java
deleted file mode 100644
index 63fdad2..0000000
--- a/examples/broker-features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/TextReverserService.java
+++ /dev/null
@@ -1,113 +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.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-/**
- * A TextReverserService is a MessageListener which consume text messages from a destination
- * and replies with text messages containing the reversed text.
- * It sends replies to the destination specified by the JMS ReplyTo header of the consumed messages.
- */
-public class TextReverserService implements MessageListener {
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private final Session session;
-
-   private final Connection connection;
-
-   // Static --------------------------------------------------------
-
-   private static String reverse(final String text) {
-      return new StringBuffer(text).reverse().toString();
-   }
-
-   // Constructors --------------------------------------------------
-
-   public TextReverserService(final ConnectionFactory cf, final Destination destination) throws JMSException {
-      // create a JMS connection
-      connection = cf.createConnection();
-      // create a JMS session
-      session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      // create a JMS MessageConsumer to consume message from the destination
-      MessageConsumer consumer = session.createConsumer(destination);
-      // let TextReverter implement MessageListener to consume messages
-      consumer.setMessageListener(this);
-
-      // start the connection to start consuming messages
-      connection.start();
-   }
-
-   // MessageListener implementation --------------------------------
-
-   public void onMessage(final Message request) {
-      TextMessage textMessage = (TextMessage) request;
-      try {
-         // retrieve the request's text
-         String text = textMessage.getText();
-         // create a reply containing the reversed text
-         TextMessage reply = session.createTextMessage(TextReverserService.reverse(text));
-
-         // retrieve the destination to reply to
-         Destination replyTo = request.getJMSReplyTo();
-         // create a producer to send the reply
-         MessageProducer producer = session.createProducer(replyTo);
-         // send the reply
-         producer.send(reply);
-         // close the producer
-         producer.close();
-      }
-      catch (JMSException e) {
-         e.printStackTrace();
-      }
-   }
-
-   // Public --------------------------------------------------------
-
-   public void close() {
-      if (connection != null) {
-         try {
-            // be sure to close the JMS resources
-            connection.close();
-         }
-         catch (JMSException e) {
-            e.printStackTrace();
-         }
-      }
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 6c344c2..0000000
--- a/examples/broker-features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?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.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queues -->
-         <security-setting match="jms.queue.#">
-            <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 settings for JMS temporary queue -->
-         <security-setting match="jms.tempqueue.#">
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/queue-requestor/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/queue-requestor/src/main/resources/jndi.properties b/examples/broker-features/standard/queue-requestor/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/queue-requestor/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/queue-selector/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/queue-selector/pom.xml b/examples/broker-features/standard/queue-selector/pom.xml
deleted file mode 100644
index 9da147c..0000000
--- a/examples/broker-features/standard/queue-selector/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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-selector</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Queue Selector 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>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.QueueSelectorExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.broker</groupId>
-                  <artifactId>queue-selector</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/queue-selector/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/queue-selector/readme.html b/examples/broker-features/standard/queue-selector/readme.html
deleted file mode 100644
index ef63063..0000000
--- a/examples/broker-features/standard/queue-selector/readme.html
+++ /dev/null
@@ -1,52 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Queue Selector 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 Selector Example</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
-
-     <p>This example shows you how to selectively consume messages using message selectors with queue consumers.</p>
-
-     <p>Message selectors are strings with special syntax that can be used in creating consumers. Message consumers
-     created with a message selector will only receive messages that match its selector. On message delivery, the JBoss Message
-     Server evaluates the corresponding message headers of the messages against each selector, if any, and then delivers
-     the 'matched' messages to its consumer. Please consult the JMS 1.1 specification for full details.</p>
-
-     <p>In this example, three message consumers are created on a queue. The first consumer is created with selector
-     <code>'color=red'</code>, it only receives messages that
-     have a 'color' string property of 'red' value; the second is created with selector <code>'color=green'</code>, it
-     only receives messages who have a 'color' string property of
-     'green' value; and the third without a selector, which means it receives all messages. To illustrate, three messages
-     with different 'color' property values are created and sent.</p>
-
-     <p>Selectors can be used with both queue consumers and topic consumers. The difference is that with queue consumers,
-     a message is only delivered to one consumer on the queue, while topic consumers the message will be delivered to every
-     matching consumers. In this example, if the third consumer (anyConsumer) were the first consumer created, it will
-     consume the first message delivered, therefore there is no chance for the next consumer to get the message, even if it
-     matches the selector.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/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
deleted file mode 100644
index 465a4e2..0000000
--- a/examples/broker-features/standard/queue-selector/src/main/java/org/apache/activemq/artemis/jms/example/QueueSelectorExample.java
+++ /dev/null
@@ -1,143 +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.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/6b17d966/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
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/queue-selector/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/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
deleted file mode 100644
index e20a38c..0000000
--- a/examples/broker-features/standard/queue/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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/6b17d966/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
deleted file mode 100644
index 0cdbd5f..0000000
--- a/examples/broker-features/standard/queue/readme.html
+++ /dev/null
@@ -1,38 +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.
--->
-
-<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/6b17d966/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
deleted file mode 100644
index b6ce381..0000000
--- a/examples/broker-features/standard/queue/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
+++ /dev/null
@@ -1,84 +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.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/6b17d966/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
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/queue/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/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
deleted file mode 100644
index 4683e86..0000000
--- a/examples/broker-features/standard/reattach-node/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?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/6b17d966/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
deleted file mode 100644
index bc7d090..0000000
--- a/examples/broker-features/standard/reattach-node/readme.html
+++ /dev/null
@@ -1,55 +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.
--->
-
-<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/6b17d966/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
deleted file mode 100644
index 459c33b..0000000
--- a/examples/broker-features/standard/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java
+++ /dev/null
@@ -1,150 +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.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/6b17d966/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
deleted file mode 100644
index d82bc7e..0000000
--- a/examples/broker-features/standard/reattach-node/src/main/resources/activemq/server0/artemis-roles.properties
+++ /dev/null
@@ -1,17 +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.
-## ---------------------------------------------------------------------------
-guest=guest,admin
\ No newline at end of file

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/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
deleted file mode 100644
index 07e09bb..0000000
--- a/examples/broker-features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?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/6b17d966/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
deleted file mode 100644
index b6f8ff8..0000000
--- a/examples/broker-features/standard/reattach-node/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/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
deleted file mode 100644
index b4474b0..0000000
--- a/examples/broker-features/standard/request-reply/pom.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?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>


[15/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/client-kickoff/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/client-kickoff/readme.html b/examples/features/standard/client-kickoff/readme.html
new file mode 100644
index 0000000..8400e6a
--- /dev/null
+++ b/examples/features/standard/client-kickoff/readme.html
@@ -0,0 +1,54 @@
+<!--
+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 Client Kickoff 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>Client Kickoff 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 how to kick off a client connected to ActiveMQ
+         using <a href="http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/">JMX</a></p>
+
+     <p>The example will connect to ActiveMQ Artemis. Using JMX, we will list the remote addresses connected to the
+         server and close the corresponding connections. The client will be kicked off from ActiveMQ Artemis receiving
+         an exception that its JMS connection was interrupted.</p>
+
+     <h2>Example configuration</h2>
+
+     <p>ActiveMQ Artemis exposes its managed resources by default on the platform MBeanServer.</p>
+     <p>To access this MBeanServer remotely, the Java Virtual machine must be started with system properties:
+         <pre class="prettyprint">
+             <code>-Dcom.sun.management.jmxremote
+             -Dcom.sun.management.jmxremote.port=3000
+             -Dcom.sun.management.jmxremote.ssl=false
+             -Dcom.sun.management.jmxremote.authenticate=false</code>
+        </pre>
+        <p>These properties are explained in the Java 5 <a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#remote">Management guide</a>
+            (please note that for this example, we will disable user authentication for simplicity).</p>
+        <p>With these properties, ActiveMQ Artemis server will be manageable remotely using standard JMX URL on port <code>3000</code>.</p>
+     </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java b/examples/features/standard/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java
new file mode 100644
index 0000000..14e9f37
--- /dev/null
+++ b/examples/features/standard/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java
@@ -0,0 +1,106 @@
+/*
+ * 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.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.management.MBeanServerConnection;
+import javax.management.MBeanServerInvocationHandler;
+import javax.management.ObjectName;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+import javax.naming.InitialContext;
+import java.util.HashMap;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
+import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
+
+/**
+ * An example that shows how to kick off a client connected to ActiveMQ Artemis by using JMX.
+ */
+public class ClientKickoffExample {
+
+   private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3000/jmxrmi";
+
+   public static void main(final String[] args) throws Exception {
+      QueueConnection 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 Connection Factory
+         QueueConnectionFactory cf = (QueueConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 3.Create a JMS Connection
+         connection = cf.createQueueConnection();
+
+         // Step 4. Set an exception listener on the connection to be notified after a problem occurred
+         final AtomicReference<JMSException> exception = new AtomicReference<JMSException>();
+         connection.setExceptionListener(new ExceptionListener() {
+            @Override
+            public void onException(final JMSException e) {
+               exception.set(e);
+            }
+         });
+
+         // Step 5. We start the connection
+         connection.start();
+
+         // Step 6. Create an ActiveMQServerControlMBean proxy to manage the server
+         ObjectName on = ObjectNameBuilder.DEFAULT.getActiveMQServerObjectName();
+         JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, String>());
+         MBeanServerConnection mbsc = connector.getMBeanServerConnection();
+         ActiveMQServerControl serverControl = MBeanServerInvocationHandler.newProxyInstance(mbsc, on, ActiveMQServerControl.class, false);
+
+         // Step 7. List the remote address connected to the server
+         System.out.println("List of remote addresses connected to the server:");
+         System.out.println("----------------------------------");
+         String[] remoteAddresses = serverControl.listRemoteAddresses();
+         for (String remoteAddress : remoteAddresses) {
+            System.out.println(remoteAddress);
+         }
+         System.out.println("----------------------------------");
+
+         // Step 8. Close the connections for the 1st remote address and kickoff the client
+         serverControl.closeConnectionsForAddress(remoteAddresses[0]);
+
+         // Sleep a little bit so that the stack trace from the server won't be
+         // mingled with the JMSException received on the ExceptionListener
+         Thread.sleep(1000);
+
+         // Step 9. Display the exception received by the connection's ExceptionListener
+         System.err.println("\nException received from the server:");
+         System.err.println("----------------------------------");
+         exception.get().printStackTrace();
+         System.err.println("----------------------------------");
+      }
+      finally {
+         // Step 10. Be sure to close the resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/client-kickoff/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/client-kickoff/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/client-kickoff/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..3b5a465
--- /dev/null
+++ b/examples/features/standard/client-kickoff/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,47 @@
+<?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">
+
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+
+      <!-- true to expose ActiveMQ Artemis resources through JMX -->
+      <jmx-management-enabled>true</jmx-management-enabled>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty">tcp://localhost:61616</acceptor>
+      </acceptors>
+   </core>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/client-kickoff/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/client-kickoff/src/main/resources/jndi.properties b/examples/features/standard/client-kickoff/src/main/resources/jndi.properties
new file mode 100644
index 0000000..5cbe72c
--- /dev/null
+++ b/examples/features/standard/client-kickoff/src/main/resources/jndi.properties
@@ -0,0 +1,19 @@
+# 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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/consumer-rate-limit/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/consumer-rate-limit/pom.xml b/examples/features/standard/consumer-rate-limit/pom.xml
new file mode 100644
index 0000000..c1db582
--- /dev/null
+++ b/examples/features/standard/consumer-rate-limit/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>consumer-rate-limit</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Consumer Rate Limit 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>
+                     <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.ConsumerRateLimitExample</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>consumer-rate-limit</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/consumer-rate-limit/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/consumer-rate-limit/readme.html b/examples/features/standard/consumer-rate-limit/readme.html
new file mode 100644
index 0000000..415de00
--- /dev/null
+++ b/examples/features/standard/consumer-rate-limit/readme.html
@@ -0,0 +1,47 @@
+<!--
+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 Message Consumer Rate Limiting</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 Message Consumer Rate Limiting</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>With ActiveMQ Artemis you can specify a maximum consume rate at which a JMS MessageConsumer will consume messages.
+     This can be specified when creating or configuring the connection factory. See <code>jndi.properties</code>.</p>
+     <p>If this value is specified then ActiveMQ Artemis will ensure that messages are never consumed at a rate higher than
+     the specified rate. This is a form of consumer <i>throttling</i>.</p>
+     <h2>Example step-by-step</h2>
+     <p>In this example we specify a <code>consumer-max-rate</code> of <code>10</code> messages per second in the <code>jndi.properties</code>
+     file when configuring the connection factory:</p>
+     <pre class="prettyprint">
+     <code>
+connectionFactory.ConnectionFactory=tcp://localhost:61616?consumerMaxRate=10
+     </code>
+     </pre>
+     <p>We then simply consume as many messages as we can in 10 seconds and note how many messages are actually consumed.</p>
+     <p>We note that the number of messages consumed per second never exceeds the specified value of <code>10</code> messages per second.</p>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/consumer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ConsumerRateLimitExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/consumer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ConsumerRateLimitExample.java b/examples/features/standard/consumer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ConsumerRateLimitExample.java
new file mode 100644
index 0000000..fb98c76
--- /dev/null
+++ b/examples/features/standard/consumer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ConsumerRateLimitExample.java
@@ -0,0 +1,115 @@
+/*
+ * 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;
+
+/**
+ * This example demonstrates how a message consumer can be limited to consumer messages at a maximum rate
+ * specified in messages per sec.
+ */
+public class ConsumerRateLimitExample {
+
+   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 JMS Message Consumer
+
+         MessageConsumer consumer = session.createConsumer(queue);
+
+         // Step 8. Start the connection
+
+         connection.start();
+
+         // Step 9. Send a bunch of messages
+
+         final int numMessages = 150;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session.createTextMessage("This is text message: " + i);
+
+            producer.send(message);
+         }
+
+         System.out.println("Sent messages");
+
+         System.out.println("Will now try and consume as many as we can in 10 seconds ...");
+
+         // Step 10. Consume as many messages as we can in 10 seconds
+
+         final long duration = 10000;
+
+         int i = 0;
+
+         long start = System.currentTimeMillis();
+
+         while (System.currentTimeMillis() - start <= duration) {
+            TextMessage message = (TextMessage) consumer.receive(2000);
+
+            if (message == null) {
+               throw new RuntimeException("Message was null");
+            }
+
+            i++;
+         }
+
+         long end = System.currentTimeMillis();
+
+         double rate = 1000 * (double) i / (end - start);
+
+         System.out.println("We consumed " + i + " messages in " + (end - start) + " milliseconds");
+
+         System.out.println("Actual consume rate was " + rate + " messages per second");
+      }
+      finally {
+         // Step 9. Be sure to close our resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/consumer-rate-limit/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/consumer-rate-limit/src/main/resources/jndi.properties b/examples/features/standard/consumer-rate-limit/src/main/resources/jndi.properties
new file mode 100644
index 0000000..74729fe
--- /dev/null
+++ b/examples/features/standard/consumer-rate-limit/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?consumerMaxRate=10
+queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/dead-letter/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/dead-letter/pom.xml b/examples/features/standard/dead-letter/pom.xml
new file mode 100644
index 0000000..9c5c5a0
--- /dev/null
+++ b/examples/features/standard/dead-letter/pom.xml
@@ -0,0 +1,110 @@
+<?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>dead-letter</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Dead Letter 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>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.DeadLetterExample</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>dead-letter</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/dead-letter/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/dead-letter/readme.html b/examples/features/standard/dead-letter/readme.html
new file mode 100644
index 0000000..e293936
--- /dev/null
+++ b/examples/features/standard/dead-letter/readme.html
@@ -0,0 +1,66 @@
+<!--
+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 Dead Letter 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>Dead Letter 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 define and deal with dead letter messages.</p>
+     <p>Messages can be delivered unsuccessfully (e.g. if the transacted session used to consume them is rolled back).
+         Such a message goes back to the JMS destination ready to be redelivered.
+         However, this means it is possible for a message to be delivered again and again without any success and remain in the destination, clogging the system.</p>
+     <p>To prevent this, messaging systems define dead letter messages: after a specified unsuccessful delivery attempts, the message is removed from the destination
+         and instead routed to a <em>dead letter address</em> where they can be consumed for further investigation.
+     <p>
+         The example will show how to configure ActiveMQ Artemis to route a message to a dead letter address after 3 unsuccessful delivery attempts.<br />
+         The example will send 1 message to a queue. We will deliver the message 3 times and rollback the session every time.<br />
+         On the 4th attempt, there won't be any message to consume: it will have been moved to a <em>dead letter address</em>.<br />
+         We will then consume this dead letter message.
+     </p>
+     <h2>Example setup</h2>
+     <p><em>Dead letter addresses</em> and <em>maximum delivery attempts</em> are defined in the configuration file <a href="src/main/resources/activemq/server0/broker.xml">broker.xml</a>:</p>
+     <pre class="prettyprint">
+         <code>&lt;address-setting match="jms.queue.exampleQueue"&gt;
+            &lt;dead-letter-address&gt;jms.queue.deadLetterQueue&lt;/dead-letter-address&gt;
+            &lt;max-delivery-attempts&gt;3&lt;/max-delivery-attempts&gt;
+         &lt;/address-setting&gt;
+         </code>
+     </pre>
+     <p>This configuration will moved dead letter messages from <code>exampleQueue</code> to the <code>deadLetterQueue</code>.</p>
+     <p>ActiveMQ Artemis allows to specify either a <code>Queue</code> by prefixing the <code>dead-letter-address</code> with <code>jms.queue.</code>
+         or a <code>Topic</code> by prefixing with <code>jms.topic.</code>.<br />
+         In this example, we will use a <code>Queue</code> to hold the dead letter messages.</p>
+     <p>The maximum attempts of delivery is <code>3</code>. Once this figure is reached, a message is considered a dead letter message and is moved to
+         the <code>deadLetterQueue</code>.
+     <p>Since we want to consume messages from this deadLetterQueue, we also need to add a JNDI binding to perform a lookup.
+         This is configured in <a href="src/main/resources/activemq/server0/activemq-jms.xml">activemq-jms.xml</a></p>
+     <pre class="prettyprint">
+         <code>&lt;queue name="deadLetterQueue"&gt;
+            &lt;entry name="/queue/deadLetterQueue"/&gt;
+         &lt;/queue&gt;</code>
+     </pre>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/dead-letter/src/main/java/org/apache/activemq/artemis/jms/example/DeadLetterExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/dead-letter/src/main/java/org/apache/activemq/artemis/jms/example/DeadLetterExample.java b/examples/features/standard/dead-letter/src/main/java/org/apache/activemq/artemis/jms/example/DeadLetterExample.java
new file mode 100644
index 0000000..db28568
--- /dev/null
+++ b/examples/features/standard/dead-letter/src/main/java/org/apache/activemq/artemis/jms/example/DeadLetterExample.java
@@ -0,0 +1,136 @@
+/*
+ * 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;
+
+/**
+ * An example showing how messages are moved to dead letter destination when they are unsuccessfully delivered multiple times
+ */
+public class DeadLetterExample {
+
+   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 * transacted* JMS Session
+         Session session = connection.createSession(true, 0);
+
+         // 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");
+
+         // Step 8. Send the Message
+         producer.send(message);
+         System.out.println("Sent message to " + queue.getQueueName() + ": " + message.getText());
+
+         // Step 9. Commit the session to effectively send the message
+         session.commit();
+
+         // Step 10. Create a JMS Message Consumer for the queue
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         // Step 11. Start the Connection
+         connection.start();
+
+         // Step 12. We receive a message...
+         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
+         System.out.println("1st delivery from " + queue.getQueueName() + ": " + messageReceived.getText());
+
+         // Step 13. ... but we roll back the session. the message returns to the queue ready to be redelivered
+         session.rollback();
+
+         // Step 14. We receive a message and roll back the session a second time
+         messageReceived = (TextMessage) messageConsumer.receive(5000);
+         System.out.println("2nd delivery from " + queue.getQueueName() + ": " + messageReceived.getText());
+         session.rollback();
+
+         // Step 15. We receive a message and roll back the session a third time
+         messageReceived = (TextMessage) messageConsumer.receive(5000);
+         System.out.println("3rd delivery from " + queue.getQueueName() + ": " + messageReceived.getText());
+         session.rollback();
+
+         // The message has been delivered unsuccessfully 3 times -> it is moved to the dead letter queue.
+
+         // Step 16. The 4th time, call will timeout after 5000ms and messageReceived will be null
+         messageReceived = (TextMessage) messageConsumer.receive(5000);
+         System.out.println("4th delivery from " + queue.getQueueName() + ": " + messageReceived);
+
+         // We will now consume the message from the dead letter queue
+
+         // Step 17. Perform a lookup on the dead letter queue
+         Queue deadLetterQueue = (Queue) initialContext.lookup("queue/deadLetterQueue");
+
+         // Step 18. Create a JMS Message Consumer for the dead letter queue
+         MessageConsumer deadLetterConsumer = session.createConsumer(deadLetterQueue);
+
+         // Step 19. Receive the message from the dead letter queue
+         messageReceived = (TextMessage) deadLetterConsumer.receive(5000);
+
+         // Step 20. The message sent to the queue was moved to the dead letter queue after 3 unsuccessful deliveries
+         System.out.println("Received message from " + deadLetterQueue.getQueueName() +
+                               ": " +
+                               messageReceived.getText());
+
+         // The message received from the dead letter queue has the same content than the undelivered message but its
+         // JMS headers
+         // differ (from JMS point of view, it's not the same message).
+         // ActiveMQ Artemis defines additional properties for messages received from the dead letter queue
+
+         System.out.println();
+         // Step 21. the messageReceived's destination is now the dead letter queue.
+         System.out.println("Destination of the message: " + ((Queue) messageReceived.getJMSDestination()).getQueueName());
+
+         // Step 22. the *origin* destination is stored in the _AMQ_ORIG_ADDRESS property
+         System.out.println("*Origin destination* of the message: " + messageReceived.getStringProperty("_AMQ_ORIG_ADDRESS"));
+
+         // Step 23. This time, we commit the session, the delivery from the dead letter queue is successful!
+         session.commit();
+      }
+      finally {
+         // Step 24. 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/6b17d966/examples/features/standard/dead-letter/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/dead-letter/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/dead-letter/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/dead-letter/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/dead-letter/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/dead-letter/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/dead-letter/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/dead-letter/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/6b17d966/examples/features/standard/dead-letter/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/dead-letter/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/dead-letter/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..fdf88cc
--- /dev/null
+++ b/examples/features/standard/dead-letter/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,71 @@
+<?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"/>
+
+      <!-- the dead letter queue where dead messages will be sent-->
+      <queue name="deadLetterQueue"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.#">
+            <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-settings>
+
+      <address-settings>
+         <!--override the max-delivery-attempts and dead letter address for the example queue-->
+         <address-setting match="jms.queue.exampleQueue">
+            <dead-letter-address>jms.queue.deadLetterQueue</dead-letter-address>
+            <max-delivery-attempts>3</max-delivery-attempts>
+         </address-setting>
+      </address-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/dead-letter/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/dead-letter/src/main/resources/jndi.properties b/examples/features/standard/dead-letter/src/main/resources/jndi.properties
new file mode 100644
index 0000000..3e1a366
--- /dev/null
+++ b/examples/features/standard/dead-letter/src/main/resources/jndi.properties
@@ -0,0 +1,21 @@
+# 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
+queue.queue/deadLetterQueue=deadLetterQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/delayed-redelivery/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/delayed-redelivery/pom.xml b/examples/features/standard/delayed-redelivery/pom.xml
new file mode 100644
index 0000000..e82469c
--- /dev/null
+++ b/examples/features/standard/delayed-redelivery/pom.xml
@@ -0,0 +1,110 @@
+<?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>delayed-redelivery</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Delayed Redelivery 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>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.DelayedRedeliveryExample</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>delayed-redelivery</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/delayed-redelivery/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/delayed-redelivery/readme.html b/examples/features/standard/delayed-redelivery/readme.html
new file mode 100644
index 0000000..e535c47
--- /dev/null
+++ b/examples/features/standard/delayed-redelivery/readme.html
@@ -0,0 +1,56 @@
+<!--
+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 Delayed Redelivery 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>Delayed Redelivery 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 can be configured to provide a delayed redelivery in the case
+     where a message needs to be redelivered.</p>
+     <p>Delaying redelivery can often be useful in the case that clients regularly fail or roll-back. Without a delayed
+     redelivery, the system can get into a "thrashing" state, with delivery being attempted, the client rolling back, and
+     delivery being re-attempted ad infinitum in quick succession, using up valuable CPU and network resources.</p>
+     <p>Re-delivery occurs when the session is closed with unacknowledged messages. The unacknowledged messages will
+     be redelivered.</p>
+     <p>By providing a redelivery delay, it can be specified that a delay of, say, 10 seconds is implemented between rollback
+     and redelivery. The specific delay is configurable on both a global and per destination level, by using wild-card
+     matching on the address settings.</p>
+
+     <h2>Example setup</h2>
+     <p>Redelivery delay is specified in the configuration file <a href="src/main/resources/activemq/server0/broker.xml">broker.xml</a>:</p>
+     <p>In this example we set the redelivery delay to 5 seconds for the specific example queue. We could set redelivery delay on
+     on multiple queues by specifying a wild-card in the match, e.g. <code>match="jms.#"</code> would apply the settings
+     to all JMS queues and topics.</p>
+     <p>We then consume a message in a transacted session, and rollback, and note that the message is not redelivered until
+     after 5 seconds.</p>
+     <pre class="prettyprint">
+         <code>&lt;address-setting match="jms.queue.exampleQueue"&gt;
+            &lt;redelivery-delay&gt;5000&lt;/redelivery-delay&gt;
+         &lt;/address-setting&gt;
+         </code>
+     </pre>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/delayed-redelivery/src/main/java/org/apache/activemq/artemis/jms/example/DelayedRedeliveryExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/delayed-redelivery/src/main/java/org/apache/activemq/artemis/jms/example/DelayedRedeliveryExample.java b/examples/features/standard/delayed-redelivery/src/main/java/org/apache/activemq/artemis/jms/example/DelayedRedeliveryExample.java
new file mode 100644
index 0000000..afa538f
--- /dev/null
+++ b/examples/features/standard/delayed-redelivery/src/main/java/org/apache/activemq/artemis/jms/example/DelayedRedeliveryExample.java
@@ -0,0 +1,126 @@
+/*
+ * 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;
+
+/**
+ * This example demonstrates how ActiveMQ Artemis can be configured with a redelivery delay in the event a message
+ * is redelivered.
+ *
+ * Please see the readme.html for more information
+ */
+public class DelayedRedeliveryExample {
+
+   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 transacted JMS Session
+         Session session = connection.createSession(true, 0);
+
+         // 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");
+
+         // Step 8. Send the Message
+         producer.send(message);
+
+         System.out.println("Sent message to " + queue.getQueueName() + ": " + message.getText());
+
+         // Step 9. Commit the session to effectively send the message
+         session.commit();
+
+         // Step 10. Create a JMS Message Consumer for the queue
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         // Step 11. Start the Connection
+         connection.start();
+
+         // Step 12. We receive a message...
+         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
+         System.out.println("1st delivery from " + queue.getQueueName() + ": " + messageReceived.getText());
+
+         // Step 13. ... but we roll back the session. the message returns to the queue, but only after a
+         // 5 second delay
+         session.rollback();
+
+         // Step 14. We try to receive the message but it's being delayed
+         messageReceived = (TextMessage) messageConsumer.receive(3000);
+
+         if (messageReceived != null) {
+            throw new IllegalStateException("Expected to recieve message.");
+         }
+
+         System.out.println("Redelivery has been delayed so received message is " + messageReceived);
+
+         // Step 15. We try and receive the message again, this time we should get it
+
+         messageReceived = (TextMessage) messageConsumer.receive(3000);
+
+         System.out.println("2nd delivery from " + queue.getQueueName() + ": " + messageReceived.getText());
+
+         // Step 16. We rollback the session again to cause another redelivery, and we time how long this one takes
+
+         long start = System.currentTimeMillis();
+
+         session.rollback();
+
+         messageReceived = (TextMessage) messageConsumer.receive(8000);
+
+         long end = System.currentTimeMillis();
+
+         System.out.println("3nd delivery from " + queue.getQueueName() +
+                               ": " +
+                               messageReceived.getText() +
+                               " after " +
+                               (end - start) +
+                               " milliseconds.");
+      }
+      finally {
+         // Step 17. 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/6b17d966/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/delayed-redelivery/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/delayed-redelivery/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/6b17d966/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..3e41664
--- /dev/null
+++ b/examples/features/standard/delayed-redelivery/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,70 @@
+<?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"/>
+
+      <!-- the dead letter queue where dead messages will be sent-->
+      <queue name="deadLetterQueue"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.#">
+            <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-settings>
+
+      <address-settings>
+         <!--override the redelivery-delay  for the example queue-->
+         <address-setting match="jms.queue.exampleQueue">
+            <redelivery-delay>5000</redelivery-delay>
+         </address-setting>
+      </address-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/delayed-redelivery/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/delayed-redelivery/src/main/resources/jndi.properties b/examples/features/standard/delayed-redelivery/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/delayed-redelivery/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/6b17d966/examples/features/standard/divert/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/divert/pom.xml b/examples/features/standard/divert/pom.xml
new file mode 100644
index 0000000..69a7f98
--- /dev/null
+++ b/examples/features/standard/divert/pom.xml
@@ -0,0 +1,159 @@
+<?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>divert</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Divert Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <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>
+   </dependencies>
+
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <libList><arg>org.apache.activemq.examples.broker:divert:${project.version}</arg></libList>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <libList><arg>org.apache.activemq.examples.broker:divert:${project.version}</arg></libList>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.DivertExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.broker</groupId>
+                  <artifactId>divert</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/divert/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/divert/readme.html b/examples/features/standard/divert/readme.html
new file mode 100644
index 0000000..63fb710
--- /dev/null
+++ b/examples/features/standard/divert/readme.html
@@ -0,0 +1,119 @@
+<!--
+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 Divert 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>Divert 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>ActiveMQ Artemis diverts allow messages to be transparently "diverted" from one address to another
+     with just some simple configuration defined on the server side.</p>
+     <p>Diverts can be defined to be <b>exclusive</b> or <b>non-exclusive</b>.</p>
+     <p>With an <b>exclusive</b> divert the message is intercepted and does not get sent to the queues originally
+     bound to that address - it only gets diverted.</p>
+     <p>With a <b>non-exclusive</b> divert the message continues to go to the queues bound to the address,
+     but also a <b>copy</b> of the message gets sent to the address specified in the divert. Consequently non-exclusive
+     diverts can be used to "snoop" on another address</p>
+     <p>Diverts can also be configured to have an optional filter. If specified then only matching messages
+     will be diverted.</p>
+     <p>Diverts can be configured to apply a Transformer. If specified, all diverted messages will have the
+     opportunity of being transformed by the Transformer.</p>
+     <p>Diverts are a very sophisticated concept, which when combined with bridges can be used to create
+     interesting and complex routings. The set of diverts can be thought of as a type of <i>routing table</i>
+     for messages.</p>
+
+     <h2>Example step-by-step</h2>
+     <p>In this example we will imagine a fictitious company which has two offices; one in London and another in New York.</p>
+     <p>The company accepts orders for it's products only at it's London office, and also generates price-updates
+     for it's products, also only from it's London office. However only the New York office is interested in receiving
+     price updates for New York products. Any prices for New York products need to be forwarded to the New York office.</p>
+     <p>There is an unreliable WAN linking the London and New York offices.</p>
+     <p>The company also requires a copy of any order received to be available to be inspected by management.</p>
+     <p>In order to achieve this, we will create a queue <code>orderQueue</code> on the London server in to which orders arrive.</p>
+     <p>We will create a topic, <code>spyTopic</code> on the London server, and there will be two subscribers both in London.</p>
+     <p>We will create a <i>non-exclusive</i> divert on the London server which will siphon off a copy of each order
+     received to the topic <code>spyTopic</code>.</p>
+     <p>Here's the xml config for that divert, from <code>broker.xml</code></p>
+     <pre class="prettyprint">
+        <code>
+     &lt;divert name="order-divert"&gt;
+         &lt;address&gt;jms.queue.orders&lt;/address&gt;
+         &lt;forwarding-address&gt;jms.topic.spyTopic&lt;/forwarding-address&gt;
+         &lt;exclusive&gt;false&lt;/exclusive&gt;
+      &lt;/divert&gt;
+         </code>
+     </pre>
+     <p>For the prices we will create a topic on the London server, <code>priceUpdates</code> to which all price updates
+     are sent. We will create another topic on the New York server <code>newYorkPriceUpdates</code> to which all New York
+     price updates need to be forwarded.</p>
+     <p>Diverts can only be used to divert messages from one <b>local</b> address to another <b>local</b> address
+     so we cannot divert directly to an address on another server.</p>
+     <p>Instead we divert to a local <i>store and forward queue</i> they we define in the configuration. This is just a normal queue
+     that we use for storing messages before forwarding to another node.</p>
+     <p>Here's the configuration for it:</p>
+     <pre class="prettyprint">
+        <code>
+     &lt;queues&gt;
+        &lt;queue name="jms.queue.priceForwarding"&gt;
+           &lt;address&gt;jms.queue.priceForwarding&lt;/address&gt;
+        &lt;/queue&gt;
+     &lt;/queues&gt;
+         </code>
+      </pre>
+     <p>Here's the configuration for the divert:</p>
+     <pre class="prettyprint">
+        <code>
+     &lt;divert name="prices-divert"&gt;
+	     &lt;address&gt;jms.topic.priceUpdates&lt;/address&gt;
+	     &lt;forwarding-address&gt;jms.queue.priceForwarding&lt;/forwarding-address&gt;
+	     &lt;filter string="office='New York'"/&gt;
+	     &lt;transformer-class-name&gt;org.apache.activemq.artemis.jms.example.AddForwardingTimeTransformer&lt;/transformer-class-name&gt;
+	     &lt;exclusive&gt;true&lt;/exclusive&gt;
+	  &lt;/divert&gt;
+	     </code>
+	  </pre>
+	  <p>Note we specify a filter in the divert, so only New York prices get diverted. We also specify a Transformer class
+	  since we are going to insert a header in the message at divert time, recording the time the diversion happened.</p>
+	  <p>And finally we define a bridge that moves messages from the local queue to the address on the New York server.
+	  Bridges move messages from queues to remote addresses and are ideal to use when the target server may be stopped and
+	  started independently, and/or the network might be unreliable. Bridges guarantee once and only once delivery
+	  of messages from their source queues to their target addresses.</p>
+	  <p>Here is the bridge configuration: </p>
+	  <pre class="prettyprint">
+	     <code>
+	  &lt;bridges&gt;
+	     &lt;bridge name="price-forward-bridge"&gt;
+	        &lt;queue-name&gt;jms.queue.priceForwarding&lt;/queue-name&gt;
+	        &lt;forwarding-address&gt;jms.topic.newYorkPriceUpdates&lt;/forwarding-address&gt;
+	        &lt;reconnect-attempts&gt;-1&lt;/reconnect-attempts&gt;
+          &lt;static-connectors>
+             &lt;connector-ref>newyork-connector&lt;/connector-ref>
+          &lt;/static-connectors>
+	     &lt;/bridge&gt;
+      &lt;/bridges&gt;
+         </code>
+     </pre>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/AddForwardingTimeTransformer.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/AddForwardingTimeTransformer.java b/examples/features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/AddForwardingTimeTransformer.java
new file mode 100644
index 0000000..15d8e65
--- /dev/null
+++ b/examples/features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/AddForwardingTimeTransformer.java
@@ -0,0 +1,31 @@
+/*
+ * 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 org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.server.ServerMessage;
+import org.apache.activemq.artemis.core.server.cluster.Transformer;
+
+public class AddForwardingTimeTransformer implements Transformer {
+
+   public ServerMessage transform(final ServerMessage message) {
+      message.putLongProperty(new SimpleString("time_of_forward"), System.currentTimeMillis());
+
+      return message;
+   }
+
+}


[10/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/management-notifications/src/main/java/org/apache/activemq/artemis/jms/example/ManagementNotificationExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/management-notifications/src/main/java/org/apache/activemq/artemis/jms/example/ManagementNotificationExample.java b/examples/features/standard/management-notifications/src/main/java/org/apache/activemq/artemis/jms/example/ManagementNotificationExample.java
new file mode 100644
index 0000000..5fc00cf
--- /dev/null
+++ b/examples/features/standard/management-notifications/src/main/java/org/apache/activemq/artemis/jms/example/ManagementNotificationExample.java
@@ -0,0 +1,109 @@
+/*
+ * 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.Enumeration;
+
+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.Topic;
+import javax.naming.InitialContext;
+
+/**
+ * An example that shows how to receive management notifications using JMS messages.
+ */
+public class ManagementNotificationExample {
+
+   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, a session and a producer for the queue
+         connection = cf.createConnection();
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer producer = session.createProducer(queue);
+
+         // Step 5. Perform a lookup on the notifications topic
+         Topic notificationsTopic = (Topic) initialContext.lookup("topic/notificationsTopic");
+
+         // Step 6. Create a JMS message consumer for the notification queue and set its message listener
+         // It will display all the properties of the JMS Message
+         MessageConsumer notificationConsumer = session.createConsumer(notificationsTopic);
+         notificationConsumer.setMessageListener(new MessageListener() {
+            public void onMessage(final Message notif) {
+               System.out.println("------------------------");
+               System.out.println("Received notification:");
+               try {
+                  Enumeration propertyNames = notif.getPropertyNames();
+                  while (propertyNames.hasMoreElements()) {
+                     String propertyName = (String) propertyNames.nextElement();
+                     System.out.format("  %s: %s%n", propertyName, notif.getObjectProperty(propertyName));
+                  }
+               }
+               catch (JMSException e) {
+               }
+               System.out.println("------------------------");
+            }
+         });
+
+         // Step 7. Start the Connection to allow the consumers to receive messages
+         connection.start();
+
+         // Step 8. Create a JMS Message Consumer on the queue
+         MessageConsumer consumer = session.createConsumer(queue);
+
+         // Step 9. Close the consumer
+         consumer.close();
+
+         // Step 10. Try to create a connection with unknown user
+         try {
+            cf.createConnection("not.a.valid.user", "not.a.valid.password");
+         }
+         catch (JMSException e) {
+         }
+
+         // sleep a little bit to be sure to receive the notification for the security
+         // authentication violation before leaving the example
+         Thread.sleep(2000);
+      }
+      finally {
+         // Step 11. Be sure to close the resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/management-notifications/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/management-notifications/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/management-notifications/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/management-notifications/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/management-notifications/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/management-notifications/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/management-notifications/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/management-notifications/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/6b17d966/examples/features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..2c97901
--- /dev/null
+++ b/examples/features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,81 @@
+<?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 ../../../../src/schema/artemis-server.xsd">
+
+   <jms xmlns="urn:activemq:jms">
+      <!--the queue used by the example-->
+      <queue name="exampleQueue"/>
+
+      <!--the notifications topic used by the example-->
+      <topic name="notificationsTopic"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+
+
+      <management-notification-address>jms.topic.notificationsTopic</management-notification-address>
+
+      <!-- Netty standard TCP acceptor -->
+      <acceptors>
+         <acceptor name="netty">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!--  Other configs -->
+
+      <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 for notification queue-->
+         <security-setting match="jms.topic.notificationsTopic">
+            <permission type="consume" roles="guest"/>
+            <permission type="createNonDurableQueue" roles="guest"/>
+            <permission type="deleteNonDurableQueue" roles="guest"/>
+         </security-setting>
+
+         <!-- security settings for JMS temporary queue -->
+         <security-setting match="queuetempjms.*">
+            <permission type="createNonDurableQueue" roles="guest"/>
+            <permission type="deleteNonDurableQueue" roles="guest"/>
+            <permission type="consume" roles="guest"/>
+            <permission type="send" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/management-notifications/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/management-notifications/src/main/resources/jndi.properties b/examples/features/standard/management-notifications/src/main/resources/jndi.properties
new file mode 100644
index 0000000..2582245
--- /dev/null
+++ b/examples/features/standard/management-notifications/src/main/resources/jndi.properties
@@ -0,0 +1,21 @@
+# 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
+topic.topic/notificationsTopic=notificationsTopic

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/management/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/management/pom.xml b/examples/features/standard/management/pom.xml
new file mode 100644
index 0000000..cd006e5
--- /dev/null
+++ b/examples/features/standard/management/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>management</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Management 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>
+                     <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.ManagementExample</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>management</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/management/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/management/readme.html b/examples/features/standard/management/readme.html
new file mode 100644
index 0000000..30057ba
--- /dev/null
+++ b/examples/features/standard/management/readme.html
@@ -0,0 +1,208 @@
+<!--
+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 Management 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>Management Example</h1>
+     <p>This example shows how to manage ActiveMQ Artemis using JMS Messages to invoke management operations on the server.</a></p>
+     <p>To manage ActiveMQ Artemis using JMX, see the <a href="../jmx/readme.html">JMX</a> example.</p>
+
+     <h2>Example configuration</h2>
+
+     <p>ActiveMQ Artemis can be managed by sending JMS messages with specific properties to its <em>management</em> queue.</p>
+     </p>By default, the management name is called <code>activemq.management</code> but this can be configured in <a href="server0/broker.xml">broker.xml</a>
+     <pre class="prettyprint">
+         <code>&lt;management-address&gt;activemq.management&lt;/management-address&gt;</code>
+     </pre>
+
+     <p>The management queue requires a "special" user permission <code>manage</code> to be able to receive management messages.
+         This is also configured in <a href="server0/broker.xml">broker.xml</a></p>
+     <pre class="prettyprint">
+         <code>&lt;security-setting match="activemq.management"&gt;
+            &lt;permission type="manage" roles="guest" /&gt;
+         &lt;/security-setting&gt;</code>
+     </pre>
+
+     <h2>Example step-by-step</h2>
+     <p><em>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</em></p>
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get its properties from <a href="server0/client-jndi.properties">client-jndi.properties</a></li>
+        <pre class="prettyprint">
+            <code>InitialContext initialContext = getContext(0);</code>
+        </pre>
+
+        <li>We look up the JMS queue object from JNDI</li>
+        <pre class="prettyprint">
+            <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>We look up the JMS connection factory object from JNDI</li>
+        <pre class="prettyprint">
+            <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>We create a JMS connection</li>
+        <pre class="prettyprint">
+            <code>connection = cf.createConnection();</code>
+        </pre>
+
+        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
+        <pre class="prettyprint">
+            <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
+        </pre>
+
+        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
+        <pre class="prettyprint">
+            <code>MessageProducer messageProducer = session.createProducer(topic);</code>
+       </pre>
+
+        <li>We create a JMS text message that we are going to send.</li>
+        <pre class="prettyprint">
+            <code>TextMessage message = session.createTextMessage("This is a text message");</code>
+        </pre>
+
+        <li>We send message to the queue</li>
+        <pre class="prettyprint">
+            <code>messageProducer.send(message);</code>
+        </pre>
+
+        <p><em>Now that we have a message in the queue, we will manage the queue by retrieving the number of messages in the queue
+            (i.e. 1) and by removing the message which has been sent in step 8.</em></p>
+
+        <li>We create the JMS management queue. This is a <em>special</em> queue which is not looked up from JNDI but instantiated directly</li>
+        <pre class="prettyprint">
+            <code>Queue managementQueue = new ActiveMQQueue("activemq.management", "activemq.management");</code>
+        </pre>
+
+        <li>We create a <code>QueueRequestor</code> to send messages to the management queue and receive replies (see <a href="../queue-requestor/readme.html">queue-requestor example</a>)</li>
+        <pre class="prettyprint">
+            <code>QueueRequestor requestor = new QueueRequestor(session, managementQueue);</code>
+        </pre>
+
+        <li>We start the connection to receive replies on the requestor</li>
+        <pre class="prettyprint">
+           <code>connection.start()</code>
+        </pre>
+
+        <li>We create a JMS message which will be used as a <em>management</em> message</li>
+        <pre class="prettyprint">
+            <code>Message m = session.createMessage();</code>
+        </pre>
+
+        <li>a <em>management</em> message has well-defined properties that ActiveMQ Artemis server needs to know to perform management operations.<br />
+            We use a helper class <code>JMSManagementHelper</code> to fill these properties:
+            <ul>
+                <li>The name of the resource to manage <code>jms.queue.exampleQueue</code>
+                    (i.e. <code>jms.queue</code> followed by the name of the queue as defined in <a href="server0/activemq-jms.xml">activemq-jms.xml</a>)</li>
+                <li>In our case, the name of the attribute to retrieve <code>MessageCount</code></li>
+            </ul>
+        </li>
+        <pre class="prettyprint">
+            <code>JMSManagementHelper.putAttribute(m, "jms.queue.exampleQueue", "MessageCount");</code>
+        </pre>
+
+        <li>We send the <em>management</em> message using the requestor and wait for a reply</li>
+        <pre class="prettyprint">
+            <code>Message reply = requestor.request(m);</code>
+        </pre>
+
+        <li>We use a helper class <code>JMSManagementHelper</code> to retrieve the result from the reply message:
+        <pre class="prettyprint">
+            <code>int messageCount = (Integer)JMSManagementHelper.getResult(reply);
+            System.out.println(queue.getQueueName() + " contains " + messageCount + " messages");</code>
+        </pre>
+
+        <li>We create another JMS message to use as a management message</li>
+        <pre class="prettyprint">
+            <code>m = session.createMessage();</code>
+        </pre>
+
+        <li>This time, we fill the <em>management</em> message with properties to <em>invoke</em> a management operation on the queue
+            <ul>
+                <li>the name of the resource <code>jms.queue.exampleQueue</code></li>
+                <li>the name of the management operation <code>removeMessage</code></li>
+                <li>any parameters required to invoke the management operations (in our case, the JMS Message ID of the message sent in step 8)</li>
+            </ul>
+        </li>
+        <pre class="prettyprint">
+            <code>JMSManagementHelper.putOperationInvocation(m, "jms.queue.exampleQueue", "removeMessage", message.getJMSMessageID());</code>
+        </pre>
+
+        <li>Again, we use the requestor to send the management message and wait for a reply</li>
+        <pre class="prettyprint">
+            <code>reply = requestor.request(m);</code>
+        </pre>
+
+        <li>We use the helper class to check that the operation was successfully invoked on the server</li>
+        <pre class="prettyprint">
+            <code>boolean success = JMSManagementHelper.hasOperationSucceeded(reply);
+            System.out.println("operation invocation has succeeded: " + success);</code>
+        </pre>
+
+        <li>We use a helper class <code>JMSManagementHelper</code> to retrieve the result from the reply message:
+            (in our case, the <code>removeMessage</code> method returns a boolean)</li>
+        <pre class="prettyprint">
+            <code>boolean messageRemoved = (Boolean)JMSManagementHelper.getResult(reply);
+            System.out.println("message has been removed: " + messageRemoved);</code>
+        </pre>
+
+        <p><em>We will now consume the message from the queue but there will be none: the message sent at step 8 was removed by the management operation</em></p>
+
+        <li>We create a JMS message consumer on the queue</li>
+        <pre class="prettyprint">
+            <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
+        </pre>
+
+        <li>We try to receive a message from the queue. Since there is none, the call will timeout after 5000ms and messageReceived will be null
+        </li>
+        <pre class="prettyprint">
+            <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
+            System.out.println("Received message: " + messageReceived);</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>
+
+     <h2>More information</h2>
+
+     <ul>
+        <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.jms">Using Management Via JMS chapter</a></li>
+     </ul>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java b/examples/features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java
new file mode 100644
index 0000000..8c780c3
--- /dev/null
+++ b/examples/features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java
@@ -0,0 +1,133 @@
+/*
+ * 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.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueRequestor;
+import javax.jms.QueueSession;
+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;
+
+/**
+ * An example that shows how to manage ActiveMQ Artemis using JMS messages.
+ */
+public class ManagementExample {
+
+   public static void main(final String[] args) throws Exception {
+      QueueConnection 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
+         QueueConnectionFactory cf = (QueueConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 4.Create a JMS Connection
+         connection = cf.createQueueConnection();
+
+         // Step 5. Create a JMS Session
+         QueueSession session = connection.createQueueSession(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 the JMS management queue.
+         // It is a "special" queue and it is not looked up from JNDI but constructed directly
+         Queue managementQueue = ActiveMQJMSClient.createQueue("activemq.management");
+
+         // Step 10. Create a QueueRequestor for the management queue (see queue-requestor example)
+         QueueRequestor requestor = new QueueRequestor(session, managementQueue);
+
+         // Step 11. Start the Connection to allow the queue requestor to receive replies
+         connection.start();
+
+         // Step 12. Create a JMS message which is used to send a management message
+         Message m = session.createMessage();
+
+         // Step 13. Use a helper class to fill the JMS message with management information:
+         // * the name of the resource to manage
+         // * in this case, we want to retrieve the value of the messageCount of the queue
+         JMSManagementHelper.putAttribute(m, "jms.queue.exampleQueue", "messageCount");
+
+         // Step 14. Use the requestor to send the request and wait for the reply
+         Message reply = requestor.request(m);
+
+         // Step 15. Use a helper class to retrieve the operation result
+         int messageCount = (Integer) JMSManagementHelper.getResult(reply);
+         System.out.println(queue.getQueueName() + " contains " + messageCount + " messages");
+
+         // Step 16. Create another JMS message to use as a management message
+         m = session.createMessage();
+
+         // Step 17. Use a helper class to fill the JMS message with management information:
+         // * the object name of the resource to manage (i.e. the queue)
+         // * in this case, we want to call the "removeMessage" operation with the JMS MessageID
+         // of the message sent to the queue in step 8.
+         JMSManagementHelper.putOperationInvocation(m, "jms.queue.exampleQueue", "removeMessage", message.getJMSMessageID());
+
+         // Step 18 Use the requestor to send the request and wait for the reply
+         reply = requestor.request(m);
+
+         // Step 19. Use a helper class to check that the operation has succeeded
+         boolean success = JMSManagementHelper.hasOperationSucceeded(reply);
+         System.out.println("operation invocation has succeeded: " + success);
+
+         // Step 20. Use a helper class to retrieve the operation result
+         // in that case, a boolean which is true if the message was removed, false else
+         boolean messageRemoved = (Boolean) JMSManagementHelper.getResult(reply);
+         System.out.println("message has been removed: " + messageRemoved);
+
+         // Step 21. Create a JMS Message Consumer on the queue
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         // Step 22. Trying to receive a message. Since the only message in the queue was removed by a management
+         // operation,
+         // there is none to consume. The call will timeout after 5000ms and messageReceived will be null
+         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
+         System.out.println("Received message: " + messageReceived);
+      }
+      finally {
+         // Step 23. Be sure to close the resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/management/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/management/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/management/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/management/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/management/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/management/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/management/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/management/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/6b17d966/examples/features/standard/management/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/management/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/management/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..36eec30
--- /dev/null
+++ b/examples/features/standard/management/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,76 @@
+<?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.dir}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+
+
+      <management-address>jms.queue.activemq.management</management-address>
+
+      <!-- Netty standard TCP acceptor -->
+      <acceptors>
+         <acceptor name="netty">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <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 for management queue-->
+         <security-setting match="jms.queue.activemq.management">
+            <permission type="manage" roles="guest"/>
+         </security-setting>
+
+         <!-- security settings for JMS temporary queue -->
+         <security-setting match="jms.tempqueue.#">
+            <permission type="createNonDurableQueue" roles="guest"/>
+            <permission type="deleteNonDurableQueue" roles="guest"/>
+            <permission type="consume" roles="guest"/>
+            <permission type="send" roles="guest"/>
+         </security-setting>
+
+      </security-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/management/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/management/src/main/resources/jndi.properties b/examples/features/standard/management/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/management/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/6b17d966/examples/features/standard/message-counters/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-counters/pom.xml b/examples/features/standard/message-counters/pom.xml
new file mode 100644
index 0000000..e2db0ac
--- /dev/null
+++ b/examples/features/standard/message-counters/pom.xml
@@ -0,0 +1,116 @@
+<?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>message-counters</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Message Counter Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <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>
+   </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>
+                     <javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3001 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
+                     </javaOptions>
+                  </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.MessageCounterExample</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>message-counters</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/message-counters/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-counters/readme.html b/examples/features/standard/message-counters/readme.html
new file mode 100644
index 0000000..40e247a
--- /dev/null
+++ b/examples/features/standard/message-counters/readme.html
@@ -0,0 +1,197 @@
+<!--
+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 Message Counter 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 Message Counter Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+     <p>This example shows you how to use message counters to obtain message information for a JMS queue.</p>
+     <p>The example will show how to configure sampling of message counters.<br />
+         We will produce and consume 1 message from a queue. Interleaved with the JMS operation, we will retrieve the queue's message counters
+         at different times to display the metrics on the queue.
+     </p>
+     <h2>Example setup</h2>
+     <p>Message counter is configured in the server configuration file <a href="server0/broker.xml">broker.xml</a>:</p>
+     <pre class="prettyprint">
+         <code>&lt;message-counter-enabled&gt;true&lt;/message-counter-enabled&gt;
+         &lt;message-counter-sample-period&gt;2000&lt;/message-counter-sample-period&gt;
+         &lt;message-counter-max-day-history&gt;2&lt;/message-counter-max-day-history&gt;</code>
+     </pre>
+     <p>By default, Message counter is not enabled (for performance reason). To enable them, set <code>message-counter-enabled</code> to <code>true</code>.<br />
+     Queues are sampled every 10 seconds by default. For this example we will reduce it to 2 seconds by setting <code>message-counter-sample-period</code> to <code>2000</code>.<br />
+     ActiveMQ Artemis holds in memory the message counters' history for a maximum number of days (10 by default). We can change the number of days the history is kept by setting
+         the <code>message-counter-max-day-history</code> parameter.</p>
+     <p>The sample period and the max day history parameters have a small impact on the performance of ActiveMQ Artemis (the resources taken to sample a queue are not available to the system's
+         normal use). You should set these parameters accordingly to the use and throughput of your messages.</p>
+
+     <h2>Example step-by-step</h2>
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
+        <pre class="prettyprint">
+           <code>InitialContext initialContext = getContext();</code>
+        </pre>
+
+        <li>We look up the JMS queue object from JNDI</li>
+        <pre class="prettyprint">
+           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>We look up the JMS connection factory object from JNDI</li>
+        <pre class="prettyprint">
+           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>We create a JMS connection, session and producer for the queue</li>
+        <pre class="prettyprint">
+           <code> connection = cf.createQueueConnection();
+            QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+            MessageProducer producer = session.createProducer(queue);</code>
+       </pre>
+
+        <li>We create and send a JMS text message</li>
+        <pre class="prettyprint">
+            <code>TextMessage message = session.createTextMessage("This is a text message");
+            producer.send(message);
+            System.out.println("Sent message: " + message.getText());</code>
+        </pre>
+
+        <li>We will now sleep a little bit to be sure the queue is sample. Since we have configure the sample period to be 2 seconds,
+            we will sleep for 3 seconds to be sure that a sample is taken</li>
+        <pre class="prettyprint">
+            <code>System.out.println("Sleep a little bit to have the queue sampled...");
+            Thread.sleep(3000);</code>
+        </pre>
+
+        <p>We now need to retrieve the message counters. They're available from the JMS Queue management resource. In this example, we
+            will retrieve them using JMX (see the <a href="../jmx/readme.html">JMX example</a> for a more complete description). You can also use JMS message to retrieve them (see the <a href="../management/readme.html">Management example</a> to
+            learn about managing ActiveMQ Artemis using JMS messages).</p>
+
+       <li>We retrieve the JMX MBean used to manage the JMS queue</li>
+        <pre class="prettyprint">
+            <code>ObjectName on = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queue.getQueueName());
+            JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap());
+            MBeanServerConnection mbsc = connector.getMBeanServerConnection();
+            JMSQueueControl queueControl = (JMSQueueControl)MBeanServerInvocationHandler.newProxyInstance(mbsc,
+                                                                                              on,
+                                                                                              JMSQueueControl.class,
+                                                                                              false);</code>
+        </pre>
+
+        <li>We retrieve the message counter and display them. MessageCounters are retrieved as <code>JSON Strings</code> for portability reason (whether
+            JMX is used for management or JMS messages). To make it simpler to use them in the code, there is a <code>MessageCounterInfo</code> data structure.</li>
+        <pre class="prettyprint">
+            <code>String counters = queueControl.listMessageCounter();
+            MessageCounterInfo messageCounter = MessageCounterInfo.fromJSON(counters);</code>>
+        </pre>
+
+        <li>We display the message counters</li>
+        <pre class="prettyprint">
+            <code>displayMessageCounter(messageCounter);</code>
+        </pre>
+
+        <p>The message counter contains a variety of metrics on the queue which is sampled (total messages added to the queue, current depth of the queue, deltas since the last sample, timestamp
+            of the last message added, timestamp of the last sample, etc.)</p>
+        <pre class="prettyprint">
+            <code>
+            private void displayMessageCounter(MessageCounterInfo counter)
+            {
+               System.out.format("%s (sample updated at %s)\n",  counter.getName(), counter.getUdpateTimestamp());
+               System.out.format("   %s message(s) added to the queue (since last sample: %s)\n", counter.getCount(),
+                                                                                                  counter.getCountDelta());
+               System.out.format("   %s message(s) in the queue (since last sample: %s)\n", counter.getDepth(),
+                                                                                            counter.getDepthDelta());
+               System.out.format("   last message added at %s\n\n", counter.getLastAddTimestamp());
+            }</code>
+        </pre>
+
+        <li>We sleep again to have the queue sampled</li>
+        <pre class="prettyprint">
+            <code>System.out.println("Sleep a little bit again...");
+            Thread.sleep(3000);</code>
+        </pre>
+
+        <li>We list the message counters again</li>
+        <pre class="prettyprint">
+            <code>counters = queueControl.listMessageCounter();
+            messageCounter = MessageCounterInfo.fromJSON(counters);
+            displayMessageCounter(messageCounter);</code>
+        </pre>
+
+        <p>We will now consume a message from the queue before listing a last time the message counters</p>
+
+        <li>We create a consumer for the queue</li>
+        <pre class="prettyprint">
+            <code>MessageConsumer consumer = session.createConsumer(queue);</code>
+        </pre>
+
+        <li>We start the connection to receive messages on the consumer</li>
+        <pre class="prettyprint">
+           <code>connection.start();</code>
+        </pre>
+
+        <li>We receive a message from the queue</li>
+        <pre class="prettyprint">
+           <code>TextMessage messageReceived = (TextMessage)consumer.receive(5000);
+           System.out.format("Received message: %s\n\n", messageReceived.getText());</code>
+        </pre>
+
+        <li>We sleep one last time to have the queue sampled</li>
+        <pre class="prettyprint">
+            <code>System.out.println("Sleep a little bit one last time...");
+            Thread.sleep(3000);</code>
+        </pre>
+
+        <li>We list the message counters a final time (this time with no message in the queue)</li>
+        <pre class="prettyprint">
+            <code>counters = queueControl.listMessageCounter();
+            messageCounter = MessageCounterInfo.fromJSON(counters);
+            displayMessageCounter(messageCounter);</code>
+        </pre>
+
+        </p>
+        <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>
+
+     <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.message-counters">Message Counters chapter</a></li>
+     <li><a href="../../../docs/api/org/jboss/messaging/core/management/MessageCounterInfo.html">MessageCounterInfo</a> is a helper class used
+        to create a MessageCounterInfo object from the JSON String which represents message counters</li>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java b/examples/features/standard/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java
new file mode 100644
index 0000000..8e6cc26
--- /dev/null
+++ b/examples/features/standard/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java
@@ -0,0 +1,134 @@
+/*
+ * 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 javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.management.MBeanServerConnection;
+import javax.management.MBeanServerInvocationHandler;
+import javax.management.ObjectName;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+import javax.naming.InitialContext;
+
+import org.apache.activemq.artemis.api.core.management.MessageCounterInfo;
+import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
+import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
+
+/**
+ * An example showing how to use message counters to have information on a queue.
+ */
+public class MessageCounterExample {
+
+   private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3001/jmxrmi";
+
+   public static void main(final String[] args) throws Exception {
+      QueueConnection 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
+         QueueConnectionFactory cf = (QueueConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 4.Create a JMS Connection, session and a producer for the queue
+         connection = cf.createQueueConnection();
+         QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer producer = session.createProducer(queue);
+
+         // Step 5. Create and send a Text Message
+         TextMessage message = session.createTextMessage("This is a text message");
+         producer.send(message);
+         System.out.println("Sent message: " + message.getText());
+
+         // Step 6. Sleep a little bit so that the queue is sampled
+         System.out.println("Sleep a little bit to have the queue sampled...");
+         Thread.sleep(3000);
+
+         // Step 7. Use JMX to retrieve the message counters using the JMSQueueControl
+         ObjectName on = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queue.getQueueName());
+         JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, Object>());
+         MBeanServerConnection mbsc = connector.getMBeanServerConnection();
+         JMSQueueControl queueControl = MBeanServerInvocationHandler.newProxyInstance(mbsc, on, JMSQueueControl.class, false);
+
+         // Step 8. List the message counters and convert them to MessageCounterInfo data structure.
+         String counters = queueControl.listMessageCounter();
+         MessageCounterInfo messageCounter = MessageCounterInfo.fromJSON(counters);
+
+         // Step 9. Display the message counter
+         displayMessageCounter(messageCounter);
+
+         // Step 10. Sleep again to have the queue sampled again
+         System.out.println("Sleep a little bit again...");
+         Thread.sleep(3000);
+
+         // Step 11. List the messages counters again
+         counters = queueControl.listMessageCounter();
+         messageCounter = MessageCounterInfo.fromJSON(counters);
+         displayMessageCounter(messageCounter);
+
+         // Step 12. Create a JMS consumer on the queue
+         MessageConsumer consumer = session.createConsumer(queue);
+
+         // Step 13. Start the connection to receive messages on the consumer
+         connection.start();
+
+         // Step 14. Receive a JMS message from the queue. It corresponds to the message sent at step #5
+         TextMessage messageReceived = (TextMessage) consumer.receive(5000);
+         System.out.format("Received message: %s%n%n", messageReceived.getText());
+
+         // Step 15. Sleep on last time to have the queue sampled
+         System.out.println("Sleep a little bit one last time...");
+         Thread.sleep(3000);
+
+         // Step 16. Display one last time the message counter
+         counters = queueControl.listMessageCounter();
+         messageCounter = MessageCounterInfo.fromJSON(counters);
+         displayMessageCounter(messageCounter);
+      }
+      finally {
+         // Step 17. Be sure to close our JMS resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+
+   private static void displayMessageCounter(final MessageCounterInfo counter) {
+      System.out.format("%s (sample updated at %s)%n", counter.getName(), counter.getUdpateTimestamp());
+      System.out.format("   %s message(s) added to the queue (since last sample: %s)%n", counter.getCount(), counter.getCountDelta());
+      System.out.format("   %s message(s) in the queue (since last sample: %s)%n", counter.getDepth(), counter.getDepthDelta());
+      System.out.format("   last message added at %s%n%n", counter.getLastAddTimestamp());
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/message-counters/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-counters/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/message-counters/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/message-counters/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/message-counters/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-counters/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/message-counters/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/message-counters/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/6b17d966/examples/features/standard/message-counters/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-counters/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/message-counters/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..8d4ed29
--- /dev/null
+++ b/examples/features/standard/message-counters/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,86 @@
+<?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 ../../../../src/schema/artemis-server.xsd">
+
+   <jms xmlns="urn:activemq:jms">
+      <!--the queue used by the example-->
+      <queue name="exampleQueue"/>
+
+      <!--the expiry queue where expired messages will be sent-->
+      <queue name="expiryQueue"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+
+
+      <jmx-management-enabled>true</jmx-management-enabled>
+      <message-counter-enabled>true</message-counter-enabled>
+      <message-counter-sample-period>2000</message-counter-sample-period>
+      <message-counter-max-day-history>2</message-counter-max-day-history>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</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 for dead letter queue-->
+         <security-setting match="jms.queue.expiryQueue">
+            <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-settings>
+
+      <address-settings>
+         <!--override the expiry address for the example-->
+         <address-setting match="jms.queue.exampleQueue">
+            <expiry-address>jms.queue.expiryQueue</expiry-address>
+         </address-setting>
+      </address-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/message-counters/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-counters/src/main/resources/jndi.properties b/examples/features/standard/message-counters/src/main/resources/jndi.properties
new file mode 100644
index 0000000..231fa30
--- /dev/null
+++ b/examples/features/standard/message-counters/src/main/resources/jndi.properties
@@ -0,0 +1,21 @@
+# 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
+queue.queue/expiryQueue=expiryQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/message-group/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-group/pom.xml b/examples/features/standard/message-group/pom.xml
new file mode 100644
index 0000000..1c97866
--- /dev/null
+++ b/examples/features/standard/message-group/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>message-group</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Message Group 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>
+                     <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.MessageGroupExample</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>message-group</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/message-group/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-group/readme.html b/examples/features/standard/message-group/readme.html
new file mode 100644
index 0000000..56d2afe
--- /dev/null
+++ b/examples/features/standard/message-group/readme.html
@@ -0,0 +1,152 @@
+<!--
+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 Message Group 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>Message Group 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 configure and use message groups with ActiveMQ Artemis.</p>
+
+     <p>Message groups are sets of messages that has the following characteristics: </p>
+     <li>Messages in a message group share the same group id, i.e. they have same JMSXGroupID string property values.</li>
+     <li>Messages in a message group will be all delivered to no more than one of the queue's consumers. The consumer that receives the
+     first message of a group will receive all the messages that belong to the group.</li>
+
+     <p>You can make any message belong to a message group by setting its 'JMXGroupID' string property to the group id.
+     In this example we create a message group 'Group-0'. And make such a message group of 10 messages. It also create two consumers on the queue
+     where the 10 'Group-0' group messages are to be sent. You can see that with message grouping enabled, all the 10 messages will be received by
+     the first consumer. The second consumer will receive none. </p>
+
+     <p>Alternatively, ActiveMQ's connection factories can be configured to <em>auto group</em> messages. By setting <code>autogroup</code> to </code>true</code> on the <code>ActiveMQConnectionFactory</code>
+        (or setting <code>&lt;autogroup&gt;true&lt;/autogroup&gt;</code> in <code>activemq-jms.xml</code>'s connection factory settings), a random unique id
+        will be picked to create a message group. <em>Every messages</em> sent by a producer created from this connection factory will automatically
+        be part of this message group.</p>
+
+     <h2>Example step-by-step</h2>
+
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
+        <pre class="prettyprint">
+           <code>InitialContext initialContext = getContext();</code>
+        </pre>
+
+        <li>We look-up the JMS queue object from JNDI</li>
+        <pre class="prettyprint">
+           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>We look-up the JMS connection factory object from JNDI</li>
+        <pre class="prettyprint">
+           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>We create a JMS connection</li>
+        <pre class="prettyprint">
+           <code>connection = cf.createConnection();</code>
+        </pre>
+
+        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
+        <pre class="prettyprint">
+           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
+        </pre>
+
+        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
+        <pre class="prettyprint">
+          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
+       </pre>
+
+        <li>We create two consumers.</li>
+        <pre class="prettyprint">
+           <code>
+          MessageConsumer consumer1 = session.createConsumer(queue);
+          consumer1.setMessageListener(new SimpleMessageListener("consumer-1"));
+          MessageConsumer consumer2 = session.createConsumer(queue);
+          consumer2.setMessageListener(new SimpleMessageListener("consumer-2"));
+          </code>
+        </pre>
+
+        <li>We create and send 10 text messages with group id 'Group-0'</li>
+        <pre class="prettyprint">
+           <code>
+         int msgCount = 10;
+         TextMessage[] groupMessages = new TextMessage[msgCount];
+         for (int i = 0; i &lt; msgCount; i++)
+         {
+            groupMessages[i] = session.createTextMessage("Group-0 message " + i);
+            groupMessages[i].setStringProperty("JMSXGroupID", "Group-0");
+            producer.send(groupMessages[i]);
+            System.out.println("Sent message: " + groupMessages[i].getText());
+         }
+           </code>
+        </pre>
+
+        <li>We start the connection.</li>
+          <pre class="prettyprint">
+           <code>connection.start();</code>
+        </pre>
+
+        <li>We check the group messages are received by only one consumer</li>
+        <pre class="prettyprint">
+           <code>
+         String trueReceiver = messageReceiverMap.get(groupMessages[0].getText());
+         for (TextMessage grpMsg : groupMessages)
+         {
+            String receiver = messageReceiverMap.get(grpMsg.getText());
+            if (!trueReceiver.equals(receiver))
+            {
+               System.out.println("Group message [" + grpMsg.getText() + "[ went to wrong receiver: " + receiver);
+               result = false;
+            }
+         }
+           </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>
+
+     <h2>More information</h2>
+
+     <ul>
+         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#message-grouping">Message Grouping chapter</a></li>
+     </ul>
+
+  </body>
+</html>


[22/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml
new file mode 100644
index 0000000..98b8f04
--- /dev/null
+++ b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml
@@ -0,0 +1,79 @@
+<!--
+  ~ 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:61618</connector>
+         <!-- connector to the server0 -->
+         <connector name="server0-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <static-connectors>
+               <connector-ref>server0-connector</connector-ref>
+            </static-connectors>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml
new file mode 100644
index 0000000..40bef87
--- /dev/null
+++ b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml
@@ -0,0 +1,79 @@
+<!--
+  ~ 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:61619</connector>
+         <!-- connector to the server0 -->
+         <connector name="server0-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61619</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <static-connectors>
+               <connector-ref>server0-connector</connector-ref>
+            </static-connectors>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-static-oneway/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-oneway/pom.xml b/examples/features/clustered/clustered-static-oneway/pom.xml
new file mode 100644
index 0000000..18a303c
--- /dev/null
+++ b/examples/features/clustered/clustered-static-oneway/pom.xml
@@ -0,0 +1,198 @@
+<?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.clustered</groupId>
+      <artifactId>broker-clustered</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>clustered-static-oneway</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Clustered Static One Way Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server2</instance>
+                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server2</location>
+                     <testURI>tcp://localhost:61618</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server2</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ClusterStaticOnewayExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server2</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <artifactId>clustered-static-oneway</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-static-oneway/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-oneway/readme.html b/examples/features/clustered/clustered-static-oneway/readme.html
new file mode 100644
index 0000000..04334a5
--- /dev/null
+++ b/examples/features/clustered/clustered-static-oneway/readme.html
@@ -0,0 +1,64 @@
+<!--
+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 Load Balanced Static Clustered 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 Load Balanced Static Clustered One Way 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 demonstrates a JMS queue deployed on three different nodes. The three nodes are configured to form a one way cluster
+       from a <em>static</em> list of nodes. </p>
+     <p>A one way cluster is different from a symmetrical cluster in that each node is only connected to one another node in
+     a chain type fashion, so server 0 -> server 1 -> server 2</p>
+     <p>We then create a consumer on the queue on each node, and we create a producer on only one of the nodes.</p>
+     <p>We then send some messages via the producer, and we verify that <b>all</b> consumers receive the sent messages
+     in a round-robin fashion.</p>
+     <p>In other words, ActiveMQ Artemis <b>load balances</b> the sent messages across all consumers on the cluster</p>
+     <p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
+     JNDI, these could be instantiated directly.</p>
+     <p>Here's the relevant snippet from the server configuration, which tells the server to form a one way cluster between the three nodes
+     and to load balance the messages between the nodes. Note that we have set <em>allow-direct-connections-only</em> to true,
+     this means that this server will only ever connect the address's specified in the list of connectors. ALso notice
+     that <em>max-hops</em> is 2, this is because server 0 is not directly connected to server 2, 2 hops in fact, so we
+     allow any updates from servers up to 2 hops away</p>
+     <pre class="prettyprint">
+     <code>
+     &lt;cluster-connection name="my-cluster"&gt;
+        &lt;address&gt;jms&lt;/address&gt;
+        &lt;connector-ref>netty-connector&lt;/connector-ref>
+        &lt;retry-interval&gt;500&lt;/retry-interval&gt;
+        &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
+        &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
+        &lt;max-hops&gt;2&lt;/max-hops&gt;
+        &lt;static-connectors allow-direct-connections-only="true"&gt;
+            &lt;connector-ref>server1-connector&lt;/connector-ref&gt;
+         &lt;/static-connectors&gt;
+     &lt;/cluster-connection&gt;
+     </code>
+     </pre>
+     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
+     section of the user manual.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java b/examples/features/clustered/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java
new file mode 100644
index 0000000..0397907
--- /dev/null
+++ b/examples/features/clustered/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java
@@ -0,0 +1,159 @@
+/*
+ * 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 org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.util.ServerUtil;
+
+/**
+ * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
+ * nodes of the cluster. The cluster is created from a static list of nodes.
+ */
+public class ClusterStaticOnewayExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection initialConnection = null;
+
+      Connection connection0 = null;
+
+      Connection connection1 = null;
+
+      Connection connection2 = null;
+
+      try {
+         // Step 2. Instantiate Queue
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
+
+         //step 4. grab an initial connection and wait, in reality you wouldn't do it this way but since we want to ensure an
+         // equal load balance we do this and then create 4 connections round robined
+         initialConnection = cf0.createConnection();
+
+         Thread.sleep(2000);
+         // Step 5. We create a JMS Connection connection0 which is a connection to server 0
+         connection0 = cf0.createConnection();
+
+         // Step 6. We create a JMS Connection connection1 which is a connection to server 1
+         connection1 = cf0.createConnection();
+
+         // Step 7. We create a JMS Connection connection0 which is a connection to server 2
+         connection2 = cf0.createConnection();
+
+         // Step 8. We create a JMS Session on server 0
+         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 9. We create a JMS Session on server 1
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 10. We create a JMS Session on server 2
+         Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 11. We start the connections to ensure delivery occurs on them
+         connection0.start();
+
+         connection1.start();
+
+         connection2.start();
+
+         // Step 12. We create JMS MessageConsumer objects on server 0,server 1 and server 2
+         MessageConsumer consumer0 = session0.createConsumer(queue);
+
+         MessageConsumer consumer1 = session1.createConsumer(queue);
+
+         MessageConsumer consumer2 = session2.createConsumer(queue);
+
+         Thread.sleep(4000);
+
+         int con0Node = ServerUtil.getServer(connection0);
+         int con1Node = ServerUtil.getServer(connection1);
+         int con2Node = ServerUtil.getServer(connection2);
+
+         System.out.println("con0Node = " + con0Node);
+         System.out.println("con1Node = " + con1Node);
+         System.out.println("con2Node = " + con2Node);
+
+         if (con0Node + con1Node + con2Node != 3) {
+            throw new IllegalStateException("connections not load balanced");
+         }
+         // Step 13. We create a JMS MessageProducer object on server 0
+         Session sendSession = ServerUtil.getServerConnection(0, connection0, connection1, connection2).createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         MessageProducer producer = sendSession.createProducer(queue);
+
+         // Step 14. We send some messages to server 0
+
+         final int numMessages = 18;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session0.createTextMessage("This is text message " + i);
+
+            producer.send(message);
+
+            System.out.println("Sent message: " + message.getText());
+         }
+         Thread.sleep(2000);
+         // Step 15. We now consume those messages on *both* server 0,server 1 and 2.
+         // We note the messages have been distributed between servers in a round robin fashion
+         // JMS Queues implement point-to-point message where each message is only ever consumed by a
+         // maximum of one consumer
+
+         for (int i = 0; i < numMessages; i += 3) {
+            TextMessage message0 = (TextMessage) consumer0.receive(5000);
+
+            System.out.println("Got message: " + message0.getText() + " from node " + con0Node);
+
+            TextMessage message1 = (TextMessage) consumer1.receive(5000);
+
+            System.out.println("Got message: " + message1.getText() + " from node " + con1Node);
+
+            TextMessage message2 = (TextMessage) consumer2.receive(5000);
+
+            System.out.println("Got message: " + message2.getText() + " from node " + con2Node);
+         }
+      }
+      finally {
+         // Step 15. Be sure to close our resources!
+
+         if (initialConnection != null) {
+            initialConnection.close();
+         }
+
+         if (connection0 != null) {
+            connection0.close();
+         }
+
+         if (connection1 != null) {
+            connection1.close();
+         }
+
+         if (connection2 != null) {
+            connection2.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..3e86ed3
--- /dev/null
+++ b/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,79 @@
+<!--
+  ~ 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>
+         <!-- connector to the server1 -->
+         <connector name="server1-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>2</max-hops>
+            <static-connectors allow-direct-connections-only="true">
+               <connector-ref>server1-connector</connector-ref>
+            </static-connectors>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..1464ea9
--- /dev/null
+++ b/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,79 @@
+<!--
+  ~ 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:61617</connector>
+         <!-- connector to the server0 -->
+         <connector name="server2-connector">tcp://localhost:61618</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>2</max-hops>
+            <static-connectors allow-direct-connections-only="true">
+               <connector-ref>server2-connector</connector-ref>
+            </static-connectors>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml b/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml
new file mode 100644
index 0000000..b1043f5
--- /dev/null
+++ b/examples/features/clustered/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml
@@ -0,0 +1,74 @@
+<!--
+  ~ 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:61618</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>2</max-hops>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-topic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-topic/pom.xml b/examples/features/clustered/clustered-topic/pom.xml
new file mode 100644
index 0000000..bff7c70
--- /dev/null
+++ b/examples/features/clustered/clustered-topic/pom.xml
@@ -0,0 +1,153 @@
+<?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.clustered</groupId>
+      <artifactId>broker-clustered</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>clustered-topic</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Clustered Topic 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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ClusteredTopicExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <artifactId>clustered-topic</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-topic/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-topic/readme.html b/examples/features/clustered/clustered-topic/readme.html
new file mode 100644
index 0000000..e46fca8
--- /dev/null
+++ b/examples/features/clustered/clustered-topic/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 Clustered Topic 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 Clustered Topic 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 a JMS Topic deployed on two different nodes. The two nodes are configured to form a cluster.</p>
+     <p>We then create a subscriber on the topic on each node, and we create a producer on only one of the nodes.</p>
+     <p>We then send some messages via the producer, and we verify that <b>both</b> subscribers receive all the
+     sent messages.</p>
+     <p>A JMS Topic is an example of <b>publish-subscribe</b> messaging where all subscribers receive all the
+     messages sent to the topic (assuming they have no message selectors).</p>
+     <p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
+     JNDI, these could be instantiated directly.
+     <p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster between the two nodes
+     and to load balance the messages between the nodes.</p>
+     <pre class="prettyprint">
+     <code>&lt;cluster-connection name="my-cluster"&gt;
+        &lt;address&gt;jms&lt;/address&gt;
+        &lt;retry-interval&gt;500&lt;/retry-interval&gt;
+        &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
+        &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
+        &lt;max-hops&gt;1&lt;/max-hops&gt;
+        &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
+     &lt;/cluster-connection&gt;
+     </code>
+     </pre>
+     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
+     section of the user manual.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java b/examples/features/clustered/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java
new file mode 100644
index 0000000..f3ce9a0
--- /dev/null
+++ b/examples/features/clustered/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java
@@ -0,0 +1,129 @@
+/*
+ * 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.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.naming.InitialContext;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * A simple example that shows a JMS Topic clustered across two nodes of a cluster.
+ * Messages are sent on one node and received by consumers on both nodes.
+ */
+public class ClusteredTopicExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection0 = null;
+
+      Connection connection1 = null;
+
+      InitialContext ic0 = null;
+
+      InitialContext ic1 = null;
+
+      try {
+
+         // Step 1. Instantiate topic
+         Topic topic = ActiveMQJMSClient.createTopic("exampleTopic");
+
+         // Step 2. Look-up a JMS Connection Factory object from JNDI on server 0
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
+
+         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 1
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
+
+         // Step 4. We create a JMS Connection connection0 which is a connection to server 0
+         connection0 = cf0.createConnection();
+
+         // Step 5. We create a JMS Connection connection1 which is a connection to server 1
+         connection1 = cf1.createConnection();
+
+         // Step 6. We create a JMS Session on server 0
+         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 7. We create a JMS Session on server 1
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 8. We start the connections to ensure delivery occurs on them
+         connection0.start();
+
+         connection1.start();
+
+         // Step 9. We create JMS MessageConsumer objects on server 0 and server 1
+         MessageConsumer consumer0 = session0.createConsumer(topic);
+
+         MessageConsumer consumer1 = session1.createConsumer(topic);
+
+         Thread.sleep(1000);
+
+         // Step 10. We create a JMS MessageProducer object on server 0
+         MessageProducer producer = session0.createProducer(topic);
+
+         // Step 11. We send some messages to server 0
+
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session0.createTextMessage("This is text message " + i);
+
+            producer.send(message);
+
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 12. We now consume those messages on *both* server 0 and server 1.
+         // We note that all messages have been consumed by *both* consumers.
+         // JMS Topics implement *publish-subscribe* messaging where all consumers get a copy of all messages
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message0 = (TextMessage) consumer0.receive(5000);
+
+            System.out.println("Got message: " + message0.getText() + " from node 0");
+
+            TextMessage message1 = (TextMessage) consumer1.receive(5000);
+
+            System.out.println("Got message: " + message1.getText() + " from node 1");
+         }
+      }
+      finally {
+         // Step 15. Be sure to close our JMS resources!
+         if (connection0 != null) {
+            connection0.close();
+         }
+
+         if (connection1 != null) {
+            connection1.close();
+         }
+
+         if (ic0 != null) {
+            ic0.close();
+         }
+
+         if (ic1 != null) {
+            ic1.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-topic/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-topic/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-topic/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..a4e8dde
--- /dev/null
+++ b/examples/features/clustered/clustered-topic/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,97 @@
+<?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 topic used by the example-->
+      <topic name="exampleTopic"/>
+   </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>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!--  other configuration -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.topic.exampleTopic">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-topic/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-topic/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-topic/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..78beec3
--- /dev/null
+++ b/examples/features/clustered/clustered-topic/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,95 @@
+<?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 topic used by the example-->
+      <topic name="exampleTopic"/>
+   </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:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!--  other configuration -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.topic.exampleTopic">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/pom.xml b/examples/features/clustered/pom.xml
new file mode 100644
index 0000000..49b12e2
--- /dev/null
+++ b/examples/features/clustered/pom.xml
@@ -0,0 +1,77 @@
+<?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.clustered</groupId>
+      <artifactId>broker-features</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <groupId>org.apache.activemq.examples.clustered</groupId>
+   <artifactId>broker-clustered</artifactId>
+   <packaging>pom</packaging>
+   <name>ActiveMQ Artemis Clustered Examples</name>
+
+   <!-- Properties -->
+   <properties>
+      <!--
+      Explicitly declaring the source encoding eliminates the following
+      message: [WARNING] Using platform encoding (UTF-8 actually) to copy
+      filtered resources, i.e. build is platform dependent!
+      -->
+      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+      <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
+   </properties>
+
+   <profiles>
+      <profile>
+         <id>examples</id>
+         <modules>
+            <module>client-side-load-balancing</module>
+            <module>clustered-durable-subscription</module>
+            <module>clustered-grouping</module>
+            <module>clustered-jgroups</module>
+            <module>clustered-queue</module>
+            <module>clustered-static-oneway</module>
+            <module>clustered-static-discovery</module>
+            <module>clustered-topic</module>
+            <module>queue-message-redistribution</module>
+            <module>symmetric-cluster</module>
+         </modules>
+      </profile>
+      <profile>
+         <id>release</id>
+         <modules>
+            <module>clustered-durable-subscription</module>
+            <module>clustered-grouping</module>
+            <module>clustered-jgroups</module>
+            <module>clustered-queue</module>
+            <module>clustered-static-oneway</module>
+            <module>clustered-static-discovery</module>
+            <module>clustered-topic</module>
+            <module>queue-message-redistribution</module>
+            <module>symmetric-cluster</module>
+         </modules>
+      </profile>
+   </profiles>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/queue-message-redistribution/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/queue-message-redistribution/pom.xml b/examples/features/clustered/queue-message-redistribution/pom.xml
new file mode 100644
index 0000000..4816ad0
--- /dev/null
+++ b/examples/features/clustered/queue-message-redistribution/pom.xml
@@ -0,0 +1,155 @@
+<?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.clustered</groupId>
+      <artifactId>broker-clustered</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>queue-message-redistribution</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Queue Message Redistribution 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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.QueueMessageRedistributionExample
+                     </clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <artifactId>queue-message-redistribution</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/queue-message-redistribution/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/queue-message-redistribution/readme.html b/examples/features/clustered/queue-message-redistribution/readme.html
new file mode 100644
index 0000000..35fcafe
--- /dev/null
+++ b/examples/features/clustered/queue-message-redistribution/readme.html
@@ -0,0 +1,61 @@
+<!--
+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 Message Redistribution 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>Message Redistribution Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
+     <p>This example demonstrates message redistribution between queues with the same name deployed in different
+     nodes of a cluster.</p>
+     <p>As demontrated in the clustered queue example, if queues with the same name are deployed on different nodes of
+     a cluster, ActiveMQ Artemis can be configured to load balance messages between the nodes on the server side.</p>
+     <p>However, if the consumer(s) on a particular node are closed, then messages in the queue at that node can
+     appear to be stranded, since they have no local consumers.</p>
+     <p>If this is undesirable, ActiveMQ Artemis can be configured to <b>redistribute</b> messages from the node
+     with no consumers, to nodes where there are consumers. If the consumers have JMS selectors set on them, then they
+     will only be redistributed to nodes with consumers whose selectors match.</p>
+     <p>By default, message redistribution is disabled, but can be enabled by specifying some AddressSettings configuration
+     in either <code>activemq-queues.xml</code> or <code>broker.xml</code></p>
+     <p>Setting <code>redistribution-delay</code> to <code>0</code> will cause redistribution to occur immediately
+     once there are no more matching consumers on a particular queue instance. Setting it to a positive value > 0 specifies
+     a delay in milliseconds before attempting to redistribute. The delay is useful in the case that another consumer is
+     likely to be created on the queue, to avoid unnecessary redistribution.</p>
+     <p>Here's the relevant snippet from the <code>activemq-queues.xml</code> configuration, which tells the server
+     to use a redistribution delay of <code>0</code> on any jms queues, i.e. any queues whose name starts with
+     <code>jms.</code></p>
+     <pre class="prettyprint">
+     <code>
+  &lt;address-setting match="jms.#"&gt;
+      &lt;redistribution-delay&gt;0&lt;/redistribution-delay&gt;
+   &lt;/address-setting&gt;
+   </code>
+     </pre>
+     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
+     section of the user manual.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
----------------------------------------------------------------------
diff --git a/examples/features/clustered/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java b/examples/features/clustered/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
new file mode 100644
index 0000000..b3c056b
--- /dev/null
+++ b/examples/features/clustered/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
@@ -0,0 +1,145 @@
+/*
+ * 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 org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * This example demonstrates a queue with the same name deployed on two nodes of a cluster.
+ * Messages are initially round robin'd between both nodes of the cluster.
+ * The consumer on one of the nodes is then closed, and we demonstrate that the "stranded" messages
+ * are redistributed to the other node which has a consumer so they can be consumed.
+ */
+public class QueueMessageRedistributionExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection0 = null;
+
+      Connection connection1 = null;
+
+      try {
+         // Step 2. Look-up the JMS Queue object from JNDI
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
+
+         // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
+
+         // Step 6. We create a JMS Connection connection0 which is a connection to server 0
+         connection0 = cf0.createConnection();
+
+         // Step 7. We create a JMS Connection connection1 which is a connection to server 1
+         connection1 = cf1.createConnection();
+
+         // Step 8. We create a JMS Session on server 0, note the session is CLIENT_ACKNOWLEDGE
+         Session session0 = connection0.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+         // Step 9. We create a JMS Session on server 1, note the session is CLIENT_ACKNOWLEDGE
+         Session session1 = connection1.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+         // Step 10. We start the connections to ensure delivery occurs on them
+         connection0.start();
+
+         connection1.start();
+
+         // Step 11. We create JMS MessageConsumer objects on server 0 and server 1
+         MessageConsumer consumer0 = session0.createConsumer(queue);
+
+         MessageConsumer consumer1 = session1.createConsumer(queue);
+
+         Thread.sleep(1000);
+
+         // Step 12. We create a JMS MessageProducer object on server 0
+         MessageProducer producer = session0.createProducer(queue);
+
+         // Step 13. We send some messages to server 0
+
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session0.createTextMessage("This is text message " + i);
+
+            producer.send(message);
+
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 14. We now consume those messages on *both* server 0 and server 1.
+         // We note the messages have been distributed between servers in a round robin fashion
+         // JMS Queues implement point-to-point message where each message is only ever consumed by a
+         // maximum of one consumer
+
+         TextMessage message0 = null;
+
+         TextMessage message1 = null;
+
+         for (int i = 0; i < numMessages; i += 2) {
+            message0 = (TextMessage) consumer0.receive(5000);
+
+            System.out.println("Got message: " + message0.getText() + " from node 0");
+
+            message1 = (TextMessage) consumer1.receive(5000);
+
+            System.out.println("Got message: " + message1.getText() + " from node 1");
+         }
+
+         // Step 15. We acknowledge the messages consumed on node 0. The sessions are CLIENT_ACKNOWLEDGE so
+         // messages will not get acknowledged until they are explicitly acknowledged.
+         // Note that we *do not* acknowledge the message consumed on node 1 yet.
+         message0.acknowledge();
+
+         // Step 16. We now close the session and consumer on node 1. (Closing the session automatically closes the
+         // consumer)
+         session1.close();
+
+         // Step 17. Since there is no more consumer on node 1, the messages on node 1 are now stranded (no local
+         // consumers)
+         // so ActiveMQ Artemis will redistribute them to node 0 so they can be consumed.
+
+         for (int i = 0; i < numMessages; i += 2) {
+            message0 = (TextMessage) consumer0.receive(5000);
+
+            System.out.println("Got message: " + message0.getText() + " from node 0");
+         }
+
+         // Step 18. We ack the messages.
+         message0.acknowledge();
+      }
+      finally {
+         // Step 18. Be sure to close our resources!
+
+         if (connection0 != null) {
+            connection0.close();
+         }
+
+         if (connection1 != null) {
+            connection1.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..70ff4d4
--- /dev/null
+++ b/examples/features/clustered/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,106 @@
+<?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>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>ON_DEMAND</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+      <address-settings>
+         <!-- We set a redistribution delay of zero on all jms queues and topic subscriptions
+         Default redistribution delay as -1 which means "disable redistribution"
+         Setting it to a value > 0 means how long to wait before redistributing, if a consumer is closed
+         then another one quickly recreated you might want to set it thus, to avoid unnecessary
+         redistribution -->
+         <address-setting match="jms.#">
+            <redistribution-delay>0</redistribution-delay>
+         </address-setting>
+      </address-settings>
+
+   </core>
+</configuration>


[26/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic-selector-example2/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-selector-example2/readme.html b/examples/broker-features/standard/topic-selector-example2/readme.html
deleted file mode 100644
index 608e3d8..0000000
--- a/examples/broker-features/standard/topic-selector-example2/readme.html
+++ /dev/null
@@ -1,47 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Topic Selector Example 2</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 Topic Selector Example 2</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
-
-
-     <p>This example shows you how to selectively consume messages using message selectors with topic consumers.</p>
-
-     <p>Message selectors are strings with special syntax that can be used in creating consumers. Message consumers
-     that are thus created only receive messages that match its selector. On message delivering, the ActiveMQ
-     Server evaluates the corresponding message headers of the messages against each selector, if any, and then delivers
-     the 'matched' messages to its consumer. Please consult the JMS 1.1 specification for full details.</p>
-
-     <p>In this example, three message consumers are created on a topic. The first consumer is created with selector
-     <code>'color=red'</code>, it only receives messages that
-     have a 'color' string property of 'red' value; the second is created with selector <code>'color=green'</code>, it
-     only receives messages who have a 'color' string property of
-     'green' value; and the third without a selector, which means it receives all messages. To illustrate, three messages
-     with different 'color' property values are created and sent.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java b/examples/broker-features/standard/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java
deleted file mode 100644
index 464b21b..0000000
--- a/examples/broker-features/standard/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java
+++ /dev/null
@@ -1,145 +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.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.naming.InitialContext;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * A simple JMS example that consumes messages using selectors.
- */
-public class TopicSelectorExample2 {
-
-   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. perform a lookup on the topic
-         Topic topic = (Topic) initialContext.lookup("topic/exampleTopic");
-
-         // 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. Start the Connection
-         connection.start();
-
-         // Step 6. Create a JMS Session
-         Session producerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 7. Create a Message Producer
-         MessageProducer producer = producerSession.createProducer(topic);
-
-         // 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(topic, 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(topic, greenSelector);
-         greenConsumer.setMessageListener(new SimpleMessageListener("green", result));
-
-         // Step 11. Create another JMS message consumer that receives all messages.
-         Session allSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageConsumer allConsumer = allSession.createConsumer(topic);
-         allConsumer.setMessageListener(new SimpleMessageListener("all", result));
-
-         // Step 12. Create three messages, each has a color property
-         TextMessage redMessage = producerSession.createTextMessage("Red");
-         redMessage.setStringProperty("color", "red");
-         TextMessage greenMessage = producerSession.createTextMessage("Green");
-         greenMessage.setStringProperty("color", "green");
-         TextMessage blueMessage = producerSession.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 14. Be sure to close our JMS resources!
-         if (connection != null) {
-            connection.close();
-         }
-
-         // Also the initialContext
-         if (initialContext != null) {
-            initialContext.close();
-         }
-      }
-   }
-}
-
-class SimpleMessageListener implements MessageListener {
-
-   private final String name;
-   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("all")) {
-            result.set(false);
-         }
-      }
-      catch (JMSException e) {
-         e.printStackTrace();
-         result.set(false);
-      }
-   }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index d45eb5d..0000000
--- a/examples/broker-features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?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 topic used by the example-->
-      <topic name="exampleTopic"/>
-   </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>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example topic-->
-         <security-setting match="jms.topic.exampleTopic">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic-selector-example2/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic-selector-example2/src/main/resources/jndi.properties b/examples/broker-features/standard/topic-selector-example2/src/main/resources/jndi.properties
deleted file mode 100644
index 54bed6d..0000000
--- a/examples/broker-features/standard/topic-selector-example2/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-topic.topic/exampleTopic=exampleTopic

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic/pom.xml b/examples/broker-features/standard/topic/pom.xml
deleted file mode 100644
index 7cc643e..0000000
--- a/examples/broker-features/standard/topic/pom.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?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>topic</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Topic 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>
-                     <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.TopicExample</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>topic</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic/readme.html b/examples/broker-features/standard/topic/readme.html
deleted file mode 100644
index 8bfa903..0000000
--- a/examples/broker-features/standard/topic/readme.html
+++ /dev/null
@@ -1,36 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Topic 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 Topic 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 Topic with ActiveMQ Artemis.</p>
-     <p>Topics are a standard part of JMS, please consult the JMS 1.1 specification for full details.</p>
-     <p>A Topic is used to send messages using the publish-subscribe model, from a producer to 1 or more consumers.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic/src/main/java/org/apache/activemq/artemis/jms/example/TopicExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic/src/main/java/org/apache/activemq/artemis/jms/example/TopicExample.java b/examples/broker-features/standard/topic/src/main/java/org/apache/activemq/artemis/jms/example/TopicExample.java
deleted file mode 100644
index 1c8695b..0000000
--- a/examples/broker-features/standard/topic/src/main/java/org/apache/activemq/artemis/jms/example/TopicExample.java
+++ /dev/null
@@ -1,94 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.naming.InitialContext;
-
-/**
- * A simple JMS Topic example that creates a producer and consumer on a queue and sends and receives a message.
- */
-public class TopicExample {
-
-   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 topic
-         Topic topic = (Topic) initialContext.lookup("topic/exampleTopic");
-
-         // 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 Message Producer
-         MessageProducer producer = session.createProducer(topic);
-
-         // Step 7. Create a JMS Message Consumer
-         MessageConsumer messageConsumer1 = session.createConsumer(topic);
-
-         // Step 8. Create a JMS Message Consumer
-         MessageConsumer messageConsumer2 = session.createConsumer(topic);
-
-         // Step 9. Create a Text Message
-         TextMessage message = session.createTextMessage("This is a text message");
-
-         System.out.println("Sent message: " + message.getText());
-
-         // Step 10. Send the Message
-         producer.send(message);
-
-         // Step 11. Start the Connection
-         connection.start();
-
-         // Step 12. Receive the message
-         TextMessage messageReceived = (TextMessage) messageConsumer1.receive();
-
-         System.out.println("Consumer 1 Received message: " + messageReceived.getText());
-
-         // Step 13. Receive the message
-         messageReceived = (TextMessage) messageConsumer2.receive();
-
-         System.out.println("Consumer 2 Received message: " + messageReceived.getText());
-      }
-      finally {
-         // Step 14. Be sure to close our JMS resources!
-         if (connection != null) {
-            connection.close();
-         }
-
-         // Also the initialContext
-         if (initialContext != null) {
-            initialContext.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/topic/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index fd6671c..0000000
--- a/examples/broker-features/standard/topic/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?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 topic used by the example-->
-      <topic name="exampleTopic"/>
-   </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>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-      <security-settings>
-         <!--security for example topic-->
-         <security-setting match="jms.topic.exampleTopic">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/topic/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/topic/src/main/resources/jndi.properties b/examples/broker-features/standard/topic/src/main/resources/jndi.properties
deleted file mode 100644
index 54bed6d..0000000
--- a/examples/broker-features/standard/topic/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-topic.topic/exampleTopic=exampleTopic

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/transactional/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/transactional/pom.xml b/examples/broker-features/standard/transactional/pom.xml
deleted file mode 100644
index 660d262..0000000
--- a/examples/broker-features/standard/transactional/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>transactional</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Transactional 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>
-                     <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.TransactionalExample</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>transactional</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/transactional/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/transactional/readme.html b/examples/broker-features/standard/transactional/readme.html
deleted file mode 100644
index b171c0a..0000000
--- a/examples/broker-features/standard/transactional/readme.html
+++ /dev/null
@@ -1,40 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Transactional Session 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 Transactional Session Example</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
-
-
-     <p>This example shows you how to use a transacted Session with ActiveMQ Artemis.</p>
-     <p>Firstly 2 messages are sent via the transacted sending session before being committed. This ensures that both message
-     are sent</p>
-     <p>Secondly the receiving session receives the messages firstly demonstrating a message being redelivered after the session
-     being rolled back and then acknowledging receipt of the messages via the commit method.</p>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/transactional/src/main/java/org/apache/activemq/artemis/jms/example/TransactionalExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/transactional/src/main/java/org/apache/activemq/artemis/jms/example/TransactionalExample.java b/examples/broker-features/standard/transactional/src/main/java/org/apache/activemq/artemis/jms/example/TransactionalExample.java
deleted file mode 100644
index 09c2a3d..0000000
--- a/examples/broker-features/standard/transactional/src/main/java/org/apache/activemq/artemis/jms/example/TransactionalExample.java
+++ /dev/null
@@ -1,126 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-/**
- * A simple JMS example that sends and consume message transactionally.
- */
-public class TransactionalExample {
-
-   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. Look-up the JMS topic
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-
-         // Step 3. Look-up the JMS connection factory
-         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 4. Create a JMS connection
-         connection = cf.createConnection();
-
-         // Step 5. Start the connection
-         connection.start();
-
-         // Step 6. Create a transactional JMS session
-         Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
-
-         // Step 7. Create a JMS message producer
-         MessageProducer messageProducer = session.createProducer(queue);
-
-         // Step 8. Create a message consumer
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-
-         // Step 9. Create 2 text messages
-         TextMessage message1 = session.createTextMessage("This is a text message1");
-         TextMessage message2 = session.createTextMessage("This is a text message2");
-
-         // Step 10. Send the text messages to the queue
-         messageProducer.send(message1);
-         messageProducer.send(message2);
-
-         System.out.println("Sent message: " + message1.getText());
-         System.out.println("Sent message: " + message2.getText());
-
-         // Step 11. Receive the message, it will return null as the transaction is not committed.
-         TextMessage receivedMessage = (TextMessage) messageConsumer.receive(5000);
-
-         System.out.println("Message received before send commit: " + receivedMessage);
-
-         // Step 12. Commit the session
-         session.commit();
-
-         // Step 13. Receive the messages again
-         receivedMessage = (TextMessage) messageConsumer.receive(5000);
-
-         System.out.println("Message received after send commit: " + receivedMessage.getText());
-
-         // Step 14. Roll back the session, this will cause the received message canceled and redelivered again.
-         session.rollback();
-
-         // Step 15. Receive the message again, we will get two messages
-         receivedMessage = (TextMessage) messageConsumer.receive(5000);
-
-         System.out.println("Message1 received after receive rollback: " + receivedMessage.getText());
-
-         receivedMessage = (TextMessage) messageConsumer.receive(5000);
-
-         System.out.println("Message2 received after receive rollback: " + receivedMessage.getText());
-
-         receivedMessage = (TextMessage) messageConsumer.receive(5000);
-
-         System.out.println("Message3 received after receive rollback: " + receivedMessage);
-
-         // Step 16. Commit the session
-         session.commit();
-
-         // Step 17. Receive the message again. Nothing should be received.
-         receivedMessage = (TextMessage) messageConsumer.receive(5000);
-
-         if (receivedMessage != null) {
-            // This was not supposed to happen
-            throw new IllegalStateException("Message is not null.");
-         }
-
-         System.out.println("Message received after receive commit: " + receivedMessage);
-
-      }
-      finally {
-         if (connection != null) {
-            // Step 18. Be sure to close our JMS resources!
-            connection.close();
-         }
-         if (initialContext != null) {
-            // Step 19. Also close initial context!
-            initialContext.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/transactional/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/transactional/src/main/resources/jndi.properties b/examples/broker-features/standard/transactional/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/transactional/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/xa-heuristic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-heuristic/pom.xml b/examples/broker-features/standard/xa-heuristic/pom.xml
deleted file mode 100644
index 6f4025b..0000000
--- a/examples/broker-features/standard/xa-heuristic/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?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>xa-heuristic</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS XAHeuristicExample 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>
-                     <javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3001 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
-                     </javaOptions>
-                     <ignore>${noServer}</ignore>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.XAHeuristicExample</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>xa-heuristic</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/xa-heuristic/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-heuristic/readme.html b/examples/broker-features/standard/xa-heuristic/readme.html
deleted file mode 100644
index bf44937..0000000
--- a/examples/broker-features/standard/xa-heuristic/readme.html
+++ /dev/null
@@ -1,48 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS XA Heuristic 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 XA Heuristic 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 make an XA heuristic decision through the ActiveMQ Artemis Management Interface.</p>
-
-     <p>A heuristic decision is a unilateral decision to commit or rollback an XA transaction branch after it has
-     been prepared. </p>
-
-     <p>In this example we simulate a transaction manager to control the transactions. First we create an XASession
-     and enlist it in a transaction through its XAResource. We then send a text message, 'hello' and end/prepare the transaction
-     on the XAResource, but neither commit nor roll back the transaction. Another transaction is created and
-     associated with the same XAResource, and a second message, 'world' is sent on behalf of the second transaction. Again we leave
-     the second transaction in prepare state.
-     Then we get the MBeanServerConnection object to manipulate the prepared transactions. To illustrate, we roll back the first
-     transaction but commit the second. This will result in that only the message 'world' is received. </p>
-
-     <p>This example uses JMX to manipulate transactions in a ActiveMQ Artemis Server. For details on JMX facilities with ActiveMQ Artemis,
-     please look at the JMX Example.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java b/examples/broker-features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
deleted file mode 100644
index 8b6be80..0000000
--- a/examples/broker-features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
+++ /dev/null
@@ -1,184 +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.transaction.xa.Xid;
-
-import org.apache.activemq.artemis.utils.Base64;
-
-public class DummyXid implements Xid {
-
-   private static final long serialVersionUID = 407053232840068514L;
-
-   private final byte[] branchQualifier;
-
-   private final int formatId;
-
-   private final byte[] globalTransactionId;
-
-   private int hash;
-
-   private boolean hashCalculated;
-
-   // Static --------------------------------------------------------
-
-   public static String toBase64String(final Xid xid) {
-      return Base64.encodeBytes(DummyXid.toByteArray(xid));
-   }
-
-   private static byte[] toByteArray(final Xid xid) {
-      byte[] branchQualifier = xid.getBranchQualifier();
-      byte[] globalTransactionId = xid.getGlobalTransactionId();
-      int formatId = xid.getFormatId();
-
-      byte[] hashBytes = new byte[branchQualifier.length + globalTransactionId.length + 4];
-      System.arraycopy(branchQualifier, 0, hashBytes, 0, branchQualifier.length);
-      System.arraycopy(globalTransactionId, 0, hashBytes, branchQualifier.length, globalTransactionId.length);
-      byte[] intBytes = new byte[4];
-      for (int i = 0; i < 4; i++) {
-         intBytes[i] = (byte) ((formatId >> i * 8) % 0xFF);
-      }
-      System.arraycopy(intBytes, 0, hashBytes, branchQualifier.length + globalTransactionId.length, 4);
-      return hashBytes;
-   }
-
-   // Constructors --------------------------------------------------
-
-   /**
-    * Standard constructor
-    *
-    * @param branchQualifier
-    * @param formatId
-    * @param globalTransactionId
-    */
-   public DummyXid(final byte[] branchQualifier, final int formatId, final byte[] globalTransactionId) {
-      this.branchQualifier = branchQualifier;
-      this.formatId = formatId;
-      this.globalTransactionId = globalTransactionId;
-   }
-
-   /**
-    * Copy constructor
-    *
-    * @param other
-    */
-   public DummyXid(final Xid other) {
-      branchQualifier = copyBytes(other.getBranchQualifier());
-      formatId = other.getFormatId();
-      globalTransactionId = copyBytes(other.getGlobalTransactionId());
-   }
-
-   // Xid implementation ------------------------------------------------------------------
-
-   public byte[] getBranchQualifier() {
-      return branchQualifier;
-   }
-
-   public int getFormatId() {
-      return formatId;
-   }
-
-   public byte[] getGlobalTransactionId() {
-      return globalTransactionId;
-   }
-
-   // Public -------------------------------------------------------------------------------
-
-   @Override
-   public int hashCode() {
-      if (!hashCalculated) {
-         calcHash();
-      }
-      return hash;
-   }
-
-   @Override
-   public boolean equals(final Object other) {
-      if (this == other) {
-         return true;
-      }
-      if (!(other instanceof Xid)) {
-         return false;
-      }
-      Xid xother = (Xid) other;
-      if (xother.getFormatId() != formatId) {
-         return false;
-      }
-      if (xother.getBranchQualifier().length != branchQualifier.length) {
-         return false;
-      }
-      if (xother.getGlobalTransactionId().length != globalTransactionId.length) {
-         return false;
-      }
-      for (int i = 0; i < branchQualifier.length; i++) {
-         byte[] otherBQ = xother.getBranchQualifier();
-         if (branchQualifier[i] != otherBQ[i]) {
-            return false;
-         }
-      }
-      for (int i = 0; i < globalTransactionId.length; i++) {
-         byte[] otherGtx = xother.getGlobalTransactionId();
-         if (globalTransactionId[i] != otherGtx[i]) {
-            return false;
-         }
-      }
-      return true;
-   }
-
-   @Override
-   public String toString() {
-      return "XidImpl (" + System.identityHashCode(this) +
-         " bq:" +
-         stringRep(branchQualifier) +
-         " formatID:" +
-         formatId +
-         " gtxid:" +
-         stringRep(globalTransactionId);
-   }
-
-   // Private -------------------------------------------------------------------------------
-
-   private String stringRep(final byte[] bytes) {
-      StringBuilder buff = new StringBuilder();
-      for (int i = 0; i < bytes.length; i++) {
-         byte b = bytes[i];
-
-         buff.append(b);
-
-         if (i != bytes.length - 1) {
-            buff.append('.');
-         }
-      }
-
-      return buff.toString();
-   }
-
-   private void calcHash() {
-      byte[] hashBytes = org.apache.activemq.artemis.jms.example.DummyXid.toByteArray(this);
-      String s = new String(hashBytes);
-      hash = s.hashCode();
-      hashCalculated = true;
-   }
-
-   private byte[] copyBytes(final byte[] other) {
-      byte[] bytes = new byte[other.length];
-
-      System.arraycopy(other, 0, bytes, 0, other.length);
-
-      return bytes;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java b/examples/broker-features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java
deleted file mode 100644
index d233731..0000000
--- a/examples/broker-features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java
+++ /dev/null
@@ -1,219 +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.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.jms.XAConnection;
-import javax.jms.XAConnectionFactory;
-import javax.jms.XASession;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-import javax.naming.InitialContext;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
-import org.apache.activemq.artemis.utils.UUIDGenerator;
-
-/**
- * A simple JMS example showing how to administer un-finished transactions.
- */
-public class XAHeuristicExample {
-
-   private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3001/jmxrmi";
-
-   public static void main(final String[] args) throws Exception {
-      Boolean result = true;
-      final ArrayList<String> receiveHolder = new ArrayList<String>();
-      XAConnection connection = null;
-      InitialContext initialContext = null;
-      try {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
-
-         // Step 2. Lookup on the queue
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-
-         // Step 3. Perform a lookup on the XA Connection Factory
-         XAConnectionFactory cf = (XAConnectionFactory) initialContext.lookup("XAConnectionFactory");
-
-         // Step 4.Create a JMS XAConnection
-         connection = cf.createXAConnection();
-
-         // Step 5. Start the connection
-         connection.start();
-
-         // Step 6. Create a JMS XASession
-         XASession xaSession = connection.createXASession();
-
-         // Step 7. Create a normal session
-         Session normalSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 8. Create a normal Message Consumer
-         MessageConsumer normalConsumer = normalSession.createConsumer(queue);
-         normalConsumer.setMessageListener(new SimpleMessageListener(receiveHolder, result));
-
-         // Step 9. Get the JMS Session
-         Session session = xaSession.getSession();
-
-         // Step 10. Create a message producer
-         MessageProducer producer = session.createProducer(queue);
-
-         // Step 11. Create two Text Messages
-         TextMessage helloMessage = session.createTextMessage("hello");
-         TextMessage worldMessage = session.createTextMessage("world");
-
-         // Step 12. create a transaction
-         Xid xid1 = new DummyXid("xa-example1".getBytes(StandardCharsets.ISO_8859_1), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
-
-         // Step 13. Get the JMS XAResource
-         XAResource xaRes = xaSession.getXAResource();
-
-         // Step 14. Begin the Transaction work
-         xaRes.start(xid1, XAResource.TMNOFLAGS);
-
-         // Step 15. do work, sending hello message.
-         producer.send(helloMessage);
-
-         System.out.println("Sent message " + helloMessage.getText());
-
-         // Step 16. Stop the work for xid1
-         xaRes.end(xid1, XAResource.TMSUCCESS);
-
-         // Step 17. Prepare xid1
-         xaRes.prepare(xid1);
-
-         // Step 18. Check none should be received
-         checkNoMessageReceived(receiveHolder);
-
-         // Step 19. Create another transaction.
-         Xid xid2 = new DummyXid("xa-example2".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
-
-         // Step 20. Begin the transaction work
-         xaRes.start(xid2, XAResource.TMNOFLAGS);
-
-         // Step 21. Send the second message
-         producer.send(worldMessage);
-
-         System.out.println("Sent message " + worldMessage.getText());
-
-         // Step 22. Stop the work for xid2
-         xaRes.end(xid2, XAResource.TMSUCCESS);
-
-         // Step 23. prepare xid2
-         xaRes.prepare(xid2);
-
-         // Step 24. Again, no messages should be received!
-         checkNoMessageReceived(receiveHolder);
-
-         // Step 25. Create JMX Connector to connect to the server's MBeanServer
-         JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, String>());
-
-         // Step 26. Retrieve the MBeanServerConnection
-         MBeanServerConnection mbsc = connector.getMBeanServerConnection();
-
-         // Step 27. List the prepared transactions
-         ObjectName serverObject = ObjectNameBuilder.DEFAULT.getActiveMQServerObjectName();
-         String[] infos = (String[]) mbsc.invoke(serverObject, "listPreparedTransactions", null, null);
-
-         System.out.println("Prepared transactions: ");
-         for (String i : infos) {
-            System.out.println(i);
-         }
-
-         // Step 28. Roll back the first transaction
-         mbsc.invoke(serverObject, "rollbackPreparedTransaction", new String[]{DummyXid.toBase64String(xid1)}, new String[]{"java.lang.String"});
-
-         // Step 29. Commit the second one
-         mbsc.invoke(serverObject, "commitPreparedTransaction", new String[]{DummyXid.toBase64String(xid2)}, new String[]{"java.lang.String"});
-
-         Thread.sleep(2000);
-
-         // Step 30. Check the result, only the 'world' message received
-         checkMessageReceived("world", receiveHolder);
-
-         // Step 31. Check the prepared transaction again, should have none.
-         infos = (String[]) mbsc.invoke(serverObject, "listPreparedTransactions", null, null);
-         System.out.println("No. of prepared transactions now: " + infos.length);
-
-         // Step 32. Close the JMX Connector
-         connector.close();
-      }
-      finally {
-         // Step 32. Be sure to close our JMS resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-
-   private static void checkMessageReceived(final String value, ArrayList<String> receiveHolder) {
-      if (receiveHolder.size() != 1) {
-         throw new IllegalStateException("Number of messages received not correct ! -- " + receiveHolder.size());
-      }
-      String msg = receiveHolder.get(0);
-      if (!msg.equals(value)) {
-         throw new IllegalStateException("Received message [" + msg + "], but we expect [" + value + "]");
-      }
-      receiveHolder.clear();
-   }
-
-   private static void checkNoMessageReceived(ArrayList<String> receiveHolder) {
-      if (receiveHolder.size() > 0) {
-         throw new IllegalStateException("Message received, wrong!");
-      }
-      receiveHolder.clear();
-   }
-}
-
-class SimpleMessageListener implements MessageListener {
-
-   ArrayList<String> receiveHolder;
-   Boolean result;
-
-   SimpleMessageListener(ArrayList<String> receiveHolder, Boolean result) {
-      this.receiveHolder = receiveHolder;
-      this.result = result;
-   }
-
-   public void onMessage(final Message message) {
-      try {
-         System.out.println("Message received: " + ((TextMessage) message).getText());
-         receiveHolder.add(((TextMessage) message).getText());
-      }
-      catch (JMSException e) {
-         result = false;
-         e.printStackTrace();
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/xa-heuristic/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-heuristic/src/main/resources/jndi.properties b/examples/broker-features/standard/xa-heuristic/src/main/resources/jndi.properties
deleted file mode 100644
index 77561f7..0000000
--- a/examples/broker-features/standard/xa-heuristic/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,21 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-connectionFactory.XAConnectionFactory=tcp://localhost:61616?type=XA_CF
-queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/xa-receive/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-receive/pom.xml b/examples/broker-features/standard/xa-receive/pom.xml
deleted file mode 100644
index f421aaf..0000000
--- a/examples/broker-features/standard/xa-receive/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>xa-receive</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS XA Receive 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>
-                     <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.XAReceiveExample</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>xa-receive</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/xa-receive/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-receive/readme.html b/examples/broker-features/standard/xa-receive/readme.html
deleted file mode 100644
index ab6d7d7..0000000
--- a/examples/broker-features/standard/xa-receive/readme.html
+++ /dev/null
@@ -1,48 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS XA Receive 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 XA Receive 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 receiving a message within the scope of an XA transaction. When using an XA transaction
-         the message will only be acknowledged and removed from the queue when the transaction is committed.
-     If the transaction is not committed the message maybe redelivered after rollback or during XA recovery.</p>
-
-     <p>ActiveMQ Artemis is JTA aware, meaning you can use ActiveMQ Artemis in an XA transactional environment
-     and participate in XA transactions. It provides the javax.transaction.xa.XAResource interface for that
-     purpose. Users can get a XAConnectionFactory to create XAConnections and XASessions.</p>
-
-     <p>In this example we simulate a transaction manager to control the transactions. First we create an XASession
-      for receiving and a normal session for sending. Then we start a new xa transaction and enlist the receiving
-      XASession through its XAResource. We then send two words, 'hello' and 'world', receive them, and let the
-      transaction roll back. The received messages are cancelled back to the queue. Next we start
-      a new transaction with the same XAResource enlisted, but this time we commit the transaction after receiving the
-      messages. Then we check that no more messages are to be received.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java b/examples/broker-features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
deleted file mode 100644
index 4dbe2f8..0000000
--- a/examples/broker-features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
+++ /dev/null
@@ -1,184 +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 org.apache.activemq.artemis.utils.Base64;
-
-import javax.transaction.xa.Xid;
-
-public class DummyXid implements Xid {
-
-   private static final long serialVersionUID = 407053232840068514L;
-
-   private final byte[] branchQualifier;
-
-   private final int formatId;
-
-   private final byte[] globalTransactionId;
-
-   private int hash;
-
-   private boolean hashCalculated;
-
-   // Static --------------------------------------------------------
-
-   public static String toBase64String(final Xid xid) {
-      return Base64.encodeBytes(DummyXid.toByteArray(xid));
-   }
-
-   private static byte[] toByteArray(final Xid xid) {
-      byte[] branchQualifier = xid.getBranchQualifier();
-      byte[] globalTransactionId = xid.getGlobalTransactionId();
-      int formatId = xid.getFormatId();
-
-      byte[] hashBytes = new byte[branchQualifier.length + globalTransactionId.length + 4];
-      System.arraycopy(branchQualifier, 0, hashBytes, 0, branchQualifier.length);
-      System.arraycopy(globalTransactionId, 0, hashBytes, branchQualifier.length, globalTransactionId.length);
-      byte[] intBytes = new byte[4];
-      for (int i = 0; i < 4; i++) {
-         intBytes[i] = (byte) ((formatId >> i * 8) % 0xFF);
-      }
-      System.arraycopy(intBytes, 0, hashBytes, branchQualifier.length + globalTransactionId.length, 4);
-      return hashBytes;
-   }
-
-   // Constructors --------------------------------------------------
-
-   /**
-    * Standard constructor
-    *
-    * @param branchQualifier
-    * @param formatId
-    * @param globalTransactionId
-    */
-   public DummyXid(final byte[] branchQualifier, final int formatId, final byte[] globalTransactionId) {
-      this.branchQualifier = branchQualifier;
-      this.formatId = formatId;
-      this.globalTransactionId = globalTransactionId;
-   }
-
-   /**
-    * Copy constructor
-    *
-    * @param other
-    */
-   public DummyXid(final Xid other) {
-      branchQualifier = copyBytes(other.getBranchQualifier());
-      formatId = other.getFormatId();
-      globalTransactionId = copyBytes(other.getGlobalTransactionId());
-   }
-
-   // Xid implementation ------------------------------------------------------------------
-
-   public byte[] getBranchQualifier() {
-      return branchQualifier;
-   }
-
-   public int getFormatId() {
-      return formatId;
-   }
-
-   public byte[] getGlobalTransactionId() {
-      return globalTransactionId;
-   }
-
-   // Public -------------------------------------------------------------------------------
-
-   @Override
-   public int hashCode() {
-      if (!hashCalculated) {
-         calcHash();
-      }
-      return hash;
-   }
-
-   @Override
-   public boolean equals(final Object other) {
-      if (this == other) {
-         return true;
-      }
-      if (!(other instanceof Xid)) {
-         return false;
-      }
-      Xid xother = (Xid) other;
-      if (xother.getFormatId() != formatId) {
-         return false;
-      }
-      if (xother.getBranchQualifier().length != branchQualifier.length) {
-         return false;
-      }
-      if (xother.getGlobalTransactionId().length != globalTransactionId.length) {
-         return false;
-      }
-      for (int i = 0; i < branchQualifier.length; i++) {
-         byte[] otherBQ = xother.getBranchQualifier();
-         if (branchQualifier[i] != otherBQ[i]) {
-            return false;
-         }
-      }
-      for (int i = 0; i < globalTransactionId.length; i++) {
-         byte[] otherGtx = xother.getGlobalTransactionId();
-         if (globalTransactionId[i] != otherGtx[i]) {
-            return false;
-         }
-      }
-      return true;
-   }
-
-   @Override
-   public String toString() {
-      return "XidImpl (" + System.identityHashCode(this) +
-         " bq:" +
-         stringRep(branchQualifier) +
-         " formatID:" +
-         formatId +
-         " gtxid:" +
-         stringRep(globalTransactionId);
-   }
-
-   // Private -------------------------------------------------------------------------------
-
-   private String stringRep(final byte[] bytes) {
-      StringBuilder buff = new StringBuilder();
-      for (int i = 0; i < bytes.length; i++) {
-         byte b = bytes[i];
-
-         buff.append(b);
-
-         if (i != bytes.length - 1) {
-            buff.append('.');
-         }
-      }
-
-      return buff.toString();
-   }
-
-   private void calcHash() {
-      byte[] hashBytes = DummyXid.toByteArray(this);
-      String s = new String(hashBytes);
-      hash = s.hashCode();
-      hashCalculated = true;
-   }
-
-   private byte[] copyBytes(final byte[] other) {
-      byte[] bytes = new byte[other.length];
-
-      System.arraycopy(other, 0, bytes, 0, other.length);
-
-      return bytes;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java b/examples/broker-features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java
deleted file mode 100644
index 4c4448d..0000000
--- a/examples/broker-features/standard/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java
+++ /dev/null
@@ -1,145 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.XAConnection;
-import javax.jms.XAConnectionFactory;
-import javax.jms.XASession;
-import javax.naming.InitialContext;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-import java.nio.charset.StandardCharsets;
-
-import org.apache.activemq.artemis.utils.UUIDGenerator;
-
-/**
- * A simple JMS example showing the usage of XA support in JMS.
- */
-public class XAReceiveExample {
-
-   public static void main(final String[] args) throws Exception {
-      XAConnection connection = null;
-      InitialContext initialContext = null;
-      try {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
-
-         // Step 2. Lookup on the queue
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-
-         // Step 3. Perform a lookup on the XA Connection Factory
-         XAConnectionFactory cf = (XAConnectionFactory) initialContext.lookup("XAConnectionFactory");
-
-         // Step 4.Create a JMS XAConnection
-         connection = cf.createXAConnection();
-
-         // Step 5. Start the connection
-         connection.start();
-
-         // Step 6. Create a JMS XASession
-         XASession xaSession = connection.createXASession();
-
-         // Step 7. Create a normal session
-         Session normalSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 8. Create a normal Message Producer
-         MessageProducer normalProducer = normalSession.createProducer(queue);
-
-         // Step 9. Get the JMS Session
-         Session session = xaSession.getSession();
-
-         // Step 10. Create a message consumer
-         MessageConsumer xaConsumer = session.createConsumer(queue);
-
-         // Step 11. Create two Text Messages
-         TextMessage helloMessage = session.createTextMessage("hello");
-         TextMessage worldMessage = session.createTextMessage("world");
-
-         // Step 12. create a transaction
-         Xid xid1 = new DummyXid("xa-example1".getBytes(StandardCharsets.US_ASCII), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
-
-         // Step 13. Get the JMS XAResource
-         XAResource xaRes = xaSession.getXAResource();
-
-         // Step 14. Begin the Transaction work
-         xaRes.start(xid1, XAResource.TMNOFLAGS);
-
-         // Step 15. Send two messages.
-         normalProducer.send(helloMessage);
-         normalProducer.send(worldMessage);
-
-         // Step 16. Receive the message
-         TextMessage rm1 = (TextMessage) xaConsumer.receive();
-         System.out.println("Message received: " + rm1.getText());
-         TextMessage rm2 = (TextMessage) xaConsumer.receive();
-         System.out.println("Message received: " + rm2.getText());
-
-         // Step 17. Stop the work
-         xaRes.end(xid1, XAResource.TMSUCCESS);
-
-         // Step 18. Prepare
-         xaRes.prepare(xid1);
-
-         // Step 19. Roll back the transaction
-         xaRes.rollback(xid1);
-
-         // Step 20. Create another transaction
-         Xid xid2 = new DummyXid("xa-example2".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
-
-         // Step 21. Start the transaction
-         xaRes.start(xid2, XAResource.TMNOFLAGS);
-
-         // Step 22. receive those messages again
-         rm1 = (TextMessage) xaConsumer.receive();
-         System.out.println("Message received again: " + rm1.getText());
-         rm2 = (TextMessage) xaConsumer.receive();
-         System.out.println("Message received again: " + rm2.getText());
-
-         // Step 23. Stop the work
-         xaRes.end(xid2, XAResource.TMSUCCESS);
-
-         // Step 24. Prepare
-         xaRes.prepare(xid2);
-
-         // Step 25. Commit!
-         xaRes.commit(xid2, false);
-
-         // Step 26. Check no more messages are received.
-         TextMessage rm3 = (TextMessage) xaConsumer.receive(2000);
-         if (rm3 == null) {
-            System.out.println("No message received after commit.");
-         }
-         else {
-            throw new IllegalStateException();
-         }
-      }
-      finally {
-         // Step 27. Be sure to close our JMS resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}


[20/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java b/examples/features/ha/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java
new file mode 100644
index 0000000..4dcfd87
--- /dev/null
+++ b/examples/features/ha/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java
@@ -0,0 +1,129 @@
+/*
+ * 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 org.apache.activemq.artemis.api.core.client.FailoverEventListener;
+import org.apache.activemq.artemis.api.core.client.FailoverEventType;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnection;
+import org.apache.activemq.artemis.util.ServerUtil;
+
+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;
+
+/**
+ * This example demonstrates how you can listen on failover event on the client side
+ * <p/>
+ * In this example there are two nodes running in a cluster, both server will be running for start,
+ * but after a while the first server will crash. This will trigger a fail-over event
+ */
+public class ClientSideFailoverListerExample {
+
+   private static Process server0;
+
+   private static Process server1;
+
+   public static void main(final String[] args) throws Exception {
+      InitialContext initialContext = null;
+
+      Connection connectionA = null;
+
+      try {
+         server0 = ServerUtil.startServer(args[0], ClientSideFailoverListerExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], ClientSideFailoverListerExample.class.getSimpleName() + "1", 1, 0);
+
+         // Step 1. Get an initial context for looking up JNDI from server 0
+         initialContext = new InitialContext();
+
+         // Step 2. Look-up the JMS Queue object from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+
+         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 4. We create 1 JMS connections from the same connection factory.
+         // Wait a little while to make sure broadcasts from all nodes have reached the client
+         Thread.sleep(5000);
+         connectionA = connectionFactory.createConnection();
+         ((ActiveMQConnection) connectionA).setFailoverListener(new FailoverListenerImpl());
+
+         // Step 5. We create JMS Sessions
+         Session sessionA = connectionA.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 6. We create JMS MessageProducer objects on the sessions
+         MessageProducer producerA = sessionA.createProducer(queue);
+
+         // Step 7. We send some messages on each producer
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage messageA = sessionA.createTextMessage("A:This is text message " + i);
+            producerA.send(messageA);
+            System.out.println("Sent message: " + messageA.getText());
+
+         }
+
+         // Step 8. We start the connection to consume messages
+         connectionA.start();
+
+         // Step 9. We consume messages from the session A, one at a time.
+         // We reached message no 5 the first server will crash
+         consume(sessionA, queue, numMessages, "A");
+      }
+      finally {
+         // Step 10. Be sure to close our resources!
+
+         if (connectionA != null) {
+            connectionA.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
+      }
+   }
+
+   private static void consume(Session session, Queue queue, int numMessages, String node) throws Exception {
+      MessageConsumer consumer = session.createConsumer(queue);
+
+      for (int i = 0; i < numMessages; i++) {
+         TextMessage message = (TextMessage) consumer.receive(2000);
+         System.out.println("Got message: " + message.getText() + " from node " + node);
+         if (i == 5) {
+            ServerUtil.killServer(server0);
+         }
+      }
+
+      System.out.println("receive other message from node " + node + ": " + consumer.receive(2000));
+
+   }
+
+   private static class FailoverListenerImpl implements FailoverEventListener {
+
+      public void failoverEvent(FailoverEventType eventType) {
+         System.out.println("Failover event triggered :" + eventType.toString());
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/client-side-failoverlistener/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/ha/client-side-failoverlistener/src/main/resources/jndi.properties b/examples/features/ha/client-side-failoverlistener/src/main/resources/jndi.properties
new file mode 100644
index 0000000..7f7a19f
--- /dev/null
+++ b/examples/features/ha/client-side-failoverlistener/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/6b17d966/examples/features/ha/colocated-failover-scale-down/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/colocated-failover-scale-down/pom.xml b/examples/features/ha/colocated-failover-scale-down/pom.xml
new file mode 100644
index 0000000..9213d18
--- /dev/null
+++ b/examples/features/ha/colocated-failover-scale-down/pom.xml
@@ -0,0 +1,103 @@
+<?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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>colocated-failover-scale-down</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Colocated Failover Recover Only Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ColocatedFailoverScaleDownExample
+                     </clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>colocated-failover-scale-down</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/colocated-failover-scale-down/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/ha/colocated-failover-scale-down/readme.html b/examples/features/ha/colocated-failover-scale-down/readme.html
new file mode 100644
index 0000000..8be5030
--- /dev/null
+++ b/examples/features/ha/colocated-failover-scale-down/readme.html
@@ -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.
+-->
+
+<html>
+  <head>
+    <title>ActiveMQ Artemis JMS Colocated Failover Scale Down 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 Colocated Failover Recover Only Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory. This example will always spawn and stop multiple servers.</pre>
+
+
+     <p>This example demonstrates how you can colocate live and backup servers in the same VM. We do this by creating an
+         HA Policy that is colocated. colocated means that backup servers can be created and maintained by live servers on behalf
+         of other requesting live servers. In this example we create a colocated shared store server that will scale down.
+         That is it will not become live but scale down the journal to the colocated live server.
+     <p>This example starts 2 live servers each will request the other to create a backup.</p>
+     <p>The first live server will be killed and the backup in the second will recover the journal and recreate its state
+         in the live server it shares its VM with.</p>
+     <p>The following shows how to configure the backup, the slave is configured <b>&lt;scale-down/></b> which means
+         that the backup server will not fully start on fail over, instead it will just recover the journal and write it
+     to its parent live server.</p>
+     <pre class="prettyprint">
+     <code>&lt;ha-policy>
+         &lt;shared-store>
+             &lt;colocated>
+                 &lt;backup-port-offset>100&lt;/backup-port-offset>
+                 &lt;backup-request-retries>-1&lt;/backup-request-retries>
+                 &lt;backup-request-retry-interval>2000&lt;/backup-request-retry-interval>
+                 &lt;max-backups>1&lt;/max-backups>
+                 &lt;request-backup>true&lt;/request-backup>
+                 &lt;master/>
+                 &lt;slave>
+                     &lt;scale-down/>
+                 &lt;/slave>
+             &lt;/colocated>
+         &lt;/shared-store>
+     &lt;/ha-policy>
+     </code>
+     </pre>
+     <p>Notice that we dont need to specify a scale down connector as it will use most appropriate
+     from the list of available connectors which in  this case is the first INVM connector</p>
+     <p> One other thing to notice is that the cluster connection has its reconnect attempts set to 5, this is so it will
+         disconnect instead of trying to reconnect to a backup that doesn't exist.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java b/examples/features/ha/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java
new file mode 100644
index 0000000..c3a87ec
--- /dev/null
+++ b/examples/features/ha/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java
@@ -0,0 +1,140 @@
+/*
+ * 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 org.apache.activemq.artemis.util.ServerUtil;
+
+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;
+import java.util.Hashtable;
+
+/**
+ * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
+ * nodes of the cluster.
+ */
+public class ColocatedFailoverScaleDownExample {
+
+   private static Process server0;
+
+   private static Process server1;
+
+   public static void main(final String[] args) throws Exception {
+      final int numMessages = 30;
+
+      Connection connection = null;
+      Connection connection1 = null;
+
+      InitialContext initialContext = null;
+      InitialContext initialContext1 = null;
+
+      try {
+         server0 = ServerUtil.startServer(args[0], ColocatedFailoverScaleDownExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], ColocatedFailoverScaleDownExample.class.getSimpleName() + "1", 1, 5000);
+
+         // Step 1. Get an initial context for looking up JNDI for both servers
+         Hashtable<String, Object> properties = new Hashtable<String, Object>();
+         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
+         initialContext1 = new InitialContext(properties);
+
+         properties = new Hashtable<String, Object>();
+         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("queue.queue/exampleQueue", "exampleQueue");
+         initialContext = new InitialContext(properties);
+
+         // Step 2. Look up the JMS resources from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+         ConnectionFactory connectionFactory1 = (ConnectionFactory) initialContext1.lookup("ConnectionFactory");
+
+         // Step 3. Create a JMS Connections
+         connection = connectionFactory.createConnection();
+         connection1 = connectionFactory1.createConnection();
+
+         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
+         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+         Session session1 = connection1.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+         // Step 5. Create a JMS MessageProducers
+         MessageProducer producer = session.createProducer(queue);
+         MessageProducer producer1 = session1.createProducer(queue);
+
+         // Step 6. Send some messages to both servers
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session.createTextMessage("This is text message " + i);
+            producer.send(message);
+            System.out.println("Sent message: " + message.getText());
+            message = session1.createTextMessage("This is another text message " + i);
+            producer1.send(message);
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 7. Crash server #0, the live server, and wait a little while to make sure
+         // it has really crashed
+         ServerUtil.killServer(server0);
+         System.out.println("Waiting for scale-down to complete...");
+         Thread.sleep(10000);
+
+         // Step 8. start the connection ready to receive messages
+         connection1.start();
+
+         // Step 9.create a consumer
+         MessageConsumer consumer = session1.createConsumer(queue);
+
+         // Step 10. Receive and acknowledge all of the sent messages, notice that they will be out of order, this is
+         // because they were initially round robined to both nodes then when the server failed were reloaded into the
+         // live server.
+         TextMessage message0 = null;
+         for (int i = 0; i < numMessages * 2; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            if (message0 == null) {
+               throw new IllegalStateException("Message not received!");
+            }
+            System.out.println("Got message: " + message0.getText());
+         }
+         message0.acknowledge();
+      }
+      finally {
+         // Step 11. Be sure to close our resources!
+
+         if (connection != null) {
+            connection.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection1 != null) {
+            connection1.close();
+         }
+
+         if (initialContext1 != null) {
+            initialContext1.close();
+         }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..60201ca
--- /dev/null
+++ b/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,129 @@
+<?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.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+      <!-- Connectors -->
+
+      <connectors>
+         <connector name="invm-connector">vm://0</connector>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="invm-acceptor">vm://0</acceptor>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <!-- since the backup servers scale down we need a sensible setting here so the bridge will stop -->
+            <reconnect-attempts>5</reconnect-attempts>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- a colocated server that will allow shared store backups to be requested, the default for this template is to scale down-->
+      <ha-policy>
+         <shared-store>
+            <colocated>
+               <backup-port-offset>100</backup-port-offset>
+               <backup-request-retries>-1</backup-request-retries>
+               <backup-request-retry-interval>2000</backup-request-retry-interval>
+               <max-backups>1</max-backups>
+               <request-backup>true</request-backup>
+               <master>
+                  <failover-on-shutdown>true</failover-on-shutdown>
+               </master>
+               <slave>
+                  <scale-down/>
+               </slave>
+            </colocated>
+         </shared-store>
+      </ha-policy>
+
+      <!-- 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.#">
+            <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">
+            <permission type="manage" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..7892fc1
--- /dev/null
+++ b/examples/features/ha/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,127 @@
+<?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.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="invm-connector">vm://0</connector>
+         <connector name="netty-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="invm-acceptor">vm://0</acceptor>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <!-- since the backup servers scale down we need a sensible setting here so the bridge will stop -->
+            <reconnect-attempts>5</reconnect-attempts>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- a colocated server that will allow shared store backups to be requested, the default for this template is to scale down-->
+      <ha-policy>
+         <shared-store>
+            <colocated>
+               <backup-port-offset>100</backup-port-offset>
+               <backup-request-retries>-1</backup-request-retries>
+               <backup-request-retry-interval>2000</backup-request-retry-interval>
+               <max-backups>1</max-backups>
+               <request-backup>true</request-backup>
+               <master/>
+               <slave>
+                  <scale-down/>
+               </slave>
+            </colocated>
+         </shared-store>
+      </ha-policy>
+
+      <!-- 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.#">
+            <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">
+            <permission type="manage" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/colocated-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/colocated-failover/pom.xml b/examples/features/ha/colocated-failover/pom.xml
new file mode 100644
index 0000000..d15a948
--- /dev/null
+++ b/examples/features/ha/colocated-failover/pom.xml
@@ -0,0 +1,102 @@
+<?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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>colocated-failover</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Colocated Failover Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ColocatedFailoverExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>colocated-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/colocated-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/ha/colocated-failover/readme.html b/examples/features/ha/colocated-failover/readme.html
new file mode 100644
index 0000000..a3700d4
--- /dev/null
+++ b/examples/features/ha/colocated-failover/readme.html
@@ -0,0 +1,56 @@
+<!--
+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 Colocated Failover 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 Colocated Failover Shared Store Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory. This example will always spawn and stop multiple servers.</pre>
+
+     <p>This example demonstrates how you can colocate live and backup servers in the same VM. We do this by creating an
+     HA Policy that is colocated. colocated means that backup servers can be created and maintained by live servers on behalf
+     of other requesting live servers. In this example we create a colocated shared store server.
+     <p>This example starts 2 live servers each with a backup server that backs up the other live server.</p>
+     <p>The first live server will be killed and the backup in the second will become live</p>
+     <p>The following shows how to configure the live servers to request and allow backups to be deployed</p>
+     <pre class="prettyprint">
+     <code>&lt;ha-policy>
+         &lt;shared-store>
+             &lt;colocated>
+                 &lt;backup-port-offset>100&lt;/backup-port-offset>
+                 &lt;backup-request-retries>-1&lt;/backup-request-retries>
+                 &lt;backup-request-retry-interval>2000&lt;/backup-request-retry-interval>
+                 &lt;max-backups>1&lt;/max-backups>
+                 &lt;request-backup>true&lt;/request-backup>
+                 &lt;master/>
+                 &lt;slave/>
+             &lt;/colocated>
+         &lt;/shared-store>
+     &lt;/ha-policy>
+     </code>
+     </pre>
+     <p>notice that we have used a template to set some sensible defaults but overridden the backup strategy so back ups
+     are full servers</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java b/examples/features/ha/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java
new file mode 100644
index 0000000..3e0d07e
--- /dev/null
+++ b/examples/features/ha/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java
@@ -0,0 +1,147 @@
+/*
+ * 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 org.apache.activemq.artemis.util.ServerUtil;
+
+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;
+import java.util.Hashtable;
+
+/**
+ * A simple example that demonstrates a colocated server
+ */
+public class ColocatedFailoverExample {
+
+   private static Process server0;
+
+   private static Process server1;
+
+   public static void main(final String[] args) throws Exception {
+      final int numMessages = 30;
+
+      Connection connection = null;
+      Connection connection1 = null;
+
+      InitialContext initialContext = null;
+      InitialContext initialContext1 = null;
+
+      try {
+         server0 = ServerUtil.startServer(args[0], ColocatedFailoverExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], ColocatedFailoverExample.class.getSimpleName() + "1", 1, 5000);
+
+         // Step 1. Get an initial context for looking up JNDI for both servers
+         Hashtable<String, Object> properties = new Hashtable<String, Object>();
+         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("queue.queue/exampleQueue", "exampleQueue");
+         initialContext = new InitialContext(properties);
+
+         properties = new Hashtable<String, Object>();
+         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
+         initialContext1 = new InitialContext(properties);
+
+         // Step 2. Look up the JMS resources from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+         ConnectionFactory connectionFactory1 = (ConnectionFactory) initialContext1.lookup("ConnectionFactory");
+
+         // Step 3. Create a JMS Connections
+         connection = connectionFactory.createConnection();
+         connection1 = connectionFactory1.createConnection();
+
+         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 5. Create a JMS MessageProducers
+         MessageProducer producer = session.createProducer(queue);
+         MessageProducer producer1 = session1.createProducer(queue);
+
+         // Step 6. Send some messages to both servers
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session.createTextMessage("This is text message " + i);
+            producer.send(message);
+            System.out.println("Sent message: " + message.getText());
+            message = session1.createTextMessage("This is another text message " + i);
+            producer1.send(message);
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 7. Crash server #0, the live server, and wait a little while to make sure
+         // it has really crashed
+         ServerUtil.killServer(server0);
+         Thread.sleep(10000);
+
+         // Step 8. start the connection ready to receive messages
+         connection.start();
+         connection1.start();
+
+         // Step 9.create a consumer
+         MessageConsumer consumer = session1.createConsumer(queue);
+
+         // Step 10. Receive and acknowledge all of the sent messages, the backup server that is colocated with server 1
+         // will have become live and is now handling messages for server 0.
+         TextMessage message0 = null;
+         for (int i = 0; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            if (message0 == null) {
+               throw new IllegalStateException("Message not received!");
+            }
+            System.out.println("Got message: " + message0.getText());
+         }
+         message0.acknowledge();
+
+         MessageConsumer consumer1 = session.createConsumer(queue);
+
+         // Step 11. Receive and acknowledge the rest of the sent messages from server 1.
+         for (int i = 0; i < numMessages; i++) {
+            message0 = (TextMessage) consumer1.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+         message0.acknowledge();
+      }
+      finally {
+         // Step 11. Be sure to close our resources!
+
+         if (connection != null) {
+            connection.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection1 != null) {
+            connection1.close();
+         }
+
+         if (initialContext1 != null) {
+            initialContext1.close();
+         }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/colocated-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/colocated-failover/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/colocated-failover/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..0a4103f
--- /dev/null
+++ b/examples/features/ha/colocated-failover/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,115 @@
+<?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.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+      <!-- Connectors -->
+
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- a colocated server that will allow shared store full backups to be requested-->
+      <ha-policy>
+         <shared-store>
+            <colocated>
+               <backup-port-offset>100</backup-port-offset>
+               <backup-request-retries>-1</backup-request-retries>
+               <backup-request-retry-interval>2000</backup-request-retry-interval>
+               <max-backups>1</max-backups>
+               <request-backup>true</request-backup>
+               <master>
+                  <failover-on-shutdown>true</failover-on-shutdown>
+               </master>
+               <slave>
+                  <failover-on-shutdown>true</failover-on-shutdown>
+               </slave>
+            </colocated>
+         </shared-store>
+      </ha-policy>
+
+      <!-- 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-settings>
+
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/colocated-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/colocated-failover/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/colocated-failover/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..8083f27
--- /dev/null
+++ b/examples/features/ha/colocated-failover/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,114 @@
+<?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.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- a colocated server that will allow shared store full backups to be requested-->
+      <ha-policy>
+         <shared-store>
+            <colocated>
+               <backup-port-offset>100</backup-port-offset>
+               <backup-request-retries>-1</backup-request-retries>
+               <backup-request-retry-interval>2000</backup-request-retry-interval>
+               <max-backups>1</max-backups>
+               <request-backup>true</request-backup>
+               <master>
+                  <failover-on-shutdown>true</failover-on-shutdown>
+               </master>
+               <slave>
+                  <failover-on-shutdown>true</failover-on-shutdown>
+               </slave>
+            </colocated>
+         </shared-store>
+      </ha-policy>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/ha-policy-autobackup/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/ha-policy-autobackup/pom.xml b/examples/features/ha/ha-policy-autobackup/pom.xml
new file mode 100644
index 0000000..9322e2a
--- /dev/null
+++ b/examples/features/ha/ha-policy-autobackup/pom.xml
@@ -0,0 +1,103 @@
+<?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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>ha-policy-autobackup</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS HA Policy Auto backup example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.HAPolicyAutoBackupExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>ha-policy-autobackup</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java b/examples/features/ha/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java
new file mode 100644
index 0000000..0df8bfd
--- /dev/null
+++ b/examples/features/ha/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java
@@ -0,0 +1,155 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ClusterTopologyListener;
+import org.apache.activemq.artemis.api.core.client.TopologyMember;
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.util.ServerUtil;
+
+/**
+ * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
+ * nodes of the cluster.
+ */
+public class HAPolicyAutoBackupExample {
+
+   private static Process server0;
+
+   private static Process server1;
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection0 = null;
+
+      Connection connection1 = null;
+
+      try {
+         server0 = ServerUtil.startServer(args[0], HAPolicyAutoBackupExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], HAPolicyAutoBackupExample.class.getSimpleName() + "1", 1, 5000);
+
+         // Step 2. Look-up the JMS Queue object from JNDI
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // Step 3. new connection factories towards server 0 and 1
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+
+         // Step 6. We create JMS Connections to server 0 and 1
+         connection0 = cf0.createConnection();
+         connection1 = cf1.createConnection();
+
+         // step 7. wait for the backups to start replication
+         waitForBackups(cf0, 2);
+
+         // Step 8. We create JMS Sessions on server 0 and 1
+         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 9. We start the connections to ensure delivery occurs on them
+         connection0.start();
+         connection1.start();
+
+         // Step 10. We create JMS MessageConsumer objects on server 0 and server 1
+         MessageConsumer consumer0 = session0.createConsumer(queue);
+         MessageConsumer consumer1 = session1.createConsumer(queue);
+
+         // Step 11. We create a JMS MessageProducer object on server 0
+         MessageProducer producer = session0.createProducer(queue);
+
+         // Step 12. We send some messages to server 0
+
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session0.createTextMessage("This is text message " + i);
+
+            producer.send(message);
+
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 13. We now consume half the messages on consumer0
+         // note that the other half of the messages will have been sent to server1 for consumer1
+         for (int i = 0; i < numMessages / 2; i++) {
+            TextMessage message0 = (TextMessage) consumer0.receive(5000);
+
+            System.out.println("Got message: " + message0.getText() + " from node 0");
+         }
+
+         // Step 14.close the consumer so it doesnt get any messages
+         consumer1.close();
+
+         // Step 15.now kill server1, messages will be scaled down to server0
+         ServerUtil.killServer(server1);
+         Thread.sleep(5000);
+
+         // Step 16. we now receive the messages that were on server1 but were scaled down to server0
+         for (int i = 0; i < numMessages / 2; i++) {
+            TextMessage message0 = (TextMessage) consumer0.receive(5000);
+
+            System.out.println("Got message: " + message0.getText() + " from node 1");
+         }
+      }
+      finally {
+         // Step 17. Be sure to close our resources!
+
+         if (connection0 != null) {
+            connection0.close();
+         }
+
+         if (connection1 != null) {
+            connection1.close();
+         }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
+      }
+   }
+
+   private static void waitForBackups(ConnectionFactory cf0, int backups) throws InterruptedException {
+      final CountDownLatch latch = new CountDownLatch(backups);
+      ((ActiveMQConnectionFactory) cf0).getServerLocator().addClusterTopologyListener(new ClusterTopologyListener() {
+         List<TransportConfiguration> backups = new ArrayList<TransportConfiguration>();
+
+         @Override
+         public void nodeUP(TopologyMember member, boolean last) {
+            if (member.getBackup() != null && !backups.contains(member.getBackup())) {
+               backups.add(member.getBackup());
+               latch.countDown();
+            }
+         }
+
+         @Override
+         public void nodeDown(long eventUID, String nodeID) {
+         }
+      });
+      latch.await(30000, TimeUnit.MILLISECONDS);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..db98aa0
--- /dev/null
+++ b/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,108 @@
+<?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.dir}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <!-- Connectors -->
+
+      <connectors>
+         <connector name="invm-connector">vm://0</connector>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+         <!-- connector to the server1 -->
+         <connector name="server1-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="invm-acceptor">vm://0</acceptor>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- HA configuration -->
+      <ha-policy>
+         <replication>
+            <colocated>
+               <max-backups>1</max-backups>
+               <request-backup>true</request-backup>
+               <backup-request-retry-interval>1000</backup-request-retry-interval>
+               <excludes>
+                  <connector-ref>invm-connector</connector-ref>
+                  <connector-ref>server1-connector</connector-ref>
+                  <connector-ref>netty-connector</connector-ref>
+               </excludes>
+               <master/>
+               <slave>
+                  <scale-down>
+                     <connectors>
+                        <connector-ref>invm-connector</connector-ref>
+                     </connectors>
+                  </scale-down>
+               </slave>
+            </colocated>
+         </replication>
+      </ha-policy>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <static-connectors>
+               <connector-ref>server1-connector</connector-ref>
+            </static-connectors>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="#">
+            <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"/>
+            <permission type="manage" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..760ce0d
--- /dev/null
+++ b/examples/features/ha/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,108 @@
+<?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.dir}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="invm-connector">vm://0</connector>
+         <connector name="netty-connector">tcp://localhost:61617</connector>
+         <!-- connector to the server0 -->
+         <connector name="server0-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="invm-acceptor">vm://0</acceptor>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- HA configuration -->
+      <ha-policy>
+         <replication>
+            <colocated>
+               <max-backups>1</max-backups>
+               <request-backup>true</request-backup>
+               <backup-request-retry-interval>1000</backup-request-retry-interval>
+               <excludes>
+                  <connector-ref>invm-connector</connector-ref>
+                  <connector-ref>server0-connector</connector-ref>
+                  <connector-ref>netty-connector</connector-ref>
+               </excludes>
+               <master/>
+               <slave>
+                  <scale-down>
+                     <connectors>
+                        <connector-ref>invm-connector</connector-ref>
+                     </connectors>
+                  </scale-down>
+               </slave>
+            </colocated>
+         </replication>
+      </ha-policy>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <static-connectors>
+               <connector-ref>server0-connector</connector-ref>
+            </static-connectors>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="#">
+            <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"/>
+            <permission type="manage" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/multiple-failover-failback/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/multiple-failover-failback/pom.xml b/examples/features/ha/multiple-failover-failback/pom.xml
new file mode 100644
index 0000000..fd04228
--- /dev/null
+++ b/examples/features/ha/multiple-failover-failback/pom.xml
@@ -0,0 +1,121 @@
+<?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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>multiple-failover-failback</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Multiple Failover Failback Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.geronimo.specs</groupId>
+         <artifactId>geronimo-jms_2.0_spec</artifactId>
+      </dependency>
+   </dependencies>
+
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>false</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>true</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server2</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>true</slave>
+                     <dataFolder>../data</dataFolder>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.MultipleFailoverFailbackExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                        <param>${basedir}/target/server2</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>multiple-failover-failback</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>


[33/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/message-counters/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-counters/readme.html b/examples/broker-features/standard/message-counters/readme.html
deleted file mode 100644
index 40e247a..0000000
--- a/examples/broker-features/standard/message-counters/readme.html
+++ /dev/null
@@ -1,197 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Message Counter 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 Message Counter Example</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
-
-     <p>This example shows you how to use message counters to obtain message information for a JMS queue.</p>
-     <p>The example will show how to configure sampling of message counters.<br />
-         We will produce and consume 1 message from a queue. Interleaved with the JMS operation, we will retrieve the queue's message counters
-         at different times to display the metrics on the queue.
-     </p>
-     <h2>Example setup</h2>
-     <p>Message counter is configured in the server configuration file <a href="server0/broker.xml">broker.xml</a>:</p>
-     <pre class="prettyprint">
-         <code>&lt;message-counter-enabled&gt;true&lt;/message-counter-enabled&gt;
-         &lt;message-counter-sample-period&gt;2000&lt;/message-counter-sample-period&gt;
-         &lt;message-counter-max-day-history&gt;2&lt;/message-counter-max-day-history&gt;</code>
-     </pre>
-     <p>By default, Message counter is not enabled (for performance reason). To enable them, set <code>message-counter-enabled</code> to <code>true</code>.<br />
-     Queues are sampled every 10 seconds by default. For this example we will reduce it to 2 seconds by setting <code>message-counter-sample-period</code> to <code>2000</code>.<br />
-     ActiveMQ Artemis holds in memory the message counters' history for a maximum number of days (10 by default). We can change the number of days the history is kept by setting
-         the <code>message-counter-max-day-history</code> parameter.</p>
-     <p>The sample period and the max day history parameters have a small impact on the performance of ActiveMQ Artemis (the resources taken to sample a queue are not available to the system's
-         normal use). You should set these parameters accordingly to the use and throughput of your messages.</p>
-
-     <h2>Example step-by-step</h2>
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection, session and producer for the queue</li>
-        <pre class="prettyprint">
-           <code> connection = cf.createQueueConnection();
-            QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-            MessageProducer producer = session.createProducer(queue);</code>
-       </pre>
-
-        <li>We create and send a JMS text message</li>
-        <pre class="prettyprint">
-            <code>TextMessage message = session.createTextMessage("This is a text message");
-            producer.send(message);
-            System.out.println("Sent message: " + message.getText());</code>
-        </pre>
-
-        <li>We will now sleep a little bit to be sure the queue is sample. Since we have configure the sample period to be 2 seconds,
-            we will sleep for 3 seconds to be sure that a sample is taken</li>
-        <pre class="prettyprint">
-            <code>System.out.println("Sleep a little bit to have the queue sampled...");
-            Thread.sleep(3000);</code>
-        </pre>
-
-        <p>We now need to retrieve the message counters. They're available from the JMS Queue management resource. In this example, we
-            will retrieve them using JMX (see the <a href="../jmx/readme.html">JMX example</a> for a more complete description). You can also use JMS message to retrieve them (see the <a href="../management/readme.html">Management example</a> to
-            learn about managing ActiveMQ Artemis using JMS messages).</p>
-
-       <li>We retrieve the JMX MBean used to manage the JMS queue</li>
-        <pre class="prettyprint">
-            <code>ObjectName on = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queue.getQueueName());
-            JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap());
-            MBeanServerConnection mbsc = connector.getMBeanServerConnection();
-            JMSQueueControl queueControl = (JMSQueueControl)MBeanServerInvocationHandler.newProxyInstance(mbsc,
-                                                                                              on,
-                                                                                              JMSQueueControl.class,
-                                                                                              false);</code>
-        </pre>
-
-        <li>We retrieve the message counter and display them. MessageCounters are retrieved as <code>JSON Strings</code> for portability reason (whether
-            JMX is used for management or JMS messages). To make it simpler to use them in the code, there is a <code>MessageCounterInfo</code> data structure.</li>
-        <pre class="prettyprint">
-            <code>String counters = queueControl.listMessageCounter();
-            MessageCounterInfo messageCounter = MessageCounterInfo.fromJSON(counters);</code>>
-        </pre>
-
-        <li>We display the message counters</li>
-        <pre class="prettyprint">
-            <code>displayMessageCounter(messageCounter);</code>
-        </pre>
-
-        <p>The message counter contains a variety of metrics on the queue which is sampled (total messages added to the queue, current depth of the queue, deltas since the last sample, timestamp
-            of the last message added, timestamp of the last sample, etc.)</p>
-        <pre class="prettyprint">
-            <code>
-            private void displayMessageCounter(MessageCounterInfo counter)
-            {
-               System.out.format("%s (sample updated at %s)\n",  counter.getName(), counter.getUdpateTimestamp());
-               System.out.format("   %s message(s) added to the queue (since last sample: %s)\n", counter.getCount(),
-                                                                                                  counter.getCountDelta());
-               System.out.format("   %s message(s) in the queue (since last sample: %s)\n", counter.getDepth(),
-                                                                                            counter.getDepthDelta());
-               System.out.format("   last message added at %s\n\n", counter.getLastAddTimestamp());
-            }</code>
-        </pre>
-
-        <li>We sleep again to have the queue sampled</li>
-        <pre class="prettyprint">
-            <code>System.out.println("Sleep a little bit again...");
-            Thread.sleep(3000);</code>
-        </pre>
-
-        <li>We list the message counters again</li>
-        <pre class="prettyprint">
-            <code>counters = queueControl.listMessageCounter();
-            messageCounter = MessageCounterInfo.fromJSON(counters);
-            displayMessageCounter(messageCounter);</code>
-        </pre>
-
-        <p>We will now consume a message from the queue before listing a last time the message counters</p>
-
-        <li>We create a consumer for the queue</li>
-        <pre class="prettyprint">
-            <code>MessageConsumer consumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We start the connection to receive messages on the consumer</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We receive a message from the queue</li>
-        <pre class="prettyprint">
-           <code>TextMessage messageReceived = (TextMessage)consumer.receive(5000);
-           System.out.format("Received message: %s\n\n", messageReceived.getText());</code>
-        </pre>
-
-        <li>We sleep one last time to have the queue sampled</li>
-        <pre class="prettyprint">
-            <code>System.out.println("Sleep a little bit one last time...");
-            Thread.sleep(3000);</code>
-        </pre>
-
-        <li>We list the message counters a final time (this time with no message in the queue)</li>
-        <pre class="prettyprint">
-            <code>counters = queueControl.listMessageCounter();
-            messageCounter = MessageCounterInfo.fromJSON(counters);
-            displayMessageCounter(messageCounter);</code>
-        </pre>
-
-        </p>
-        <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>
-
-     <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.message-counters">Message Counters chapter</a></li>
-     <li><a href="../../../docs/api/org/jboss/messaging/core/management/MessageCounterInfo.html">MessageCounterInfo</a> is a helper class used
-        to create a MessageCounterInfo object from the JSON String which represents message counters</li>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java b/examples/broker-features/standard/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java
deleted file mode 100644
index 8e6cc26..0000000
--- a/examples/broker-features/standard/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java
+++ /dev/null
@@ -1,134 +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.HashMap;
-
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.management.MBeanServerConnection;
-import javax.management.MBeanServerInvocationHandler;
-import javax.management.ObjectName;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-import javax.naming.InitialContext;
-
-import org.apache.activemq.artemis.api.core.management.MessageCounterInfo;
-import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
-import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
-
-/**
- * An example showing how to use message counters to have information on a queue.
- */
-public class MessageCounterExample {
-
-   private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3001/jmxrmi";
-
-   public static void main(final String[] args) throws Exception {
-      QueueConnection 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
-         QueueConnectionFactory cf = (QueueConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 4.Create a JMS Connection, session and a producer for the queue
-         connection = cf.createQueueConnection();
-         QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageProducer producer = session.createProducer(queue);
-
-         // Step 5. Create and send a Text Message
-         TextMessage message = session.createTextMessage("This is a text message");
-         producer.send(message);
-         System.out.println("Sent message: " + message.getText());
-
-         // Step 6. Sleep a little bit so that the queue is sampled
-         System.out.println("Sleep a little bit to have the queue sampled...");
-         Thread.sleep(3000);
-
-         // Step 7. Use JMX to retrieve the message counters using the JMSQueueControl
-         ObjectName on = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queue.getQueueName());
-         JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, Object>());
-         MBeanServerConnection mbsc = connector.getMBeanServerConnection();
-         JMSQueueControl queueControl = MBeanServerInvocationHandler.newProxyInstance(mbsc, on, JMSQueueControl.class, false);
-
-         // Step 8. List the message counters and convert them to MessageCounterInfo data structure.
-         String counters = queueControl.listMessageCounter();
-         MessageCounterInfo messageCounter = MessageCounterInfo.fromJSON(counters);
-
-         // Step 9. Display the message counter
-         displayMessageCounter(messageCounter);
-
-         // Step 10. Sleep again to have the queue sampled again
-         System.out.println("Sleep a little bit again...");
-         Thread.sleep(3000);
-
-         // Step 11. List the messages counters again
-         counters = queueControl.listMessageCounter();
-         messageCounter = MessageCounterInfo.fromJSON(counters);
-         displayMessageCounter(messageCounter);
-
-         // Step 12. Create a JMS consumer on the queue
-         MessageConsumer consumer = session.createConsumer(queue);
-
-         // Step 13. Start the connection to receive messages on the consumer
-         connection.start();
-
-         // Step 14. Receive a JMS message from the queue. It corresponds to the message sent at step #5
-         TextMessage messageReceived = (TextMessage) consumer.receive(5000);
-         System.out.format("Received message: %s%n%n", messageReceived.getText());
-
-         // Step 15. Sleep on last time to have the queue sampled
-         System.out.println("Sleep a little bit one last time...");
-         Thread.sleep(3000);
-
-         // Step 16. Display one last time the message counter
-         counters = queueControl.listMessageCounter();
-         messageCounter = MessageCounterInfo.fromJSON(counters);
-         displayMessageCounter(messageCounter);
-      }
-      finally {
-         // Step 17. Be sure to close our JMS resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-
-   private static void displayMessageCounter(final MessageCounterInfo counter) {
-      System.out.format("%s (sample updated at %s)%n", counter.getName(), counter.getUdpateTimestamp());
-      System.out.format("   %s message(s) added to the queue (since last sample: %s)%n", counter.getCount(), counter.getCountDelta());
-      System.out.format("   %s message(s) in the queue (since last sample: %s)%n", counter.getDepth(), counter.getDepthDelta());
-      System.out.format("   last message added at %s%n%n", counter.getLastAddTimestamp());
-   }
-
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/message-counters/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-counters/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/message-counters/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 8d4ed29..0000000
--- a/examples/broker-features/standard/message-counters/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-<?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 ../../../../src/schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-
-      <!--the expiry queue where expired messages will be sent-->
-      <queue name="expiryQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-
-      <jmx-management-enabled>true</jmx-management-enabled>
-      <message-counter-enabled>true</message-counter-enabled>
-      <message-counter-sample-period>2000</message-counter-sample-period>
-      <message-counter-max-day-history>2</message-counter-max-day-history>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</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 for dead letter queue-->
-         <security-setting match="jms.queue.expiryQueue">
-            <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-settings>
-
-      <address-settings>
-         <!--override the expiry address for the example-->
-         <address-setting match="jms.queue.exampleQueue">
-            <expiry-address>jms.queue.expiryQueue</expiry-address>
-         </address-setting>
-      </address-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/message-counters/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-counters/src/main/resources/jndi.properties b/examples/broker-features/standard/message-counters/src/main/resources/jndi.properties
deleted file mode 100644
index 231fa30..0000000
--- a/examples/broker-features/standard/message-counters/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,21 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-queue.queue/exampleQueue=exampleQueue
-queue.queue/expiryQueue=expiryQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/message-group/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-group/pom.xml b/examples/broker-features/standard/message-group/pom.xml
deleted file mode 100644
index 1c97866..0000000
--- a/examples/broker-features/standard/message-group/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>message-group</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Message Group 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>
-                     <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.MessageGroupExample</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>message-group</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/message-group/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-group/readme.html b/examples/broker-features/standard/message-group/readme.html
deleted file mode 100644
index 56d2afe..0000000
--- a/examples/broker-features/standard/message-group/readme.html
+++ /dev/null
@@ -1,152 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Message Group 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>Message Group 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 configure and use message groups with ActiveMQ Artemis.</p>
-
-     <p>Message groups are sets of messages that has the following characteristics: </p>
-     <li>Messages in a message group share the same group id, i.e. they have same JMSXGroupID string property values.</li>
-     <li>Messages in a message group will be all delivered to no more than one of the queue's consumers. The consumer that receives the
-     first message of a group will receive all the messages that belong to the group.</li>
-
-     <p>You can make any message belong to a message group by setting its 'JMXGroupID' string property to the group id.
-     In this example we create a message group 'Group-0'. And make such a message group of 10 messages. It also create two consumers on the queue
-     where the 10 'Group-0' group messages are to be sent. You can see that with message grouping enabled, all the 10 messages will be received by
-     the first consumer. The second consumer will receive none. </p>
-
-     <p>Alternatively, ActiveMQ's connection factories can be configured to <em>auto group</em> messages. By setting <code>autogroup</code> to </code>true</code> on the <code>ActiveMQConnectionFactory</code>
-        (or setting <code>&lt;autogroup&gt;true&lt;/autogroup&gt;</code> in <code>activemq-jms.xml</code>'s connection factory settings), a random unique id
-        will be picked to create a message group. <em>Every messages</em> sent by a producer created from this connection factory will automatically
-        be part of this message group.</p>
-
-     <h2>Example step-by-step</h2>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create two consumers.</li>
-        <pre class="prettyprint">
-           <code>
-          MessageConsumer consumer1 = session.createConsumer(queue);
-          consumer1.setMessageListener(new SimpleMessageListener("consumer-1"));
-          MessageConsumer consumer2 = session.createConsumer(queue);
-          consumer2.setMessageListener(new SimpleMessageListener("consumer-2"));
-          </code>
-        </pre>
-
-        <li>We create and send 10 text messages with group id 'Group-0'</li>
-        <pre class="prettyprint">
-           <code>
-         int msgCount = 10;
-         TextMessage[] groupMessages = new TextMessage[msgCount];
-         for (int i = 0; i &lt; msgCount; i++)
-         {
-            groupMessages[i] = session.createTextMessage("Group-0 message " + i);
-            groupMessages[i].setStringProperty("JMSXGroupID", "Group-0");
-            producer.send(groupMessages[i]);
-            System.out.println("Sent message: " + groupMessages[i].getText());
-         }
-           </code>
-        </pre>
-
-        <li>We start the connection.</li>
-          <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We check the group messages are received by only one consumer</li>
-        <pre class="prettyprint">
-           <code>
-         String trueReceiver = messageReceiverMap.get(groupMessages[0].getText());
-         for (TextMessage grpMsg : groupMessages)
-         {
-            String receiver = messageReceiverMap.get(grpMsg.getText());
-            if (!trueReceiver.equals(receiver))
-            {
-               System.out.println("Group message [" + grpMsg.getText() + "[ went to wrong receiver: " + receiver);
-               result = false;
-            }
-         }
-           </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>
-
-     <h2>More information</h2>
-
-     <ul>
-         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#message-grouping">Message Grouping chapter</a></li>
-     </ul>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/message-group/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroupExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-group/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroupExample.java b/examples/broker-features/standard/message-group/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroupExample.java
deleted file mode 100644
index c614860..0000000
--- a/examples/broker-features/standard/message-group/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroupExample.java
+++ /dev/null
@@ -1,122 +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.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 java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * A simple JMS Queue example that sends and receives message groups.
- */
-public class MessageGroupExample {
-
-   public static void main(final String[] args) throws Exception {
-      final Map<String, String> messageReceiverMap = new ConcurrentHashMap<String, String>();
-      Connection connection = null;
-      try {
-
-         // Step 2. Perform a lookup on the queue
-         Queue queue = ActiveMQJMSClient.createQueue("queue/exampleQueue");
-
-         // Step 3. Perform a lookup on the Connection Factory
-         ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
-
-         // 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 two consumers
-         MessageConsumer consumer1 = session.createConsumer(queue);
-         consumer1.setMessageListener(new SimpleMessageListener("consumer-1", messageReceiverMap));
-         MessageConsumer consumer2 = session.createConsumer(queue);
-         consumer2.setMessageListener(new SimpleMessageListener("consumer-2", messageReceiverMap));
-
-         // Step 8. Create and send 10 text messages with group id 'Group-0'
-         int msgCount = 10;
-         TextMessage[] groupMessages = new TextMessage[msgCount];
-         for (int i = 0; i < msgCount; i++) {
-            groupMessages[i] = session.createTextMessage("Group-0 message " + i);
-            groupMessages[i].setStringProperty("JMSXGroupID", "Group-0");
-            producer.send(groupMessages[i]);
-            System.out.println("Sent message: " + groupMessages[i].getText());
-         }
-
-         System.out.println("all messages are sent");
-
-         // Step 9. Start the connection
-         connection.start();
-
-         Thread.sleep(2000);
-
-         // Step 10. check the group messages are received by only one consumer
-         String trueReceiver = messageReceiverMap.get(groupMessages[0].getText());
-         for (TextMessage grpMsg : groupMessages) {
-            String receiver = messageReceiverMap.get(grpMsg.getText());
-            if (!trueReceiver.equals(receiver)) {
-               throw new IllegalStateException("Group message [" + grpMsg.getText() + "[ went to wrong receiver: " + receiver);
-            }
-         }
-
-         cf.close();
-      }
-      finally {
-         // Step 11. Be sure to close our JMS resources!
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}
-
-class SimpleMessageListener implements MessageListener {
-
-   private final String name;
-   private final Map<String, String> messageReceiverMap;
-
-   public SimpleMessageListener(final String listenerName, Map<String, String> messageReceiverMap) {
-      name = listenerName;
-      this.messageReceiverMap = messageReceiverMap;
-   }
-
-   public void onMessage(final Message message) {
-      try {
-         TextMessage msg = (TextMessage) message;
-         System.out.format("Message: [%s] received by %s%n", msg.getText(), name);
-         messageReceiverMap.put(msg.getText(), name);
-      }
-      catch (JMSException e) {
-         e.printStackTrace();
-      }
-   }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/message-group/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-group/src/main/resources/jndi.properties b/examples/broker-features/standard/message-group/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/message-group/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/message-group2/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-group2/pom.xml b/examples/broker-features/standard/message-group2/pom.xml
deleted file mode 100644
index 1a0363d..0000000
--- a/examples/broker-features/standard/message-group2/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>message-group2</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Message Group Example 2</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>
-                     <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.MessageGroup2Example</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>message-group2</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/message-group2/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-group2/readme.html b/examples/broker-features/standard/message-group2/readme.html
deleted file mode 100644
index 983a442..0000000
--- a/examples/broker-features/standard/message-group2/readme.html
+++ /dev/null
@@ -1,161 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Message Group 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>Message Group 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 configure and use message groups via a connection factory with ActiveMQ Artemis.</p>
-
-     <p>Message groups are sets of messages that has the following characteristics: </p>
-     <li>Messages in a message group share the same group id, i.e. they have same JMSXGroupID string property values.</li>
-     <li>Messages in a message group will be all delivered to no more than one of the queue's consumers. The consumer that receives the
-     first message of a group will receive all the messages that belongs to the group.</li>
-
-     <p>You can make any message belong to a message group by setting a 'group-id' on the connection factory. All producers created via this connection factory will set that group id on its messages.
-     In this example we set the group id 'Group-0'on a connection factory and send messages via 2 different producers and check that only 1 consumer receives them. </p>
-
-     <p>Alternatively, ActiveMQ's connection factories can be configured to <em>auto group</em> messages. By setting <code>autogroup</code> to </code>true</code> on the <code>ActiveMQConnectionFactory</code>
-        (or setting <code>&lt;autogroup&gt;true&lt;/autogroup&gt;</code> in <code>activemq-jms.xml</code>'s connection factory settings), a random unique id
-        will be picked to create a message group. <em>Every messages</em> sent by a producer created from this connection factory will automatically
-        be part of this message group.</p>
-
-     <h2>Example step-by-step</h2>
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create 2 JMS message producers on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>
-              MessageProducer producer1 = session.createProducer(queue);
-
-              MessageProducer producer2 = session.createProducer(queue);</code>
-       </pre>
-
-        <li>We create two consumers.</li>
-        <pre class="prettyprint">
-           <code>
-          MessageConsumer consumer1 = session.createConsumer(queue);
-          consumer1.setMessageListener(new SimpleMessageListener("consumer-1"));
-          MessageConsumer consumer2 = session.createConsumer(queue);
-          consumer2.setMessageListener(new SimpleMessageListener("consumer-2"));
-          </code>
-        </pre>
-
-        <li>We create and send 10 text messages using each producer</li>
-        <pre class="prettyprint">
-           <code>
-         int msgCount = 10;
-         for (int i = 0; i < msgCount; i++)
-         {
-            TextMessage m = session.createTextMessage("producer1 message " + i);
-            producer1.send(m);
-            System.out.println("Sent message: " + m.getText());
-            TextMessage m2 = session.createTextMessage("producer2 message " + i);
-            producer2.send(m2);
-            System.out.println("Sent message: " + m2.getText());
-         }
-           </code>
-        </pre>
-
-        <li>We start the connection.</li>
-          <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We check the group messages are received by only one consumer</li>
-        <pre class="prettyprint">
-           <code>
-            String trueReceiver = messageReceiverMap.get("producer1 message " + 0);
-            for (int i = 0; i < msgCount; i++)
-            {
-               String receiver = messageReceiverMap.get("producer1 message " + i);
-               if (!trueReceiver.equals(receiver))
-               {
-                  System.out.println("Group message [producer1 message " + i + "] went to wrong receiver: " + receiver);
-                  result = false;
-               }
-               receiver = messageReceiverMap.get("producer2 message " + i);
-               if (!trueReceiver.equals(receiver))
-               {
-                  System.out.println("Group message [producer2 message " + i + "] went to wrong receiver: " + receiver);
-                  result = false;
-               }
-            }
-
-           </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>
-
-     <h2>More information</h2>
-
-     <ul>
-         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#message-grouping2">Message Grouping chapter</a></li>
-     </ul>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/message-group2/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroup2Example.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-group2/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroup2Example.java b/examples/broker-features/standard/message-group2/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroup2Example.java
deleted file mode 100644
index a2164cf..0000000
--- a/examples/broker-features/standard/message-group2/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroup2Example.java
+++ /dev/null
@@ -1,129 +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.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 java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * A simple JMS Queue example that sends and receives message groups.
- */
-public class MessageGroup2Example {
-
-   private boolean result = true;
-
-   public static void main(String[] args) throws Exception {
-      final Map<String, String> messageReceiverMap = new ConcurrentHashMap<String, String>();
-      Connection connection = null;
-      try {
-         //Step 2. Perform a lookup on the queue
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         //Step 3. Perform a lookup on the Connection Factory
-         ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?groupID=Group-0");
-
-         //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 2 JMS Message Producers
-         MessageProducer producer1 = session.createProducer(queue);
-
-         MessageProducer producer2 = session.createProducer(queue);
-
-         //Step 7. Create two consumers
-         MessageConsumer consumer1 = session.createConsumer(queue);
-         consumer1.setMessageListener(new SimpleMessageListener("consumer-1", messageReceiverMap));
-         MessageConsumer consumer2 = session.createConsumer(queue);
-         consumer2.setMessageListener(new SimpleMessageListener("consumer-2", messageReceiverMap));
-
-         //Step 8. Create and send 10 text messages with each producer
-         int msgCount = 10;
-         for (int i = 0; i < msgCount; i++) {
-            TextMessage m = session.createTextMessage("producer1 message " + i);
-            producer1.send(m);
-            System.out.println("Sent message: " + m.getText());
-            TextMessage m2 = session.createTextMessage("producer2 message " + i);
-            producer2.send(m2);
-            System.out.println("Sent message: " + m2.getText());
-         }
-
-         System.out.println("all messages are sent");
-
-         //Step 9. Start the connection
-         connection.start();
-
-         Thread.sleep(2000);
-
-         //Step 10. check the group messages are received by only one consumer
-
-         String trueReceiver = messageReceiverMap.get("producer1 message " + 0);
-         for (int i = 0; i < msgCount; i++) {
-            String receiver = messageReceiverMap.get("producer1 message " + i);
-            if (!trueReceiver.equals(receiver)) {
-               throw new IllegalStateException("Group message [producer1 message " + i + "] went to wrong receiver: " + receiver);
-            }
-            receiver = messageReceiverMap.get("producer2 message " + i);
-            if (!trueReceiver.equals(receiver)) {
-               throw new IllegalStateException("Group message [producer2 message " + i + "] went to wrong receiver: " + receiver);
-            }
-         }
-      }
-      finally {
-         //Step 11. Be sure to close our JMS resources!
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}
-
-class SimpleMessageListener implements MessageListener {
-
-   private final String name;
-   final Map<String, String> messageReceiverMap;
-
-   public SimpleMessageListener(String listenerName, Map<String, String> messageReceiverMap) {
-      name = listenerName;
-      this.messageReceiverMap = messageReceiverMap;
-   }
-
-   public void onMessage(Message message) {
-      try {
-         TextMessage msg = (TextMessage) message;
-         System.out.format("Message: [%s] received by %s%n", msg.getText(), name);
-         messageReceiverMap.put(msg.getText(), name);
-      }
-      catch (JMSException e) {
-         e.printStackTrace();
-      }
-   }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/message-priority/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-priority/pom.xml b/examples/broker-features/standard/message-priority/pom.xml
deleted file mode 100644
index b60aadc..0000000
--- a/examples/broker-features/standard/message-priority/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>message-priority</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS MessagePriorityExample 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>
-                     <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.MessagePriorityExample</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>message-priority</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/message-priority/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-priority/readme.html b/examples/broker-features/standard/message-priority/readme.html
deleted file mode 100644
index fc25297..0000000
--- a/examples/broker-features/standard/message-priority/readme.html
+++ /dev/null
@@ -1,159 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Message Priority 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 Message Priority 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 how messages with different priorities are delivered in different orders.</p>
-
-     <p>The Message Priority property carries the delivery preference of sent messages. It can be set by the message's
-     standard header field 'JMSPriority' as defined in JMS specification version 1.1. The value is of type
-     integer, ranging from 0 (the lowest) to 9 (the highest). When messages are being delivered, their priorities
-     will effect their order of delivery. Messages of higher priorities will likely be delivered before those
-     of lower priorities. Messages of equal priorities are delivered in the natural order of their arrival at
-     their destinations. Please consult the JMS 1.1 specification for full details.</p>
-
-     <p>In this example, three messages are sent to a queue with different priorities. The first message is sent
-     with default priority (4), the second is sent with a higher priority (5), and the third has the highest
-     priority (9). At the receiving end, we will show the order of receiving of the three messages. You will
-     see that the third message, though last sent, will 'jump' forward to be the first one received. The second
-     is also received ahead of the message first sent, but behind the third message. The first message, regardless
-     of its being sent first, arrives last.</p>
-
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We Create a JMS Message Consumer.</li>
-        <pre class="prettyprint">
-           <code>
-           MessageConsumer redConsumer = session.createConsumer(queue);
-           redConsumer.setMessageListener(new SimpleMessageListener());
-           </code>
-        </pre>
-
-        <li>We Create three messages.</li>
-        <pre class="prettyprint">
-           <code>
-           TextMessage[] sentMessages = new TextMessage[3];
-           sentMessages[0] = session.createTextMessage("first message");
-           sentMessages[1] = session.createTextMessage("second message");
-           sentMessages[2] = session.createTextMessage("third message");
-           </code>
-        </pre>
-
-        <li>Send the Messages, each has a different priority.</li>
-        <pre class="prettyprint">
-           <code>
-           producer.send(sentMessages[0]);
-           System.out.println("Message sent: " + sentMessages[0].getText() + " with priority: " + sentMessages[0].getJMSPriority());
-           producer.send(sentMessages[1], DeliveryMode.NON_PERSISTENT, 5, 0);
-           System.out.println("Message sent: " + sentMessages[1].getText() + "with priority: " + sentMessages[1].getJMSPriority());
-           producer.send(sentMessages[2], DeliveryMode.NON_PERSISTENT, 9, 0);
-           System.out.println("Message sent: " + sentMessages[2].getText() + "with priority: " + sentMessages[2].getJMSPriority());
-           </code>
-        </pre>
-
-        <li>We start the connection now.</li>
-        <pre class="prettyprint">
-           <code>
-           connection.start();
-           </code>
-        </pre>
-
-        <li>We wait for message delivery completion</li>
-        <pre class="prettyprint">
-           <code>
-           Thread.sleep(5000);
-           </code>
-        </pre>
-
-        <li>We wait for message delivery completion</li>
-        <pre class="prettyprint">
-           <code>
-           for (int i = 0; i < 3; i++)
-           {
-              TextMessage rm = msgReceived.get(i);
-              if (!rm.getText().equals(sentMessages[2-i].getText()))
-              {
-                 System.err.println("Priority is broken!");
-                 result = false;
-              }
-           }
-           </code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/message-priority/src/main/java/org/apache/activemq/artemis/jms/example/MessagePriorityExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/message-priority/src/main/java/org/apache/activemq/artemis/jms/example/MessagePriorityExample.java b/examples/broker-features/standard/message-priority/src/main/java/org/apache/activemq/artemis/jms/example/MessagePriorityExample.java
deleted file mode 100644
index 2c87d26..0000000
--- a/examples/broker-features/standard/message-priority/src/main/java/org/apache/activemq/artemis/jms/example/MessagePriorityExample.java
+++ /dev/null
@@ -1,134 +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.ArrayList;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-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 org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * A simple JMS example that shows the delivery order of messages with priorities.
- */
-public class MessagePriorityExample {
-
-   public static void main(final String[] args) throws Exception {
-      AtomicBoolean result = new AtomicBoolean(true);
-      final ArrayList<TextMessage> msgReceived = new ArrayList<TextMessage>();
-      Connection connection = null;
-      try {
-
-         // Step 2. look-up the JMS queue object from JNDI
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         // Step 3. look-up the JMS connection factory object from JNDI
-         ConnectionFactory cf = new ActiveMQConnectionFactory();
-
-         // 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 JMS Message Consumer
-         MessageConsumer redConsumer = session.createConsumer(queue);
-         redConsumer.setMessageListener(new SimpleMessageListener(msgReceived, result));
-
-         // Step 8. Create three messages
-         TextMessage[] sentMessages = new TextMessage[3];
-         sentMessages[0] = session.createTextMessage("first message");
-         sentMessages[1] = session.createTextMessage("second message");
-         sentMessages[2] = session.createTextMessage("third message");
-
-         // Step 9. Send the Messages, each has a different priority
-         producer.send(sentMessages[0]);
-         System.out.println("Message sent: " + sentMessages[0].getText() +
-                               " with priority: " +
-                               sentMessages[0].getJMSPriority());
-         producer.send(sentMessages[1], DeliveryMode.NON_PERSISTENT, 5, 0);
-         System.out.println("Message sent: " + sentMessages[1].getText() +
-                               "with priority: " +
-                               sentMessages[1].getJMSPriority());
-         producer.send(sentMessages[2], DeliveryMode.NON_PERSISTENT, 9, 0);
-         System.out.println("Message sent: " + sentMessages[2].getText() +
-                               "with priority: " +
-                               sentMessages[2].getJMSPriority());
-
-         // Step 10. Start the connection now.
-         connection.start();
-
-         // Step 11. Wait for message delivery completion
-         Thread.sleep(5000);
-
-         // Step 12. Examine the order
-         for (int i = 0; i < 3; i++) {
-            TextMessage rm = msgReceived.get(i);
-            if (!rm.getText().equals(sentMessages[2 - i].getText())) {
-               throw new IllegalStateException("Priority is broken!");
-            }
-         }
-
-         if (!result.get())
-            throw new IllegalStateException();
-      }
-      finally {
-         // Step 13. Be sure to close our JMS resources!
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}
-
-class SimpleMessageListener implements MessageListener {
-
-   ArrayList<TextMessage> msgReceived;
-   AtomicBoolean result;
-
-   public SimpleMessageListener(ArrayList<TextMessage> msgReceived, AtomicBoolean result) {
-      this.msgReceived = msgReceived;
-      this.result = result;
-   }
-
-   public void onMessage(final Message msg) {
-      TextMessage textMessage = (TextMessage) msg;
-      try {
-         System.out.println("Received message : [" + textMessage.getText() + "]");
-      }
-      catch (JMSException e) {
-         result.set(false);
-      }
-      msgReceived.add(textMessage);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/no-consumer-buffering/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/no-consumer-buffering/pom.xml b/examples/broker-features/standard/no-consumer-buffering/pom.xml
deleted file mode 100644
index 838980c..0000000
--- a/examples/broker-features/standard/no-consumer-buffering/pom.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?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>no-consumer-buffering</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS No Consumer Buffering 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>
-                     <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.NoConsumerBufferingExample</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>no-consumer-buffering</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-</project>


[45/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml b/examples/broker-features/clustered/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml
deleted file mode 100644
index b1043f5..0000000
--- a/examples/broker-features/clustered/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml
+++ /dev/null
@@ -1,74 +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.
-  -->
-
-<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:61618</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>2</max-hops>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-topic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-topic/pom.xml b/examples/broker-features/clustered/clustered-topic/pom.xml
deleted file mode 100644
index bff7c70..0000000
--- a/examples/broker-features/clustered/clustered-topic/pom.xml
+++ /dev/null
@@ -1,153 +0,0 @@
-<?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.clustered</groupId>
-      <artifactId>broker-clustered</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>clustered-topic</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Clustered Topic 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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server0</location>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server1</location>
-                     <testURI>tcp://localhost:61617</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server1</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.ClusteredTopicExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server1</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.clustered</groupId>
-                  <artifactId>clustered-topic</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-topic/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-topic/readme.html b/examples/broker-features/clustered/clustered-topic/readme.html
deleted file mode 100644
index e46fca8..0000000
--- a/examples/broker-features/clustered/clustered-topic/readme.html
+++ /dev/null
@@ -1,55 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Clustered Topic 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 Clustered Topic 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 a JMS Topic deployed on two different nodes. The two nodes are configured to form a cluster.</p>
-     <p>We then create a subscriber on the topic on each node, and we create a producer on only one of the nodes.</p>
-     <p>We then send some messages via the producer, and we verify that <b>both</b> subscribers receive all the
-     sent messages.</p>
-     <p>A JMS Topic is an example of <b>publish-subscribe</b> messaging where all subscribers receive all the
-     messages sent to the topic (assuming they have no message selectors).</p>
-     <p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
-     JNDI, these could be instantiated directly.
-     <p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster between the two nodes
-     and to load balance the messages between the nodes.</p>
-     <pre class="prettyprint">
-     <code>&lt;cluster-connection name="my-cluster"&gt;
-        &lt;address&gt;jms&lt;/address&gt;
-        &lt;retry-interval&gt;500&lt;/retry-interval&gt;
-        &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
-        &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
-        &lt;max-hops&gt;1&lt;/max-hops&gt;
-        &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
-     &lt;/cluster-connection&gt;
-     </code>
-     </pre>
-     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
-     section of the user manual.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java b/examples/broker-features/clustered/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java
deleted file mode 100644
index f3ce9a0..0000000
--- a/examples/broker-features/clustered/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java
+++ /dev/null
@@ -1,129 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.naming.InitialContext;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * A simple example that shows a JMS Topic clustered across two nodes of a cluster.
- * Messages are sent on one node and received by consumers on both nodes.
- */
-public class ClusteredTopicExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection connection0 = null;
-
-      Connection connection1 = null;
-
-      InitialContext ic0 = null;
-
-      InitialContext ic1 = null;
-
-      try {
-
-         // Step 1. Instantiate topic
-         Topic topic = ActiveMQJMSClient.createTopic("exampleTopic");
-
-         // Step 2. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
-
-         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 1
-         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
-
-         // Step 4. We create a JMS Connection connection0 which is a connection to server 0
-         connection0 = cf0.createConnection();
-
-         // Step 5. We create a JMS Connection connection1 which is a connection to server 1
-         connection1 = cf1.createConnection();
-
-         // Step 6. We create a JMS Session on server 0
-         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 7. We create a JMS Session on server 1
-         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 8. We start the connections to ensure delivery occurs on them
-         connection0.start();
-
-         connection1.start();
-
-         // Step 9. We create JMS MessageConsumer objects on server 0 and server 1
-         MessageConsumer consumer0 = session0.createConsumer(topic);
-
-         MessageConsumer consumer1 = session1.createConsumer(topic);
-
-         Thread.sleep(1000);
-
-         // Step 10. We create a JMS MessageProducer object on server 0
-         MessageProducer producer = session0.createProducer(topic);
-
-         // Step 11. We send some messages to server 0
-
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session0.createTextMessage("This is text message " + i);
-
-            producer.send(message);
-
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 12. We now consume those messages on *both* server 0 and server 1.
-         // We note that all messages have been consumed by *both* consumers.
-         // JMS Topics implement *publish-subscribe* messaging where all consumers get a copy of all messages
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message0 = (TextMessage) consumer0.receive(5000);
-
-            System.out.println("Got message: " + message0.getText() + " from node 0");
-
-            TextMessage message1 = (TextMessage) consumer1.receive(5000);
-
-            System.out.println("Got message: " + message1.getText() + " from node 1");
-         }
-      }
-      finally {
-         // Step 15. Be sure to close our JMS resources!
-         if (connection0 != null) {
-            connection0.close();
-         }
-
-         if (connection1 != null) {
-            connection1.close();
-         }
-
-         if (ic0 != null) {
-            ic0.close();
-         }
-
-         if (ic1 != null) {
-            ic1.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-topic/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-topic/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/clustered/clustered-topic/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index a4e8dde..0000000
--- a/examples/broker-features/clustered/clustered-topic/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?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 topic used by the example-->
-      <topic name="exampleTopic"/>
-   </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>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!--  other configuration -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.topic.exampleTopic">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/clustered-topic/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/clustered-topic/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/clustered/clustered-topic/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 78beec3..0000000
--- a/examples/broker-features/clustered/clustered-topic/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?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 topic used by the example-->
-      <topic name="exampleTopic"/>
-   </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:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!--  other configuration -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.topic.exampleTopic">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/pom.xml b/examples/broker-features/clustered/pom.xml
deleted file mode 100644
index 49b12e2..0000000
--- a/examples/broker-features/clustered/pom.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?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.clustered</groupId>
-      <artifactId>broker-features</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <groupId>org.apache.activemq.examples.clustered</groupId>
-   <artifactId>broker-clustered</artifactId>
-   <packaging>pom</packaging>
-   <name>ActiveMQ Artemis Clustered Examples</name>
-
-   <!-- Properties -->
-   <properties>
-      <!--
-      Explicitly declaring the source encoding eliminates the following
-      message: [WARNING] Using platform encoding (UTF-8 actually) to copy
-      filtered resources, i.e. build is platform dependent!
-      -->
-      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-      <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
-   </properties>
-
-   <profiles>
-      <profile>
-         <id>examples</id>
-         <modules>
-            <module>client-side-load-balancing</module>
-            <module>clustered-durable-subscription</module>
-            <module>clustered-grouping</module>
-            <module>clustered-jgroups</module>
-            <module>clustered-queue</module>
-            <module>clustered-static-oneway</module>
-            <module>clustered-static-discovery</module>
-            <module>clustered-topic</module>
-            <module>queue-message-redistribution</module>
-            <module>symmetric-cluster</module>
-         </modules>
-      </profile>
-      <profile>
-         <id>release</id>
-         <modules>
-            <module>clustered-durable-subscription</module>
-            <module>clustered-grouping</module>
-            <module>clustered-jgroups</module>
-            <module>clustered-queue</module>
-            <module>clustered-static-oneway</module>
-            <module>clustered-static-discovery</module>
-            <module>clustered-topic</module>
-            <module>queue-message-redistribution</module>
-            <module>symmetric-cluster</module>
-         </modules>
-      </profile>
-   </profiles>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/queue-message-redistribution/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/queue-message-redistribution/pom.xml b/examples/broker-features/clustered/queue-message-redistribution/pom.xml
deleted file mode 100644
index 4816ad0..0000000
--- a/examples/broker-features/clustered/queue-message-redistribution/pom.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-<?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.clustered</groupId>
-      <artifactId>broker-clustered</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>queue-message-redistribution</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Queue Message Redistribution 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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server0</location>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server1</location>
-                     <testURI>tcp://localhost:61617</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server1</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.QueueMessageRedistributionExample
-                     </clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server1</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.clustered</groupId>
-                  <artifactId>queue-message-redistribution</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/queue-message-redistribution/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/queue-message-redistribution/readme.html b/examples/broker-features/clustered/queue-message-redistribution/readme.html
deleted file mode 100644
index 35fcafe..0000000
--- a/examples/broker-features/clustered/queue-message-redistribution/readme.html
+++ /dev/null
@@ -1,61 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Message Redistribution 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>Message Redistribution Example</h1>
-
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
-
-
-     <p>This example demonstrates message redistribution between queues with the same name deployed in different
-     nodes of a cluster.</p>
-     <p>As demontrated in the clustered queue example, if queues with the same name are deployed on different nodes of
-     a cluster, ActiveMQ Artemis can be configured to load balance messages between the nodes on the server side.</p>
-     <p>However, if the consumer(s) on a particular node are closed, then messages in the queue at that node can
-     appear to be stranded, since they have no local consumers.</p>
-     <p>If this is undesirable, ActiveMQ Artemis can be configured to <b>redistribute</b> messages from the node
-     with no consumers, to nodes where there are consumers. If the consumers have JMS selectors set on them, then they
-     will only be redistributed to nodes with consumers whose selectors match.</p>
-     <p>By default, message redistribution is disabled, but can be enabled by specifying some AddressSettings configuration
-     in either <code>activemq-queues.xml</code> or <code>broker.xml</code></p>
-     <p>Setting <code>redistribution-delay</code> to <code>0</code> will cause redistribution to occur immediately
-     once there are no more matching consumers on a particular queue instance. Setting it to a positive value > 0 specifies
-     a delay in milliseconds before attempting to redistribute. The delay is useful in the case that another consumer is
-     likely to be created on the queue, to avoid unnecessary redistribution.</p>
-     <p>Here's the relevant snippet from the <code>activemq-queues.xml</code> configuration, which tells the server
-     to use a redistribution delay of <code>0</code> on any jms queues, i.e. any queues whose name starts with
-     <code>jms.</code></p>
-     <pre class="prettyprint">
-     <code>
-  &lt;address-setting match="jms.#"&gt;
-      &lt;redistribution-delay&gt;0&lt;/redistribution-delay&gt;
-   &lt;/address-setting&gt;
-   </code>
-     </pre>
-     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
-     section of the user manual.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java b/examples/broker-features/clustered/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
deleted file mode 100644
index b3c056b..0000000
--- a/examples/broker-features/clustered/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
+++ /dev/null
@@ -1,145 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * This example demonstrates a queue with the same name deployed on two nodes of a cluster.
- * Messages are initially round robin'd between both nodes of the cluster.
- * The consumer on one of the nodes is then closed, and we demonstrate that the "stranded" messages
- * are redistributed to the other node which has a consumer so they can be consumed.
- */
-public class QueueMessageRedistributionExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection connection0 = null;
-
-      Connection connection1 = null;
-
-      try {
-         // Step 2. Look-up the JMS Queue object from JNDI
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
-
-         // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
-         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
-
-         // Step 6. We create a JMS Connection connection0 which is a connection to server 0
-         connection0 = cf0.createConnection();
-
-         // Step 7. We create a JMS Connection connection1 which is a connection to server 1
-         connection1 = cf1.createConnection();
-
-         // Step 8. We create a JMS Session on server 0, note the session is CLIENT_ACKNOWLEDGE
-         Session session0 = connection0.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
-         // Step 9. We create a JMS Session on server 1, note the session is CLIENT_ACKNOWLEDGE
-         Session session1 = connection1.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
-         // Step 10. We start the connections to ensure delivery occurs on them
-         connection0.start();
-
-         connection1.start();
-
-         // Step 11. We create JMS MessageConsumer objects on server 0 and server 1
-         MessageConsumer consumer0 = session0.createConsumer(queue);
-
-         MessageConsumer consumer1 = session1.createConsumer(queue);
-
-         Thread.sleep(1000);
-
-         // Step 12. We create a JMS MessageProducer object on server 0
-         MessageProducer producer = session0.createProducer(queue);
-
-         // Step 13. We send some messages to server 0
-
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session0.createTextMessage("This is text message " + i);
-
-            producer.send(message);
-
-            System.out.println("Sent message: " + message.getText());
-         }
-
-         // Step 14. We now consume those messages on *both* server 0 and server 1.
-         // We note the messages have been distributed between servers in a round robin fashion
-         // JMS Queues implement point-to-point message where each message is only ever consumed by a
-         // maximum of one consumer
-
-         TextMessage message0 = null;
-
-         TextMessage message1 = null;
-
-         for (int i = 0; i < numMessages; i += 2) {
-            message0 = (TextMessage) consumer0.receive(5000);
-
-            System.out.println("Got message: " + message0.getText() + " from node 0");
-
-            message1 = (TextMessage) consumer1.receive(5000);
-
-            System.out.println("Got message: " + message1.getText() + " from node 1");
-         }
-
-         // Step 15. We acknowledge the messages consumed on node 0. The sessions are CLIENT_ACKNOWLEDGE so
-         // messages will not get acknowledged until they are explicitly acknowledged.
-         // Note that we *do not* acknowledge the message consumed on node 1 yet.
-         message0.acknowledge();
-
-         // Step 16. We now close the session and consumer on node 1. (Closing the session automatically closes the
-         // consumer)
-         session1.close();
-
-         // Step 17. Since there is no more consumer on node 1, the messages on node 1 are now stranded (no local
-         // consumers)
-         // so ActiveMQ Artemis will redistribute them to node 0 so they can be consumed.
-
-         for (int i = 0; i < numMessages; i += 2) {
-            message0 = (TextMessage) consumer0.receive(5000);
-
-            System.out.println("Got message: " + message0.getText() + " from node 0");
-         }
-
-         // Step 18. We ack the messages.
-         message0.acknowledge();
-      }
-      finally {
-         // Step 18. Be sure to close our resources!
-
-         if (connection0 != null) {
-            connection0.close();
-         }
-
-         if (connection1 != null) {
-            connection1.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/clustered/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 70ff4d4..0000000
--- a/examples/broker-features/clustered/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-<?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>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>ON_DEMAND</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-      <address-settings>
-         <!-- We set a redistribution delay of zero on all jms queues and topic subscriptions
-         Default redistribution delay as -1 which means "disable redistribution"
-         Setting it to a value > 0 means how long to wait before redistributing, if a consumer is closed
-         then another one quickly recreated you might want to set it thus, to avoid unnecessary
-         redistribution -->
-         <address-setting match="jms.#">
-            <redistribution-delay>0</redistribution-delay>
-         </address-setting>
-      </address-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/clustered/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 6fc6f32..0000000
--- a/examples/broker-features/clustered/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-<?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:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>ON_DEMAND</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- 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-settings>
-
-      <address-settings>
-         <!-- We set a redistribution delay of zero on all jms queues and topic subscriptions
-         Default redistribution delay as -1 which means "disable redistribution"
-         Setting it to a value > 0 means how long to wait before redistributing, if a consumer is closed
-         then another one quickly recreated you might want to set it thus, to avoid unnecessary
-         redistribution -->
-         <address-setting match="jms.#">
-            <redistribution-delay>0</redistribution-delay>
-         </address-setting>
-      </address-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/symmetric-cluster/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/symmetric-cluster/pom.xml b/examples/broker-features/clustered/symmetric-cluster/pom.xml
deleted file mode 100644
index 5be9c1d..0000000
--- a/examples/broker-features/clustered/symmetric-cluster/pom.xml
+++ /dev/null
@@ -1,320 +0,0 @@
-<?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.clustered</groupId>
-      <artifactId>broker-clustered</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>symmetric-cluster</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Symmetric Cluster 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>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create2</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <instance>${basedir}/target/server2</instance>
-                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create3</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <instance>${basedir}/target/server3</instance>
-                     <configuration>${basedir}/target/classes/activemq/server3</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create4</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <instance>${basedir}/target/server4</instance>
-                     <configuration>${basedir}/target/classes/activemq/server4</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create5</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <instance>${basedir}/target/server5</instance>
-                     <configuration>${basedir}/target/classes/activemq/server5</configuration>
-                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server0</location>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server1</location>
-                     <testURI>tcp://localhost:61617</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server1</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start2</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server2</location>
-                     <testURI>tcp://localhost:61618</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server2</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start3</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server3</location>
-                     <testURI>tcp://localhost:61619</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server3</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start4</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server4</location>
-                     <testURI>tcp://localhost:61620</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server4</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start5</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server5</location>
-                     <testURI>tcp://localhost:61621</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server5</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.SymmetricClusterExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <location>${basedir}/target/server1</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop2</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <location>${basedir}/target/server2</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop3</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <location>${basedir}/target/server3</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop4</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <location>${basedir}/target/server4</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop5</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noSever}</ignore>
-                     <location>${basedir}/target/server5</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.clustered</groupId>
-                  <artifactId>symmetric-cluster</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/symmetric-cluster/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/symmetric-cluster/readme.html b/examples/broker-features/clustered/symmetric-cluster/readme.html
deleted file mode 100644
index 043057d..0000000
--- a/examples/broker-features/clustered/symmetric-cluster/readme.html
+++ /dev/null
@@ -1,74 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Symmetric Cluster 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 Symmetric Cluster 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 examples demonstrates a <b>symmetric cluster</b> set-up with ActiveMQ Artemis.</p>
-     <p>ActiveMQ Artemis has extremely flexible clustering which allows you to set-up servers in
-     many different topologies.</p>
-     <p>The most common topology that you'll perhaps be familiar with if you are used to application
-     server clustering is a <b>symmetric cluster</b>.</p>
-     <p>With a symmetric cluster, the cluster is homogeneous, i.e. each node is configured the same
-     as every other node, and every node is connected to every other node in the cluster.</p>
-     <p>By connecting node in such a way, we can, from a JMS point of view, give the impression of distributed
-     JMS queues and topics.</p>
-     <p>The configuration used in this example is very similar to the configuration used by ActiveMQ
-     when installed as a clustered profile in JBoss Application Server.</p>
-     <p>To set up ActiveMQ Artemis to form a symmetric cluster we simply need to mark each server as <code>clustered</code>
-     and we need to define a <code>cluster-connection</code> in <code>broker.xml</code>.</p>
-     <p>The <code>cluster-connection</code> tells the nodes what other nodes to make connections to.
-     With a <code>cluster-connection</code> each node that we connect to can either be specified
-     indivually, or we can use UDP discovery to find out what other nodes are in the cluster.</p>
-     <p>Using UDP discovery makes configuration simpler since we don't have to know what nodes are
-     available at any one time.</p>
-     <p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster
-     with the other nodes:</p>
-     <pre class="prettyprint">
-     <code>
-   &lt;cluster-connection name="my-cluster"&gt;
-      &lt;address&gt;jms&lt;/address&gt;
-      &lt;connector-ref>netty-connector&lt;/connector-ref>
-	   &lt;retry-interval&gt;500&lt;/retry-interval&gt;
-	   &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
-	   &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
-	   &lt;max-hops&gt;1&lt;/max-hops&gt;
-	   &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
-   &lt;/cluster-connection&gt;
-   </code>
-     </pre>
-     <p>In this example we create a symmetric cluster of six live nodes, and we also pair each live node
-     with it's own backup node. (A backup node is not strictly necessary for a symmetric cluster).</p>
-    <p>In this example will we will demonstrate this by deploying a JMS topic and Queue on all nodes of the cluster
-     , sending messages to the queue and topic from different nodes, and verifying messages are received correctly
-     by consumers on different nodes.</p>
-    <p>For more information on configuring ActiveMQ Artemis clustering in general, please see the clustering
-     section of the user manual.</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java b/examples/broker-features/clustered/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java
deleted file mode 100644
index 1163ec8..0000000
--- a/examples/broker-features/clustered/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java
+++ /dev/null
@@ -1,222 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-
-import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
-import org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory;
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-
-/**
- * This example demonstrates a cluster of three nodes set up in a symmetric topology - i.e. each
- * node is connected to every other node in the cluster. Also each node, has it's own backup node.
- * <p>
- * This is probably the most obvious clustering topology and the one most people will be familiar
- * with from using clustering in an app server, where every node has pretty much identical
- * configuration to every other node.
- * <p>
- * By clustering nodes symmetrically, ActiveMQ Artemis can give the impression of clustered queues, topics
- * and durable subscriptions.
- * <p>
- * In this example we send some messages to a distributed queue and topic and kill all the live
- * servers at different times, and verify that they transparently fail over onto their backup
- * servers.
- * <p>
- * Please see the readme.html file for more information.
- */
-public class SymmetricClusterExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection connection0 = null;
-
-      Connection connection1 = null;
-
-      Connection connection2 = null;
-
-      Connection connection3 = null;
-
-      Connection connection4 = null;
-
-      Connection connection5 = null;
-
-      try {
-         // Step 1 - We instantiate a connection factory directly, specifying the UDP address and port for discovering
-         // the list of servers in the cluster.
-         // We could use JNDI to look-up a connection factory, but we'd need to know the JNDI server host and port for
-         // the
-         // specific server to do that, and that server might not be available at the time. By creating the
-         // connection factory directly we avoid having to worry about a JNDI look-up.
-         // In an app server environment you could use HA-JNDI to lookup from the clustered JNDI servers without
-         // having to know about a specific one.
-         UDPBroadcastEndpointFactory udpCfg = new UDPBroadcastEndpointFactory();
-         udpCfg.setGroupAddress("231.7.7.7").setGroupPort(9876);
-         DiscoveryGroupConfiguration groupConfiguration = new DiscoveryGroupConfiguration();
-         groupConfiguration.setBroadcastEndpointFactory(udpCfg);
-
-         ConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithHA(groupConfiguration, JMSFactoryType.CF);
-
-         // We give a little while for each server to broadcast its whereabouts to the client
-         Thread.sleep(2000);
-
-         // Step 2. Directly instantiate JMS Queue and Topic objects
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         Topic topic = ActiveMQJMSClient.createTopic("exampleTopic");
-
-         // Step 3. We create six connections, they should be to different nodes of the cluster in a round-robin fashion
-         // and start them
-         connection0 = cf.createConnection();
-
-         connection1 = cf.createConnection();
-
-         connection2 = cf.createConnection();
-
-         connection3 = cf.createConnection();
-
-         connection4 = cf.createConnection();
-
-         connection5 = cf.createConnection();
-
-         connection0.start();
-
-         connection1.start();
-
-         connection2.start();
-
-         connection3.start();
-
-         connection4.start();
-
-         connection5.start();
-
-         // Step 4. We create a session on each connection
-
-         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         Session session3 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         Session session4 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         Session session5 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 5. We create a topic subscriber on each server
-
-         MessageConsumer subscriber0 = session0.createConsumer(topic);
-
-         MessageConsumer subscriber1 = session1.createConsumer(topic);
-
-         MessageConsumer subscriber2 = session2.createConsumer(topic);
-
-         MessageConsumer subscriber3 = session3.createConsumer(topic);
-
-         MessageConsumer subscriber4 = session4.createConsumer(topic);
-
-         MessageConsumer subscriber5 = session5.createConsumer(topic);
-
-         // Step 6. We create a queue consumer on server 0
-
-         MessageConsumer consumer0 = session0.createConsumer(queue);
-
-         // Step 7. We create an anonymous message producer on just one server 2
-
-         MessageProducer producer2 = session2.createProducer(null);
-
-         // Step 8. We send 500 messages each to the queue and topic
-
-         final int numMessages = 500;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message1 = session2.createTextMessage("Topic message " + i);
-
-            producer2.send(topic, message1);
-
-            TextMessage message2 = session2.createTextMessage("Queue message " + i);
-
-            producer2.send(queue, message2);
-         }
-
-         // Step 9. Verify all subscribers and the consumer receive the messages
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage received0 = (TextMessage) subscriber0.receive(5000);
-
-            if (received0 == null) {
-               throw new IllegalStateException("Message is null!");
-            }
-
-            TextMessage received1 = (TextMessage) subscriber1.receive(5000);
-
-            if (received1 == null) {
-               throw new IllegalStateException("Message is null!");
-            }
-
-            TextMessage received2 = (TextMessage) subscriber2.receive(5000);
-
-            if (received2 == null) {
-               throw new IllegalStateException("Message is null!");
-            }
-
-            TextMessage received3 = (TextMessage) subscriber3.receive(5000);
-
-            if (received3 == null) {
-               throw new IllegalStateException("Message is null!");
-            }
-
-            TextMessage received4 = (TextMessage) subscriber4.receive(5000);
-
-            if (received4 == null) {
-               throw new IllegalStateException("Message is null!");
-            }
-
-            TextMessage received5 = (TextMessage) subscriber5.receive(5000);
-
-            if (received5 == null) {
-               throw new IllegalStateException("Message is null!");
-            }
-
-            TextMessage received6 = (TextMessage) consumer0.receive(5000);
-
-            if (received6 == null) {
-               throw new IllegalStateException("Message is null!");
-            }
-         }
-      }
-      finally {
-         // Step 15. Be sure to close our resources!
-
-         connection0.close();
-         connection1.close();
-         connection2.close();
-         connection3.close();
-         connection4.close();
-         connection5.close();
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index cd89de7..0000000
--- a/examples/broker-features/clustered/symmetric-cluster/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?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">
-      <queue name="exampleQueue"/>
-
-      <topic name="exampleTopic"/>
-   </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>
-
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>ON_DEMAND</message-load-balancing>
-            <max-hops>1</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!-- Default JMS security -->
-         <security-setting match="jms.#">
-            <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-settings>
-
-   </core>
-</configuration>


[14/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java b/examples/features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java
new file mode 100644
index 0000000..e014693
--- /dev/null
+++ b/examples/features/standard/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java
@@ -0,0 +1,212 @@
+/*
+ * 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.jms.Topic;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * This examples demonstrates the use of ActiveMQ Artemis "Diverts" to transparently divert or copy messages
+ * from one address to another.
+ *
+ * Please see the readme.html for more information.
+ */
+public class DivertExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connectionLondon = null;
+
+      Connection connectionNewYork = null;
+      try {
+         // Step 2. Look-up the queue orderQueue on the London server - this is the queue any orders are sent to
+         Queue orderQueue = ActiveMQJMSClient.createQueue("orders");
+
+         // Step 3. Look-up the topic priceUpdates on the London server- this is the topic that any price updates are
+         // sent to
+         Topic priceUpdates = ActiveMQJMSClient.createTopic("priceUpdates");
+
+         // Step 4. Look-up the spy topic on the London server- this is what we will use to snoop on any orders
+         Topic spyTopic = ActiveMQJMSClient.createTopic("spyTopic");
+
+         // Step 7. Look-up the topic newYorkPriceUpdates on the New York server - any price updates sent to
+         // priceUpdates on the London server will
+         // be diverted to the queue priceForward on the London server, and a bridge will consume from that queue and
+         // forward
+         // them to the address newYorkPriceUpdates on the New York server where they will be distributed to the topic
+         // subscribers on
+         // the New York server
+         Topic newYorkPriceUpdates = ActiveMQJMSClient.createTopic("newYorkPriceUpdates");
+
+         // Step 8. Perform a lookup on the Connection Factory on the London server
+         ConnectionFactory cfLondon = new ActiveMQConnectionFactory("tcp://localhost:61616");
+
+         // Step 9. Perform a lookup on the Connection Factory on the New York server
+         ConnectionFactory cfNewYork = new ActiveMQConnectionFactory("tcp://localhost:61617");
+
+         // Step 10. Create a JMS Connection on the London server
+         connectionLondon = cfLondon.createConnection();
+
+         // Step 11. Create a JMS Connection on the New York server
+         connectionNewYork = cfNewYork.createConnection();
+
+         // Step 12. Create a JMS Session on the London server
+         Session sessionLondon = connectionLondon.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 13. Create a JMS Session on the New York server
+         Session sessionNewYork = connectionNewYork.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 14. Create a JMS MessageProducer orderProducer that sends to the queue orderQueue on the London server
+         MessageProducer orderProducer = sessionLondon.createProducer(orderQueue);
+
+         // Step 15. Create a JMS MessageProducer priceProducer that sends to the topic priceUpdates on the London
+         // server
+         MessageProducer priceProducer = sessionLondon.createProducer(priceUpdates);
+
+         // Step 15. Create a JMS subscriber which subscribes to the spyTopic on the London server
+         MessageConsumer spySubscriberA = sessionLondon.createConsumer(spyTopic);
+
+         // Step 16. Create another JMS subscriber which also subscribes to the spyTopic on the London server
+         MessageConsumer spySubscriberB = sessionLondon.createConsumer(spyTopic);
+
+         // Step 17. Create a JMS MessageConsumer which consumes orders from the order queue on the London server
+         MessageConsumer orderConsumer = sessionLondon.createConsumer(orderQueue);
+
+         // Step 18. Create a JMS subscriber which subscribes to the priceUpdates topic on the London server
+         MessageConsumer priceUpdatesSubscriberLondon = sessionLondon.createConsumer(priceUpdates);
+
+         // Step 19. Create a JMS subscriber which subscribes to the newYorkPriceUpdates topic on the New York server
+         MessageConsumer newYorkPriceUpdatesSubscriberA = sessionNewYork.createConsumer(newYorkPriceUpdates);
+
+         // Step 20. Create another JMS subscriber which also subscribes to the newYorkPriceUpdates topic on the New
+         // York server
+         MessageConsumer newYorkPriceUpdatesSubscriberB = sessionNewYork.createConsumer(newYorkPriceUpdates);
+
+         // Step 21. Start the connections
+
+         connectionLondon.start();
+
+         connectionNewYork.start();
+
+         // Step 22. Create an order message
+         TextMessage orderMessage = sessionLondon.createTextMessage("This is an order");
+
+         // Step 23. Send the order message to the order queue on the London server
+         orderProducer.send(orderMessage);
+
+         System.out.println("Sent message: " + orderMessage.getText());
+
+         // Step 24. The order message is consumed by the orderConsumer on the London server
+         TextMessage receivedOrder = (TextMessage) orderConsumer.receive(5000);
+
+         System.out.println("Received order: " + receivedOrder.getText());
+
+         // Step 25. A copy of the order is also received by the spyTopic subscribers on the London server
+         TextMessage spiedOrder1 = (TextMessage) spySubscriberA.receive(5000);
+
+         System.out.println("Snooped on order: " + spiedOrder1.getText());
+
+         TextMessage spiedOrder2 = (TextMessage) spySubscriberB.receive(5000);
+
+         System.out.println("Snooped on order: " + spiedOrder2.getText());
+
+         // Step 26. Create and send a price update message, destined for London
+         TextMessage priceUpdateMessageLondon = sessionLondon.createTextMessage("This is a price update for London");
+
+         priceUpdateMessageLondon.setStringProperty("office", "London");
+
+         priceProducer.send(priceUpdateMessageLondon);
+
+         // Step 27. The price update *should* be received by the local subscriber since we only divert messages
+         // where office = New York
+         TextMessage receivedUpdate = (TextMessage) priceUpdatesSubscriberLondon.receive(2000);
+
+         System.out.println("Received price update locally: " + receivedUpdate.getText());
+
+         // Step 28. The price update *should not* be received in New York
+
+         TextMessage priceUpdate1 = (TextMessage) newYorkPriceUpdatesSubscriberA.receive(1000);
+
+         if (priceUpdate1 != null) {
+            throw new IllegalStateException("Message is not null");
+         }
+
+         System.out.println("Did not received price update in New York, look it's: " + priceUpdate1);
+
+         TextMessage priceUpdate2 = (TextMessage) newYorkPriceUpdatesSubscriberB.receive(1000);
+
+         if (priceUpdate2 != null) {
+            throw new IllegalStateException("Message is not null");
+         }
+
+         System.out.println("Did not received price update in New York, look it's: " + priceUpdate2);
+
+         // Step 29. Create a price update message, destined for New York
+
+         TextMessage priceUpdateMessageNewYork = sessionLondon.createTextMessage("This is a price update for New York");
+
+         priceUpdateMessageNewYork.setStringProperty("office", "New York");
+
+         // Step 30. Send the price update message to the priceUpdates topic on the London server
+         priceProducer.send(priceUpdateMessageNewYork);
+
+         // Step 31. The price update *should not* be received by the local subscriber to the priceUpdates topic
+         // since it has been *exclusively* diverted to the priceForward queue, because it has a header saying
+         // it is destined for the New York office
+         Message message = priceUpdatesSubscriberLondon.receive(1000);
+
+         if (message != null) {
+            throw new IllegalStateException("Message is not null");
+         }
+
+         System.out.println("Didn't receive local price update, look, it's: " + message);
+
+         // Step 32. The remote subscribers on server 1 *should* receive a copy of the price update since
+         // it has been diverted to a local priceForward queue which has a bridge consuming from it and which
+         // forwards it to the same address on server 1.
+         // We notice how the forwarded messages have had a special header added by our custom transformer that
+         // we told the divert to use
+
+         priceUpdate1 = (TextMessage) newYorkPriceUpdatesSubscriberA.receive(5000);
+
+         System.out.println("Received forwarded price update on server 1: " + priceUpdate1.getText());
+         System.out.println("Time of forward: " + priceUpdate1.getLongProperty("time_of_forward"));
+
+         priceUpdate2 = (TextMessage) newYorkPriceUpdatesSubscriberB.receive(5000);
+
+         System.out.println("Received forwarded price update on server 2: " + priceUpdate2.getText());
+         System.out.println("Time of forward: " + priceUpdate2.getLongProperty("time_of_forward"));
+      }
+      finally {
+         if (connectionLondon != null) {
+            connectionLondon.close();
+         }
+         if (connectionNewYork != null) {
+            connectionNewYork.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/divert/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/divert/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/divert/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/divert/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/divert/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/divert/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/divert/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/divert/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/6b17d966/examples/features/standard/divert/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/divert/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/divert/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..7ce362a
--- /dev/null
+++ b/examples/features/standard/divert/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,121 @@
+<?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">
+      <!-- Destinations used by the example -->
+
+      <!-- The order queue -->
+      <queue name="orders"/>
+
+      <!-- The queue that prices are forwarded to before being bridged to the New York server -->
+      <queue name="priceForwarding"/>
+
+      <!-- The topic for price updates -->
+      <topic name="priceUpdates"/>
+
+      <!-- The spy topic for snooping on orders -->
+      <topic name="spyTopic"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+
+      <!-- Connectors -->
+
+      <connectors>
+         <!-- This connector corresponds to the New York server -->
+         <connector name="newyork-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Divert configuration -->
+
+      <!-- We need to create a core queue for the JMS queue explicitly because the bridge will be deployed
+      before the JMS queue is deployed, so the first time, it otherwise won't find the queue -->
+      <queues>
+         <queue name="jms.queue.priceForwarding">
+            <address>jms.queue.priceForwarding</address>
+         </queue>
+      </queues>
+
+      <diverts>
+         <divert name="order-divert">
+            <routing-name>order-divert</routing-name>
+            <address>jms.queue.orders</address>
+            <forwarding-address>jms.topic.spyTopic</forwarding-address>
+            <exclusive>false</exclusive>
+         </divert>
+
+         <divert name="prices-divert">
+            <routing-name>prices-divert</routing-name>
+            <address>jms.topic.priceUpdates</address>
+            <forwarding-address>jms.queue.priceForwarding</forwarding-address>
+            <filter string="office='New York'"/>
+            <transformer-class-name>org.apache.activemq.artemis.jms.example.AddForwardingTimeTransformer
+            </transformer-class-name>
+            <exclusive>true</exclusive>
+         </divert>
+      </diverts>
+
+      <!-- Bridge configuration -->
+
+      <bridges>
+         <bridge name="price-forward-bridge">
+            <queue-name>jms.queue.priceForwarding</queue-name>
+            <forwarding-address>jms.topic.newYorkPriceUpdates</forwarding-address>
+            <reconnect-attempts>-1</reconnect-attempts>
+            <static-connectors>
+               <connector-ref>newyork-connector</connector-ref>
+            </static-connectors>
+         </bridge>
+      </bridges>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example -->
+         <security-setting match="jms.#">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/divert/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/divert/src/main/resources/activemq/server1/artemis-roles.properties b/examples/features/standard/divert/src/main/resources/activemq/server1/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/divert/src/main/resources/activemq/server1/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/divert/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/divert/src/main/resources/activemq/server1/artemis-users.properties b/examples/features/standard/divert/src/main/resources/activemq/server1/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/divert/src/main/resources/activemq/server1/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/6b17d966/examples/features/standard/divert/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/divert/src/main/resources/activemq/server1/broker.xml b/examples/features/standard/divert/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..315d13b
--- /dev/null
+++ b/examples/features/standard/divert/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,64 @@
+<?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">
+      <!-- Destinations used by the example -->
+
+      <!-- The topic for New York price updates -->
+
+      <topic name="newYorkPriceUpdates"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+
+      <!-- Acceptors -->
+
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.#">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/durable-subscription/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/durable-subscription/pom.xml b/examples/features/standard/durable-subscription/pom.xml
new file mode 100644
index 0000000..a502fff
--- /dev/null
+++ b/examples/features/standard/durable-subscription/pom.xml
@@ -0,0 +1,110 @@
+<?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>durable-subscription</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Durable Subscription 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>${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.DurableSubscriptionExample</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>durable-subscription</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/durable-subscription/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/durable-subscription/readme.html b/examples/features/standard/durable-subscription/readme.html
new file mode 100644
index 0000000..61b591f
--- /dev/null
+++ b/examples/features/standard/durable-subscription/readme.html
@@ -0,0 +1,39 @@
+<!--
+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 Durable Subscription 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 Durable Subscription 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 to use a durable subscription with ActiveMQ Artemis.</p>
+     <p>Durable subscriptions are a standard part of JMS, please consult the JMS 1.1 specification for full details.</p>
+     <p>Unlike non durable subscriptions, the key function of durable subscriptions is that the messages contained in them
+         persist longer than the lifetime of the subscriber - i.e. they will accumulate messages sent to the topic even
+         if the subscriber is not currently connected. They will also survive server restarts. Note that for the messages to
+         be persisted, the messages sent to them must be marked as persistent messages.</p>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/DurableSubscriptionExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/DurableSubscriptionExample.java b/examples/features/standard/durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/DurableSubscriptionExample.java
new file mode 100644
index 0000000..46cd94c
--- /dev/null
+++ b/examples/features/standard/durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/DurableSubscriptionExample.java
@@ -0,0 +1,116 @@
+/*
+ * 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.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.jms.TopicSubscriber;
+import javax.naming.InitialContext;
+
+/**
+ * A simple JMS example that shows how to use a durable subscription.
+ */
+public class DurableSubscriptionExample {
+
+   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. Look-up the JMS topic
+         Topic topic = (Topic) initialContext.lookup("topic/exampleTopic");
+
+         // Step 3. Look-up the JMS connection factory
+         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 4. Create a JMS connection
+         connection = cf.createConnection();
+
+         // Step 5. Set the client-id on the connection
+         connection.setClientID("durable-client");
+
+         // 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
+         MessageProducer messageProducer = session.createProducer(topic);
+
+         // Step 9. Create the subscription and the subscriber.
+         TopicSubscriber subscriber = session.createDurableSubscriber(topic, "subscriber-1");
+
+         // Step 10. Create a text message
+         TextMessage message1 = session.createTextMessage("This is a text message 1");
+
+         // Step 11. Send the text message to the topic
+         messageProducer.send(message1);
+
+         System.out.println("Sent message: " + message1.getText());
+
+         // Step 12. Consume the message from the durable subscription
+
+         TextMessage messageReceived = (TextMessage) subscriber.receive();
+
+         System.out.println("Received message: " + messageReceived.getText());
+
+         // Step 13. Create and send another message
+
+         TextMessage message2 = session.createTextMessage("This is a text message 2");
+
+         messageProducer.send(message2);
+
+         System.out.println("Sent message: " + message2.getText());
+
+         // Step 14. Close the subscriber - the server could even be stopped at this point!
+         subscriber.close();
+
+         // Step 15. Create a new subscriber on the *same* durable subscription.
+
+         subscriber = session.createDurableSubscriber(topic, "subscriber-1");
+
+         // Step 16. Consume the message
+
+         messageReceived = (TextMessage) subscriber.receive();
+
+         System.out.println("Received message: " + messageReceived.getText());
+
+         // Step 17. Close the subscriber
+         subscriber.close();
+
+         // Step 18. Delete the durable subscription
+         session.unsubscribe("subscriber-1");
+      }
+      finally {
+         if (connection != null) {
+            // Step 19. Be sure to close our JMS resources!
+            connection.close();
+         }
+         if (initialContext != null) {
+            // Step 20. Also close the initialContext!
+            initialContext.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/durable-subscription/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/durable-subscription/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/6b17d966/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..2b2ba2e
--- /dev/null
+++ b/examples/features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,61 @@
+<?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 topic used by the example-->
+      <topic name="exampleTopic"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+
+      <!-- Acceptors -->
+
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example topic-->
+         <security-setting match="jms.topic.exampleTopic">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/durable-subscription/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/durable-subscription/src/main/resources/jndi.properties b/examples/features/standard/durable-subscription/src/main/resources/jndi.properties
new file mode 100644
index 0000000..54bed6d
--- /dev/null
+++ b/examples/features/standard/durable-subscription/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
+topic.topic/exampleTopic=exampleTopic

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/embedded-simple/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/embedded-simple/pom.xml b/examples/features/standard/embedded-simple/pom.xml
new file mode 100644
index 0000000..8ffd616
--- /dev/null
+++ b/examples/features/standard/embedded-simple/pom.xml
@@ -0,0 +1,84 @@
+<?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>embedded-simple</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Simple Embedded Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.EmbeddedExample</clientClass>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.broker</groupId>
+                  <artifactId>embedded-simple</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/embedded-simple/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/embedded-simple/readme.html b/examples/features/standard/embedded-simple/readme.html
new file mode 100644
index 0000000..1bbd7aa
--- /dev/null
+++ b/examples/features/standard/embedded-simple/readme.html
@@ -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.
+-->
+
+<html>
+   <head>
+      <title>ActiveMQ Artemis Embedded JMS Server 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>Embedded JMS Server Example</h1>
+
+      <p>This examples shows how to setup and run an embedded JMS server using ActiveMQ Artemis along with ActiveMQ Artemis configuration files.</p>
+
+      <h2>Example step-by-step</h2>
+      <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
+
+      <ol>
+         <li>Create ActiveMQ Artemis core configuration files and make sure they are within your classpath.  By default, ActiveMQ
+             expects the configuration file name to be "broker.xml".</li>
+         <li>Create an embedded ActiveMQ Artemis JMS server</li>
+         <pre class="prettyprint">
+            <code>EmbeddedJMS jmsServer = new EmbeddedJMS();</code>
+         </pre>
+
+         <li>Setup security configurations</li>
+         <pre class="prettyprint">
+            <code>SecurityConfiguration securityConfig = new SecurityConfiguration();
+            securityConfig.addUser("guest", "guest");
+            securityConfig.addRole("guest", "guest");
+            securityConfig.setDefaultUser("guest");
+            jmsServer.setSecurityManager(new ActiveMQSecurityManagerImpl(securityConfig));</code>
+         </pre>
+
+         <li>Start the embedded ActiveMQ Artemis JMS server</li>
+         <pre class="prettyprint">
+            <code>jmsServer.start()</code>
+         </pre>
+
+         <li>Create JMS resources (connection factory and queue) for the example</li>
+         <pre class="prettyprint">
+            <code>JMSServerManager jmsServerManager = jmsServer.getJMSServerManager();
+            List<String> connectors = new ArrayList<String>();
+            connectors.add("in-vm");
+            jmsServerManager.createConnectionFactory("ConnectionFactory", false, JMSFactoryType.CF, connectors, "ConnectionFactory");
+            jmsServerManager.createQueue(false, "exampleQueue", null, false, "queue/exampleQueue");</code>
+         </pre>
+
+         <p>At this point the JMS server is started and any JMS clients can look up JMS resources from the JNDI to send/receive
+            messages from the server. To keep the example simple, we will send and receive a JMS message from the same JVM
+            used to run the JMS server.</p>
+
+         <li>Lookup JMS resources defined in the configuration </li>
+         <pre class="prettyprint">
+            <code>ConnectionFactory cf = (ConnectionFactory)jmsServer.lookup("ConnectionFactory");
+            Queue queue = (Queue)jmsServer.lookup("queue/exampleQueue");</code>
+         </pre>
+
+         <li>Send and receive a message using JMS API</li>
+         <p>See the <a href="../queue/readme.html">Queue Example</a> for detailed steps to send and receive a JMS message</p>
+
+         <p>Finally, we stop the JMS server and its associated resources.</p>
+
+         <li>Close the connection</li>
+         <pre class="prettyprint">
+            <code>if (connection != null)
+            {
+               connection.close();
+            }</code>
+         </pre>
+
+         <li>Stop the JMS server</li>
+         <pre class="prettyprint">
+            <code>jmsServer.stop();</code>
+         </pre>
+
+      </ol>
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java b/examples/features/standard/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
new file mode 100644
index 0000000..7d00c7e
--- /dev/null
+++ b/examples/features/standard/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
@@ -0,0 +1,86 @@
+/*
+ * 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 org.apache.activemq.artemis.api.jms.JMSFactoryType;
+import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
+import org.apache.activemq.artemis.jms.server.JMSServerManager;
+import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
+import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;
+
+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 java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * This example demonstrates how to run an ActiveMQ Artemis embedded with JMS
+ */
+public class EmbeddedExample {
+
+   public static void main(final String[] args) throws Exception {
+      EmbeddedJMS jmsServer = new EmbeddedJMS();
+
+      SecurityConfiguration securityConfig = new SecurityConfiguration();
+      securityConfig.addUser("guest", "guest");
+      securityConfig.addRole("guest", "guest");
+      securityConfig.setDefaultUser("guest");
+      jmsServer.setSecurityManager(new ActiveMQSecurityManagerImpl(securityConfig));
+
+      jmsServer.start();
+      System.out.println("Started Embedded JMS Server");
+
+      JMSServerManager jmsServerManager = jmsServer.getJMSServerManager();
+      List<String> connectors = new ArrayList<String>();
+      connectors.add("in-vm");
+      jmsServerManager.createConnectionFactory("ConnectionFactory", false, JMSFactoryType.CF, connectors, "ConnectionFactory");
+      jmsServerManager.createQueue(false, "exampleQueue", null, false, "queue/exampleQueue");
+
+      ConnectionFactory cf = (ConnectionFactory) jmsServer.lookup("ConnectionFactory");
+      Queue queue = (Queue) jmsServer.lookup("queue/exampleQueue");
+
+      // Step 10. Send and receive a message using JMS API
+      Connection connection = null;
+      try {
+         connection = cf.createConnection();
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer producer = session.createProducer(queue);
+         TextMessage message = session.createTextMessage("Hello sent at " + new Date());
+         System.out.println("Sending message: " + message.getText());
+         producer.send(message);
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+         connection.start();
+         TextMessage messageReceived = (TextMessage) messageConsumer.receive(1000);
+         System.out.println("Received message:" + messageReceived.getText());
+      }
+      finally {
+         if (connection != null) {
+            connection.close();
+         }
+
+         // Step 11. Stop the JMS server
+         jmsServer.stop();
+         System.out.println("Stopped the JMS Server");
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/embedded-simple/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/embedded-simple/src/main/resources/broker.xml b/examples/features/standard/embedded-simple/src/main/resources/broker.xml
new file mode 100644
index 0000000..0448e3b
--- /dev/null
+++ b/examples/features/standard/embedded-simple/src/main/resources/broker.xml
@@ -0,0 +1,52 @@
+<?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">
+
+   <core xmlns="urn:activemq:core">
+
+      <persistence-enabled>false</persistence-enabled>
+
+      <connectors>
+         <connector name="in-vm">vm://0</connector>
+      </connectors>
+
+      <acceptors>
+         <acceptor name="in-vm">vm://0</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="#">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/embedded/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/embedded/pom.xml b/examples/features/standard/embedded/pom.xml
new file mode 100644
index 0000000..ee576c4
--- /dev/null
+++ b/examples/features/standard/embedded/pom.xml
@@ -0,0 +1,84 @@
+<?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>embedded</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Embedded Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.EmbeddedExample</clientClass>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.broker</groupId>
+                  <artifactId>embedded</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/embedded/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/embedded/readme.html b/examples/features/standard/embedded/readme.html
new file mode 100644
index 0000000..2da6ef7
--- /dev/null
+++ b/examples/features/standard/embedded/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 Embedded JMS Server 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>Embedded JMS Server Example</h1>
+      <pre>To run the example, simply type <b>mvn verify</b> from this directory</pre>
+
+      <p>This examples shows how to setup and run an embedded JMS server using ActiveMQ Artemis.</p>
+      <p>ActiveMQ Artemis was designed using POJOs (Plain Old Java Objects) which means embedding ActiveMQ Artemis in your own application
+          is as simple as instantiating a few objects.</p>
+      <p>This example does not use any configuration files. The server is configured using POJOs and can be easily ported to any dependency injection framework.<br />
+         We will setup and run a full-fledged JMS server which binds its JMS resources to JNDI and can be accessed by remote clients.</p>
+
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java b/examples/features/standard/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
new file mode 100644
index 0000000..cb39fd0
--- /dev/null
+++ b/examples/features/standard/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
@@ -0,0 +1,107 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.Date;
+
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.core.config.Configuration;
+import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
+import org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfiguration;
+import org.apache.activemq.artemis.jms.server.config.JMSConfiguration;
+import org.apache.activemq.artemis.jms.server.config.JMSQueueConfiguration;
+import org.apache.activemq.artemis.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
+import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl;
+import org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationImpl;
+import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
+
+/**
+ * This example demonstrates how to run an ActiveMQ Artemis embedded with JMS
+ */
+public final class EmbeddedExample {
+
+   public static void main(final String[] args) throws Exception {
+      // Step 1. Create ActiveMQ Artemis core configuration, and set the properties accordingly
+      Configuration configuration = new ConfigurationImpl();
+      configuration.setPersistenceEnabled(false);
+      configuration.setJournalDirectory("target/data/journal");
+      configuration.setSecurityEnabled(false);
+      configuration.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
+
+      TransportConfiguration connectorConfig = new TransportConfiguration(NettyConnectorFactory.class.getName());
+
+      configuration.getConnectorConfigurations().put("connector", connectorConfig);
+
+      // Step 2. Create the JMS configuration
+      JMSConfiguration jmsConfig = new JMSConfigurationImpl();
+
+      // Step 3. Configure the JMS ConnectionFactory
+      ArrayList<String> connectorNames = new ArrayList<String>();
+      connectorNames.add("connector");
+      ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl().setName("cf").setConnectorNames(connectorNames).setBindings("cf");
+      jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);
+
+      // Step 4. Configure the JMS Queue
+      JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl().setName("queue1").setDurable(false).setBindings("queue/queue1");
+      jmsConfig.getQueueConfigurations().add(queueConfig);
+
+      // Step 5. Start the JMS Server using the ActiveMQ Artemis core server and the JMS configuration
+      EmbeddedJMS jmsServer = new EmbeddedJMS();
+      jmsServer.setConfiguration(configuration);
+      jmsServer.setJmsConfiguration(jmsConfig);
+      jmsServer.start();
+      System.out.println("Started Embedded JMS Server");
+
+      // Step 6. Lookup JMS resources defined in the configuration
+      ConnectionFactory cf = (ConnectionFactory) jmsServer.lookup("cf");
+      Queue queue = (Queue) jmsServer.lookup("queue/queue1");
+
+      // Step 7. Send and receive a message using JMS API
+      Connection connection = null;
+      try {
+         connection = cf.createConnection();
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer producer = session.createProducer(queue);
+         TextMessage message = session.createTextMessage("Hello sent at " + new Date());
+         System.out.println("Sending message: " + message.getText());
+         producer.send(message);
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+         connection.start();
+         TextMessage messageReceived = (TextMessage) messageConsumer.receive(1000);
+         System.out.println("Received message:" + messageReceived.getText());
+      }
+      finally {
+         if (connection != null) {
+            connection.close();
+         }
+
+         // Step 11. Stop the JMS server
+         jmsServer.stop();
+         System.out.println("Stopped the JMS Server");
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/expiry/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/expiry/pom.xml b/examples/features/standard/expiry/pom.xml
new file mode 100644
index 0000000..983cc32
--- /dev/null
+++ b/examples/features/standard/expiry/pom.xml
@@ -0,0 +1,110 @@
+<?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>expiry</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Expiry 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>${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.ExpiryExample</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>expiry</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/expiry/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/expiry/readme.html b/examples/features/standard/expiry/readme.html
new file mode 100644
index 0000000..d13cac0
--- /dev/null
+++ b/examples/features/standard/expiry/readme.html
@@ -0,0 +1,61 @@
+<!--
+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 Message Expiration 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 Expiration 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 configure ActiveMQ Artemis so messages are expipired after a certain time.</p>
+     <p>Messages can be retained in the messaging system for a limited period of time before being removed.
+         JMS specification states that clients should not receive messages that have been expired (but it does not guarantee this will not happen).</p>
+     <p>ActiveMQ Artemis can assign a <em>expiry address</em> to a given queue so that when messages are expired, they are removed from the queue and
+        routed to this address. These "expired" messages can later be consumed for further inspection.
+     <p>
+         The example will send 1 message with a short <em>time-to-live</em> to a queue. We will wait for the message to expire and checks that the message
+         is no longer in the queue it was sent to.
+         We will instead consume it from an <em>expiry queue</em> where it was moved when it expired.
+     </p>
+     <h2>Example setup</h2>
+     <p>Expiry destinations are defined in the configuration file <a href="server0/broker.xml">broker.xml</a>:</p>
+     <pre class="prettyprint">
+         <code>&lt;address-setting match="jms.queue.exampleQueue"&gt;
+            &lt;expiry-address&gt;jms.queue.expiryQueue&lt;/expiry-address&gt;
+         &lt;/address-setting&gt;
+         </code>
+     </pre>
+     <p>This configuration will moved expired messages from the <code>exampleQueue</code> to the <code>expiryQueue</code></p>
+     <p>ActiveMQ Artemis allows to specify either a <code>Queue</code> by prefixing the <code>expiry-address</code> with <code>jms.queue.</code>
+         or a <code>Topic</code> by prefixing with <code>jms.topic.</code>.<br />
+         In this example, we will use a <code>Queue</code> to hold the expired messages.</p>
+     <p>Since we want to consume messages from this expiryQueue, we also need to add a JNDI binding to perform a lookup.
+         This is configured in <a href="server0/activemq-jms.xml">activemq-jms.xml</a></p>
+     <pre class="prettyprint">
+         <code>&lt;queue name="expiryQueue"&gt;
+            &lt;entry name="/queue/expiryQueue"/&gt;
+         &lt;/queue&gt;</code>
+     </pre>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java b/examples/features/standard/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java
new file mode 100644
index 0000000..996da74
--- /dev/null
+++ b/examples/features/standard/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java
@@ -0,0 +1,120 @@
+/*
+ * 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;
+
+/**
+ * An example showing how messages are moved to an expiry queue when they expire.
+ */
+public class ExpiryExample {
+
+   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. Messages sent by this producer will be retained for 1s (1000ms) before expiration
+         producer.setTimeToLive(1000);
+
+         // Step 8. Create a Text Message
+         TextMessage message = session.createTextMessage("this is a text message");
+
+         // Step 9. Send the Message
+         producer.send(message);
+         System.out.println("Sent message to " + queue.getQueueName() + ": " + message.getText());
+
+         // Step 10. Sleep for 5s. Once we wake up, the message will have been expired
+         System.out.println("Sleep a little bit to let the message expire...");
+         Thread.sleep(5000);
+
+         // Step 11. Create a JMS Message Consumer for the queue
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         // Step 12. Start the Connection
+         connection.start();
+
+         // Step 13. Trying to receive a message. Since there is none on the queue, the call will timeout after 5000ms
+         // and messageReceived will be null
+         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
+         System.out.println("Received message from " + queue.getQueueName() + ": " + messageReceived);
+
+         // Step 14. Perfom a lookup on the expiry queue
+         Queue expiryQueue = (Queue) initialContext.lookup("queue/expiryQueue");
+
+         // Step 15. Create a JMS Message Consumer for the expiry queue
+         MessageConsumer expiryConsumer = session.createConsumer(expiryQueue);
+
+         // Step 16. Receive the message from the expiry queue
+         messageReceived = (TextMessage) expiryConsumer.receive(5000);
+
+         // Step 17. The message sent to the queue was moved to the expiry queue when it expired.
+         System.out.println("Received message from " + expiryQueue.getQueueName() + ": " + messageReceived.getText());
+
+         // The message received from the expiry queue has the same content than the expired message but its JMS headers
+         // differ
+         // (from JMS point of view, it's not the same message).
+         // ActiveMQ Artemis defines additional properties to correlate the message received from the expiry queue with the
+         // message expired from the queue
+
+         System.out.println();
+         // Step 18. the messageReceived's destination is now the expiry queue.
+         System.out.println("Destination of the expired message: " + ((Queue) messageReceived.getJMSDestination()).getQueueName());
+         // Step 19. and its own expiration (the time to live in the *expiry* queue)
+         System.out.println("Expiration time of the expired message (relative to the expiry queue): " + messageReceived.getJMSExpiration());
+
+         System.out.println();
+         // Step 20. the *origin* destination is stored in the _AMQ_ORIG_ADDRESS property
+         System.out.println("*Origin destination* of the expired message: " + messageReceived.getStringProperty("_AMQ_ORIG_ADDRESS"));
+         // Step 21. the actual expiration time is stored in the _AMQ_ACTUAL_EXPIRY property
+         System.out.println("*Actual expiration time* of the expired message: " + messageReceived.getLongProperty("_AMQ_ACTUAL_EXPIRY"));
+      }
+      finally {
+         // Step 22. Be sure to close the resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/expiry/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/expiry/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/expiry/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/expiry/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
\ No newline at end of file


[25/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/xa-receive/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-receive/src/main/resources/jndi.properties b/examples/broker-features/standard/xa-receive/src/main/resources/jndi.properties
deleted file mode 100644
index 77561f7..0000000
--- a/examples/broker-features/standard/xa-receive/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,21 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-connectionFactory.XAConnectionFactory=tcp://localhost:61616?type=XA_CF
-queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/xa-send/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-send/pom.xml b/examples/broker-features/standard/xa-send/pom.xml
deleted file mode 100644
index b4dfdf4..0000000
--- a/examples/broker-features/standard/xa-send/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>xa-send</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS XA Send 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>
-                     <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.XASendExample</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>xa-send</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/xa-send/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-send/readme.html b/examples/broker-features/standard/xa-send/readme.html
deleted file mode 100644
index fb3db4c..0000000
--- a/examples/broker-features/standard/xa-send/readme.html
+++ /dev/null
@@ -1,215 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS XA Send 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 XA Send Example</h1>
-     <p>This example shows you how message sending behaves in an XA transaction in ActiveMQ Artemis. When a message is sent within
-         the scope of an XA transaction, it will only reach the queue once the transaction is committed.
-     If the transaction is rolled back the sent messages will be discarded by the server.</p>
-
-     <p>ActiveMQ Artemis is JTA aware, meaning you can use ActiveMQ Artemis in a XA transactional environment
-     and participate in XA transactions. It provides the javax.transaction.xa.XAResource interface for that
-     purpose. Users can get a XAConnectionFactory to create XAConnections and XASessions.</p>
-
-     <p>In this example we simulate a transaction manager to control the transactions. First we create an XASession
-     and enlist it in a transaction through its XAResource. We then send two words, 'hello' and 'world', with
-     the session, let the transaction roll back. The messages are discarded and never be received. Next we start
-     a new transaction with the same XAResource, but this time we commit the transaction. Both messages are received.</p>
-
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext(0);</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We perform a lookup on the XA Connection Factory</li>
-        <pre class="prettyprint">
-           <code>XAConnectionFactory cf = (XAConnectionFactory) initialContext.lookup("/XAConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS XAConnection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createXAConnection();</code>
-        </pre>
-
-        <li>We Start the connection</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We create a JMS XASession</li>
-        <pre class="prettyprint">
-          <code>XASession xaSession = connection.createXASession();</code>
-       </pre>
-
-        <li>We create a normal session</li>
-        <pre class="prettyprint">
-          <code>Session normalSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-       </pre>
-
-        <li>We create a normal Message Consumer</li>
-        <pre class="prettyprint">
-           <code>
-           MessageConsumer normalConsumer = normalSession.createConsumer(queue);
-           normalConsumer.setMessageListener(new SimpleMessageListener());
-           </code>
-       </pre>
-
-        <li>We get the JMS Session</li>
-        <pre class="prettyprint">
-          <code>Session session = xaSession.getSession();</code>
-       </pre>
-
-        <li>We create a message producer</li>
-        <pre class="prettyprint">
-          <code>MessageProducer producer = session.createProducer(queue);</code>
-       </pre>
-
-        <li>We create two Text Messages</li>
-        <pre class="prettyprint">
-          <code>
-          TextMessage helloMessage = session.createTextMessage("hello");
-          TextMessage worldMessage = session.createTextMessage("world");
-          </code>
-       </pre>
-
-        <li>We create a transaction</li>
-        <pre class="prettyprint">
-          <code>Xid xid1 = new XidImpl("xa-example1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());</code>
-       </pre>
-
-        <li>We get the JMS XAResource</li>
-        <pre class="prettyprint">
-          <code>XAResource xaRes = xaSession.getXAResource();</code>
-       </pre>
-
-        <li>We begin the Transaction work</li>
-        <pre class="prettyprint">
-          <code>xaRes.start(xid1, XAResource.TMNOFLAGS);</code>
-       </pre>
-
-        <li>We do work, sending two messages.</li>
-        <pre class="prettyprint">
-          <code>
-          producer.send(helloMessage);
-          producer.send(worldMessage);
-          </code>
-       </pre>
-
-        <li>We check the result, it should receive none!</li>
-        <pre class="prettyprint">
-          <code>checkNoMessageReceived();</code>
-       </pre>
-
-        <li>We stop the work</li>
-        <pre class="prettyprint">
-          <code>xaRes.end(xid1, XAResource.TMSUCCESS);</code>
-       </pre>
-
-        <li>We prepare</li>
-        <pre class="prettyprint">
-          <code>xaRes.prepare(xid1);</code>
-       </pre>
-
-        <li>We roll back the transaction </li>
-        <pre class="prettyprint">
-          <code>xaRes.rollback(xid1);</code>
-       </pre>
-
-        <li>We check no messages should be received! </li>
-        <pre class="prettyprint">
-          <code>checkNoMessageReceived();</code>
-       </pre>
-
-        <li>We create another transaction</li>
-        <pre class="prettyprint">
-          <code>Xid xid2 = new XidImpl("xa-example2".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());</code>
-       </pre>
-
-        <li>We start the transaction</li>
-        <pre class="prettyprint">
-          <code>xaRes.start(xid2, XAResource.TMNOFLAGS);</code>
-       </pre>
-
-        <li>We re-send those messages</li>
-        <pre class="prettyprint">
-           <code>
-           producer.send(helloMessage);
-           producer.send(worldMessage);
-           </code>
-       </pre>
-
-        <li>We stop the work</li>
-        <pre class="prettyprint">
-          <code>xaRes.end(xid2, XAResource.TMSUCCESS);</code>
-       </pre>
-
-        <li>We prepare</li>
-        <pre class="prettyprint">
-          <code>xaRes.prepare(xid2);</code>
-       </pre>
-
-        <li>We check that no messages should be received at this moment</li>
-        <pre class="prettyprint">
-          <code>checkNoMessageReceived();</code>
-       </pre>
-
-        <li>We commit!</li>
-        <pre class="prettyprint">
-          <code>xaRes.commit(xid2, false);</code>
-       </pre>
-
-        <li>We check that all messages are received.</li>
-        <pre class="prettyprint">
-          <code>checkAllMessageReceived();</code>
-       </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java b/examples/broker-features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
deleted file mode 100644
index 4dbe2f8..0000000
--- a/examples/broker-features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
+++ /dev/null
@@ -1,184 +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 org.apache.activemq.artemis.utils.Base64;
-
-import javax.transaction.xa.Xid;
-
-public class DummyXid implements Xid {
-
-   private static final long serialVersionUID = 407053232840068514L;
-
-   private final byte[] branchQualifier;
-
-   private final int formatId;
-
-   private final byte[] globalTransactionId;
-
-   private int hash;
-
-   private boolean hashCalculated;
-
-   // Static --------------------------------------------------------
-
-   public static String toBase64String(final Xid xid) {
-      return Base64.encodeBytes(DummyXid.toByteArray(xid));
-   }
-
-   private static byte[] toByteArray(final Xid xid) {
-      byte[] branchQualifier = xid.getBranchQualifier();
-      byte[] globalTransactionId = xid.getGlobalTransactionId();
-      int formatId = xid.getFormatId();
-
-      byte[] hashBytes = new byte[branchQualifier.length + globalTransactionId.length + 4];
-      System.arraycopy(branchQualifier, 0, hashBytes, 0, branchQualifier.length);
-      System.arraycopy(globalTransactionId, 0, hashBytes, branchQualifier.length, globalTransactionId.length);
-      byte[] intBytes = new byte[4];
-      for (int i = 0; i < 4; i++) {
-         intBytes[i] = (byte) ((formatId >> i * 8) % 0xFF);
-      }
-      System.arraycopy(intBytes, 0, hashBytes, branchQualifier.length + globalTransactionId.length, 4);
-      return hashBytes;
-   }
-
-   // Constructors --------------------------------------------------
-
-   /**
-    * Standard constructor
-    *
-    * @param branchQualifier
-    * @param formatId
-    * @param globalTransactionId
-    */
-   public DummyXid(final byte[] branchQualifier, final int formatId, final byte[] globalTransactionId) {
-      this.branchQualifier = branchQualifier;
-      this.formatId = formatId;
-      this.globalTransactionId = globalTransactionId;
-   }
-
-   /**
-    * Copy constructor
-    *
-    * @param other
-    */
-   public DummyXid(final Xid other) {
-      branchQualifier = copyBytes(other.getBranchQualifier());
-      formatId = other.getFormatId();
-      globalTransactionId = copyBytes(other.getGlobalTransactionId());
-   }
-
-   // Xid implementation ------------------------------------------------------------------
-
-   public byte[] getBranchQualifier() {
-      return branchQualifier;
-   }
-
-   public int getFormatId() {
-      return formatId;
-   }
-
-   public byte[] getGlobalTransactionId() {
-      return globalTransactionId;
-   }
-
-   // Public -------------------------------------------------------------------------------
-
-   @Override
-   public int hashCode() {
-      if (!hashCalculated) {
-         calcHash();
-      }
-      return hash;
-   }
-
-   @Override
-   public boolean equals(final Object other) {
-      if (this == other) {
-         return true;
-      }
-      if (!(other instanceof Xid)) {
-         return false;
-      }
-      Xid xother = (Xid) other;
-      if (xother.getFormatId() != formatId) {
-         return false;
-      }
-      if (xother.getBranchQualifier().length != branchQualifier.length) {
-         return false;
-      }
-      if (xother.getGlobalTransactionId().length != globalTransactionId.length) {
-         return false;
-      }
-      for (int i = 0; i < branchQualifier.length; i++) {
-         byte[] otherBQ = xother.getBranchQualifier();
-         if (branchQualifier[i] != otherBQ[i]) {
-            return false;
-         }
-      }
-      for (int i = 0; i < globalTransactionId.length; i++) {
-         byte[] otherGtx = xother.getGlobalTransactionId();
-         if (globalTransactionId[i] != otherGtx[i]) {
-            return false;
-         }
-      }
-      return true;
-   }
-
-   @Override
-   public String toString() {
-      return "XidImpl (" + System.identityHashCode(this) +
-         " bq:" +
-         stringRep(branchQualifier) +
-         " formatID:" +
-         formatId +
-         " gtxid:" +
-         stringRep(globalTransactionId);
-   }
-
-   // Private -------------------------------------------------------------------------------
-
-   private String stringRep(final byte[] bytes) {
-      StringBuilder buff = new StringBuilder();
-      for (int i = 0; i < bytes.length; i++) {
-         byte b = bytes[i];
-
-         buff.append(b);
-
-         if (i != bytes.length - 1) {
-            buff.append('.');
-         }
-      }
-
-      return buff.toString();
-   }
-
-   private void calcHash() {
-      byte[] hashBytes = DummyXid.toByteArray(this);
-      String s = new String(hashBytes);
-      hash = s.hashCode();
-      hashCalculated = true;
-   }
-
-   private byte[] copyBytes(final byte[] other) {
-      byte[] bytes = new byte[other.length];
-
-      System.arraycopy(other, 0, bytes, 0, other.length);
-
-      return bytes;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java b/examples/broker-features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java
deleted file mode 100644
index fd87f61..0000000
--- a/examples/broker-features/standard/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java
+++ /dev/null
@@ -1,191 +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.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.jms.XAConnection;
-import javax.jms.XAConnectionFactory;
-import javax.jms.XASession;
-import javax.naming.InitialContext;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.activemq.artemis.utils.UUIDGenerator;
-
-/**
- * A simple JMS example showing the usage of XA support in JMS.
- */
-public class XASendExample {
-
-   public static void main(final String[] args) throws Exception {
-      AtomicBoolean result = new AtomicBoolean(true);
-      final ArrayList<String> receiveHolder = new ArrayList<String>();
-      XAConnection connection = null;
-      InitialContext initialContext = null;
-      try {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
-
-         // Step 2. Lookup on the queue
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-
-         // Step 3. Perform a lookup on the XA Connection Factory
-         XAConnectionFactory cf = (XAConnectionFactory) initialContext.lookup("XAConnectionFactory");
-
-         // Step 4.Create a JMS XAConnection
-         connection = cf.createXAConnection();
-
-         // Step 5. Start the connection
-         connection.start();
-
-         // Step 6. Create a JMS XASession
-         XASession xaSession = connection.createXASession();
-
-         // Step 7. Create a normal session
-         Session normalSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 8. Create a normal Message Consumer
-         MessageConsumer normalConsumer = normalSession.createConsumer(queue);
-         normalConsumer.setMessageListener(new SimpleMessageListener(receiveHolder, result));
-
-         // Step 9. Get the JMS Session
-         Session session = xaSession.getSession();
-
-         // Step 10. Create a message producer
-         MessageProducer producer = session.createProducer(queue);
-
-         // Step 11. Create two Text Messages
-         TextMessage helloMessage = session.createTextMessage("hello");
-         TextMessage worldMessage = session.createTextMessage("world");
-
-         // Step 12. create a transaction
-         Xid xid1 = new DummyXid("xa-example1".getBytes(StandardCharsets.UTF_8), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
-
-         // Step 13. Get the JMS XAResource
-         XAResource xaRes = xaSession.getXAResource();
-
-         // Step 14. Begin the Transaction work
-         xaRes.start(xid1, XAResource.TMNOFLAGS);
-
-         // Step 15. do work, sending two messages.
-         producer.send(helloMessage);
-         producer.send(worldMessage);
-
-         Thread.sleep(2000);
-
-         // Step 16. Check the result, it should receive none!
-         checkNoMessageReceived(receiveHolder);
-
-         // Step 17. Stop the work
-         xaRes.end(xid1, XAResource.TMSUCCESS);
-
-         // Step 18. Prepare
-         xaRes.prepare(xid1);
-
-         // Step 19. Roll back the transaction
-         xaRes.rollback(xid1);
-
-         // Step 20. No messages should be received!
-         checkNoMessageReceived(receiveHolder);
-
-         // Step 21. Create another transaction
-         Xid xid2 = new DummyXid("xa-example2".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());
-
-         // Step 22. Start the transaction
-         xaRes.start(xid2, XAResource.TMNOFLAGS);
-
-         // Step 23. Re-send those messages
-         producer.send(helloMessage);
-         producer.send(worldMessage);
-
-         // Step 24. Stop the work
-         xaRes.end(xid2, XAResource.TMSUCCESS);
-
-         // Step 25. Prepare
-         xaRes.prepare(xid2);
-
-         // Step 26. No messages should be received at this moment
-         checkNoMessageReceived(receiveHolder);
-
-         // Step 27. Commit!
-         xaRes.commit(xid2, false);
-
-         Thread.sleep(2000);
-
-         // Step 28. Check the result, all message received
-         checkAllMessageReceived(receiveHolder);
-
-         if (!result.get())
-            throw new IllegalStateException();
-      }
-      finally {
-         // Step 29. Be sure to close our JMS resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-
-   private static void checkAllMessageReceived(ArrayList<String> receiveHolder) {
-      if (receiveHolder.size() != 2) {
-         throw new IllegalStateException("Number of messages received not correct ! -- " + receiveHolder.size());
-      }
-      receiveHolder.clear();
-   }
-
-   private static void checkNoMessageReceived(ArrayList<String> receiveHolder) {
-      if (receiveHolder.size() > 0) {
-         throw new IllegalStateException("Message received, wrong!");
-      }
-      receiveHolder.clear();
-   }
-}
-
-class SimpleMessageListener implements MessageListener {
-
-   ArrayList<String> receiveHolder;
-   AtomicBoolean result;
-
-   public SimpleMessageListener(ArrayList<String> receiveHolder, AtomicBoolean result) {
-      this.receiveHolder = receiveHolder;
-      this.result = result;
-   }
-
-   public void onMessage(final Message message) {
-      try {
-         System.out.println("Message received: " + message);
-         receiveHolder.add(((TextMessage) message).getText());
-      }
-      catch (JMSException e) {
-         result.set(false);
-         e.printStackTrace();
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/xa-send/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/xa-send/src/main/resources/jndi.properties b/examples/broker-features/standard/xa-send/src/main/resources/jndi.properties
deleted file mode 100644
index 77561f7..0000000
--- a/examples/broker-features/standard/xa-send/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,21 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-connectionFactory.XAConnectionFactory=tcp://localhost:61616?type=XA_CF
-queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/sub-modules/aerogear/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/sub-modules/aerogear/pom.xml b/examples/broker-features/sub-modules/aerogear/pom.xml
deleted file mode 100644
index c522d78..0000000
--- a/examples/broker-features/sub-modules/aerogear/pom.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-<?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.modules</groupId>
-      <artifactId>broker-modules</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <properties>
-      <endpoint/>
-      <applicationid/>
-      <mastersecret/>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <artifactId>aerogear</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS AeroGear Example</name>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-cli</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>
-                     <!-- this list was extracted from mvn dependency:tree on integration/aerogear -->
-                     <libList>
-                        <param>org.apache.activemq:artemis-aerogear-integration:${project.version}</param>
-                        <param>org.jboss.aerogear:unifiedpush-java-client:1.0.0</param>
-                        <param>net.iharder:base64:2.3.8</param>
-                        <param>com.fasterxml.jackson.core:jackson-annotations:2.3.0</param>
-                        <param>com.fasterxml.jackson.core:jackson-core:2.3.0</param>
-                        <param>org.jboss.resteasy:resteasy-jackson-provider:2.3.2.Final</param>
-                        <param>org.codehaus.jackson:jackson-core-asl:1.8.5</param>
-                        <param>org.codehaus.jackson:jackson-mapper-asl:1.8.5</param>
-                        <param>org.codehaus.jackson:jackson-jaxrs:1.8.5</param>
-                        <param>org.codehaus.jackson:jackson-xc:1.8.5</param>
-                     </libList>
-                  </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.AerogearExample</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.modules</groupId>
-                  <artifactId>aerogear</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/sub-modules/aerogear/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/sub-modules/aerogear/readme.html b/examples/broker-features/sub-modules/aerogear/readme.html
deleted file mode 100644
index 3534a4c..0000000
--- a/examples/broker-features/sub-modules/aerogear/readme.html
+++ /dev/null
@@ -1,157 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS AeroGear 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 AeroGear 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 how you can send a message to a mobile device by leveraging <a href="http://aerogear.org/push/">AeroGears push</a> technology which
-         provides support for different push notification technologies like Google Cloud Messaging, Apple's APNs or
-         Mozilla's SimplePush.</p>
-
-     <p>For this example you will need an AeroGear Application running somewhere, a good way to do this is to deploy the
-        Push Application on <href a="">openshift</href>, you can follow the AeroGear Push 0.X Quickstart.</p>
-
-     <p>Once you have created your AeroGear Push Application you can create a mobile application. Simply log into the application
-     on the web and create a new mobile application by clicking the 'create' button. Once created you will see an application id
-     and a master secret, you will need the later to run the example.</p>
-
-     <p>lastly you will need to create a variant. For this example we will be using Android so you will need to create a google project,
-     this <a href="http://aerogear.org/docs/guides/aerogear-push-android/google-setup/">article</a> explains how to do this.
-     Once created click on your app then click 'add' to add a variant. choose 'google cloud messaging', enter your google
-         API key and the project number from your google project and click create</p>
-
-     <p>Now before we run the example we need a mobile application to receive it. Writing a mobile app is beyond the scope
-     of this example but for testing purposes we have supplied an Android app you can use, simply install on your android phone.
-     It can be found <a href="http://downloads.jboss.org.apache.activemq/ActiveMQAeroGear.apk">here</a>. For a more in depth mobile
-         app example visit the AeroGear site.</p>
-
-     <p>Once you have installed the mobile app you will need to configure the following:</p>
-     <p>AeroGear Unified Push URL : This is the URL where your aerogear server is running, something like http://myapp-mydomain.rhcloud.com
-        AeroGear Variant ID : This is the ID of the variant you created in AeroGear
-        AeroGear Variant Secret : This is the secret for your variant
-        GCM Sender ID : this is the Google project Number you created on Google
-        Variant : you can use this to target messages if needed.
-     </p>
-
-     <p>Once you set all these correctly you should get a message saying your mobile app is registered, if you log into
-         your AeroGear app you should see it registered with the variant.</p>
-
-
-     <p>Now to run the example simply run the following command
-         'mvn -Dendpoint=my aerogear url -Dapplicationid=my application id -Dmastersecret=my master secret -Djsse.enableSNIExtension=false clean verify'.
-     If you arent using java 7 you can omit the 'jsse.enableSNIExtension=false'</p>
-
-   <p>You should see something like this in your ActiveMQServer</p>
-     <ol>
-        <pre class="prettyprint">
-           <code>
-   Dec 04, 2013 3:25:39 PM org.jboss.aerogear.unifiedpush.SenderClient submitPayload
-   INFO: HTTP Response code from UnifiedPush Server: 302
-   Dec 04, 2013 3:25:39 PM org.jboss.aerogear.unifiedpush.SenderClient submitPayload
-   INFO: Performing redirect to 'https://myapp-mydomain.rhcloud.com/rest/sender/'
-   Dec 04, 2013 3:25:40 PM org.jboss.aerogear.unifiedpush.SenderClient submitPayload
-   INFO: HTTP Response code from UnifiedPush Server: 200
-           </code>
-        </pre>
-     </ol>
-   <p>And on your mobile app you should see a message from ActiveMQ</p>
-
-  <p>Now lets look a bit more closely at the configuration in broker.xml</p>
-     <ol>
-        <pre class="prettyprint">
-           <code>
-   &lt;queues>
-       &lt;queue name="jms.queue.exampleQueue">
-           &lt;address>jms.queue.exampleQueue&lt;/address>
-       &lt;/queue>
-   &lt;/queues>
-
-   &lt;connector-services>
-       &lt;connector-service name="aerogear-connector">
-           &lt;factory-class>org.apache.activemq.integration.aerogear.AeroGearConnectorServiceFactory&lt;/factory-class>
-           &lt;param key="endpoint" value="${endpoint}"/>
-           &lt;param key="queue" value="jms.queue.exampleQueue"/>
-           &lt;param key="application-id" value="${applicationid}"/>
-           &lt;param key="master-secret" value="${mastersecret}"/>
-       &lt;/connector-service>
-   &lt;/connector-services>
-           </code>
-        </pre>
-     </ol>
-  <p>Firstly you will see that we have to create a core queue so it is available when the connector is started, the following are mandatory parameters:</p>
-  <ol>
-      <li>endpoint - The endpoint or URL of you AeroGear application</li>
-      <li>queue - The name of the queue to consume from</li>
-      <li>application-id - The application id of your mobile application in AeroGear</li>
-      <li>master-secret - the secret of your mobile application in AeroGear</li>
-  </ol>
-  <p>as well as those there are also the following optional parameters</p>
-  <ol>
-      <li>ttl - The time to live for the message once AeroGear receives it</li>
-      <li>badge - The badge the mobile app should use for the notification</li>
-      <li>sound - The sound the mobile app should use for the notification</li>
-      <li>filter - A message filter(selector) to use on the connector</li>
-      <li>retry-interval - If an error occurs on send, how long before we try again</li>
-      <li>retry-attempts - How many times we should try to reconnect after an error</li>
-      <li>variants - A comma separated list of variants that should get the message</li>
-      <li>aliases - A list of aliases that should get the message</li>
-      <li>device-types - A list of device types that should get the message</li>
-  </ol>
-  <p>More in depth explanations of these can be found in the AeroGear docs.</p>
-  <p>Now lets look at a snippet of code we used to send the message for our JMS client</p>
-  <pre class="prettyprint">
-      <code>
-  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
-  Message message = session.createMessage();
-
-  message.setStringProperty("AEROGEAR_ALERT", "Hello this is a notification from ActiveMQ");
-
-  producer.send(message);
-      </code>
-  </pre>
-  <p> The most important thing here is string propert we have set on the message, i.e. 'AEROGEAR_ALERT'. This is the
-      actual alert that is sent via AeroGear</p>
-  <p>As well as the alert itself you can override any of the above optional parameters in the same fashionby using the
-      following propert names: AEROGEAR_SOUND,AEROGEAR_BADGE,AEROGEAR_TTL,AEROGEAR_VARIANTS,AEROGEAR_ALIASES and AEROGEAR_DEVICE_TYPES</p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/sub-modules/aerogear/src/main/java/org/apache/activemq/artemis/jms/example/AerogearExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/sub-modules/aerogear/src/main/java/org/apache/activemq/artemis/jms/example/AerogearExample.java b/examples/broker-features/sub-modules/aerogear/src/main/java/org/apache/activemq/artemis/jms/example/AerogearExample.java
deleted file mode 100644
index b412d87..0000000
--- a/examples/broker-features/sub-modules/aerogear/src/main/java/org/apache/activemq/artemis/jms/example/AerogearExample.java
+++ /dev/null
@@ -1,77 +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.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-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 AerogearExample {
-
-   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
-         Message message = session.createMessage();
-
-         message.setStringProperty("AEROGEAR_ALERT", "Hello this is a notification from ActiveMQ");
-
-         producer.send(message);
-
-         System.out.println("Sent message");
-
-         System.out.println("now check your mobile app and press enter");
-
-         System.in.read();
-      }
-      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/6b17d966/examples/broker-features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 1095761..0000000
--- a/examples/broker-features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?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>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- We need to create a core queue for the JMS queue explicitly because the connector will be deployed
-       before the JMS queue is deployed, so the first time, it otherwise won't find the queue -->
-      <queues>
-         <queue name="jms.queue.exampleQueue">
-            <address>jms.queue.exampleQueue</address>
-         </queue>
-      </queues>
-
-      <connector-services>
-         <connector-service name="aerogear-connector">
-            <factory-class>org.apache.activemq.artemis.integration.aerogear.AeroGearConnectorServiceFactory</factory-class>
-            <param key="endpoint" value="${endpoint}"/>
-            <param key="queue" value="jms.queue.exampleQueue"/>
-            <param key="application-id" value="${applicationid}"/>
-            <param key="master-secret" value="${mastersecret}"/>
-         </connector-service>
-      </connector-services>
-
-      <!-- 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-settings>
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/sub-modules/aerogear/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/sub-modules/aerogear/src/main/resources/jndi.properties b/examples/broker-features/sub-modules/aerogear/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/sub-modules/aerogear/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/sub-modules/artemis-ra-rar/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/sub-modules/artemis-ra-rar/pom.xml b/examples/broker-features/sub-modules/artemis-ra-rar/pom.xml
deleted file mode 100644
index cae1386..0000000
--- a/examples/broker-features/sub-modules/artemis-ra-rar/pom.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-<?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.modules</groupId>
-      <artifactId>broker-modules</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>artemis-rar</artifactId>
-   <packaging>rar</packaging>
-   <name>ActiveMQ Artemis JMS RA</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>
-         <exclusions>
-            <exclusion>
-               <groupId>org.apache.activemq</groupId>
-               <artifactId>artemis-core-client</artifactId>
-            </exclusion>
-            <exclusion>
-               <groupId>org.apache.activemq</groupId>
-               <artifactId>artemis-jms-client</artifactId>
-            </exclusion>
-            <exclusion>
-              <groupId>org.apache.geronimo.specs</groupId>
-              <artifactId>geronimo-jms_2.0_spec</artifactId>
-            </exclusion>
-            <exclusion>
-               <groupId>org.apache.geronimo.specs</groupId>
-               <artifactId>geronimo-ejb_3.0_spec</artifactId>
-            </exclusion>
-         </exclusions>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-ra</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-jms-server</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-core-client</artifactId>
-         <version>${project.version}</version>
-         <exclusions>
-            <exclusion>
-               <groupId>org.apache.activemq</groupId>
-               <artifactId>artemis-core-client</artifactId>
-            </exclusion>
-         </exclusions>
-      </dependency>
-      <dependency>
-         <groupId>io.netty</groupId>
-         <artifactId>netty-all</artifactId>
-      </dependency>
-   </dependencies>
-
-   <build>
-      <plugins>
-         <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-rar-plugin</artifactId>
-            <configuration>
-               <raXmlFile>src/main/resources/ra.xml</raXmlFile>
-            </configuration>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/sub-modules/artemis-ra-rar/src/main/resources/ra.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/sub-modules/artemis-ra-rar/src/main/resources/ra.xml b/examples/broker-features/sub-modules/artemis-ra-rar/src/main/resources/ra.xml
deleted file mode 100644
index db571a3..0000000
--- a/examples/broker-features/sub-modules/artemis-ra-rar/src/main/resources/ra.xml
+++ /dev/null
@@ -1,308 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- $Id: ra.xml 76819 2008-08-08 11:04:20Z jesper.pedersen $ -->
-
-<connector xmlns="http://java.sun.com/xml/ns/j2ee"
-           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
-           http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
-           version="1.5">
-
-   <description>ActiveMQ Artemis 2.0 Resource Adapter</description>
-   <display-name>ActiveMQ Artemis 2.0 Resource Adapter</display-name>
-
-   <vendor-name>Apache Software Foundation</vendor-name>
-   <eis-type>JMS 1.1 Server</eis-type>
-   <resourceadapter-version>1.0</resourceadapter-version>
-
-   <license>
-      <description>
-         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.
-      </description>
-      <license-required>true</license-required>
-   </license>
-
-   <resourceadapter>
-      <resourceadapter-class>org.apache.activemq.artemis.ra.ActiveMQResourceAdapter</resourceadapter-class>
-      <config-property>
-         <description>
-            The transport type. Multiple connectors can be configured by using a comma separated list,
-            i.e. org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory,org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory.
-         </description>
-         <config-property-name>ConnectorClassName</config-property-name>
-         <config-property-type>java.lang.String</config-property-type>
-         <config-property-value>org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory</config-property-value>
-      </config-property>
-      <config-property>
-         <description>The transport configuration. These values must be in the form of key=val;key=val;,
-            if multiple connectors are used then each set must be separated by a comma i.e. host=host1;port=61616,host=host2;port=61617.
-            Each set of params maps to the connector classname specified.
-         </description>
-         <config-property-name>ConnectionParameters</config-property-name>
-         <config-property-type>java.lang.String</config-property-type>
-         <config-property-value>server-id=0</config-property-value>
-      </config-property>
-      <!--
-      <config-property>
-        <description>Does we support HA</description>
-        <config-property-name>HA</config-property-name>
-        <config-property-type>java.lang.Boolean</config-property-type>
-        <config-property-value>false</config-property-value>
-      </config-property>
-      <config-property>
-        <description>The method to use for locating the transactionmanager</description>
-        <config-property-name>TransactionManagerLocatorMethod</config-property-name>
-        <config-property-type>java.lang.String</config-property-type>
-        <config-property-value>getTm</config-property-value>
-      </config-property>
-      <config-property>
-        <description>Use A local Transaction instead of XA?</description>
-        <config-property-name>UseLocalTx</config-property-name>
-        <config-property-type>java.lang.Boolean</config-property-type>
-        <config-property-value>false</config-property-value>
-      </config-property>
-      <config-property>
-        <description>The user name used to login to the JMS server</description>
-        <config-property-name>UserName</config-property-name>
-        <config-property-type>java.lang.String</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The password used to login to the JMS server</description>
-        <config-property-name>Password</config-property-name>
-        <config-property-type>java.lang.String</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The jndi params to use to look up the jms resources if local jndi is not to be used</description>
-        <config-property-name>JndiParams</config-property-name>
-        <config-property-type>java.lang.String</config-property-type>
-        <config-property-value>java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory;java.naming.provider.url=jnp://localhost:1199;java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces</config-property-value>
-      </config-property>
-      <config-property>
-        <description>The jGroups File name</description>
-        <config-property-name>JgroupsFile</config-property-name>
-        <config-property-type>java.lang.String</config-property-type>
-        <config-property-value>jgroups.xml</config-property-value>
-      </config-property>
-      <config-property>
-        <description>The name of the channel used on this configuration</description>
-        <config-property-name>JgroupsChannelName</config-property-name>
-        <config-property-type>java.lang.Integer</config-property-type>
-        <config-property-value>my-channel</config-property-value>
-      </config-property>
-      <config-property>
-        <description>The discovery group address</description>
-        <config-property-name>DiscoveryAddress</config-property-name>
-        <config-property-type>java.lang.String</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The discovery group port</description>
-        <config-property-name>DiscoveryPort</config-property-name>
-        <config-property-type>java.lang.Integer</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The discovery refresh timeout</description>
-        <config-property-name>DiscoveryRefreshTimeout</config-property-name>
-        <config-property-type>java.lang.Long</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The discovery initial wait timeout</description>
-        <config-property-name>DiscoveryInitialWaitTimeout</config-property-name>
-        <config-property-type>java.lang.Long</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The load balancing policy class name</description>
-        <config-property-name>LoadBalancingPolicyClassName</config-property-name>
-        <config-property-type>java.lang.String</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The client failure check period</description>
-        <config-property-name>ClientFailureCheckPeriod</config-property-name>
-        <config-property-type>java.lang.Long</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The connection TTL</description>
-        <config-property-name>ConnectionTTL</config-property-name>
-        <config-property-type>java.lang.Long</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The call timeout</description>
-        <config-property-name>CallTimeout</config-property-name>
-        <config-property-type>java.lang.Long</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The dups ok batch size</description>
-        <config-property-name>DupsOKBatchSize</config-property-name>
-        <config-property-type>java.lang.Integer</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The transaction batch size</description>
-        <config-property-name>TransactionBatchSize</config-property-name>
-        <config-property-type>java.lang.Integer</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The consumer window size</description>
-        <config-property-name>ConsumerWindowSize</config-property-name>
-        <config-property-type>java.lang.Integer</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The consumer max rate</description>
-        <config-property-name>ConsumerMaxRate</config-property-name>
-        <config-property-type>java.lang.Integer</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The confirmation window size</description>
-        <config-property-name>ConfirmationWindowSize</config-property-name>
-        <config-property-type>java.lang.Integer</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The producer max rate</description>
-        <config-property-name>ProducerMaxRate</config-property-name>
-        <config-property-type>java.lang.Integer</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The min large message size</description>
-        <config-property-name>MinLargeMessageSize</config-property-name>
-        <config-property-type>java.lang.Integer</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The block on acknowledge</description>
-        <config-property-name>BlockOnAcknowledge</config-property-name>
-        <config-property-type>java.lang.Boolean</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The block on non durable send</description>
-        <config-property-name>BlockOnNonDurableSend</config-property-name>
-        <config-property-type>java.lang.Boolean</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The block on durable send</description>
-        <config-property-name>BlockOnDurableSend</config-property-name>
-        <config-property-type>java.lang.Boolean</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The auto group</description>
-        <config-property-name>AutoGroup</config-property-name>
-        <config-property-type>java.lang.Boolean</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The max connections</description>
-        <config-property-type>java.lang.Integer</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The pre acknowledge</description>
-        <config-property-name>PreAcknowledge</config-property-name>
-        <config-property-type>java.lang.Boolean</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The retry interval</description>
-        <config-property-name>RetryInterval</config-property-name>
-        <config-property-type>java.lang.Long</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The retry interval multiplier</description>
-        <config-property-name>RetryIntervalMultiplier</config-property-name>
-        <config-property-type>java.lang.Double</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The client id</description>
-        <config-property-name>ClientID</config-property-name>
-        <config-property-type>java.lang.String</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>Whether the password is cleartext or encrypted, default false</description>
-        <config-property-name>UseMaskedPassword</config-property-name>
-        <config-property-type>java.lang.Boolean</config-property-type>
-        <config-property-value></config-property-value>
-      </config-property>
-      <config-property>
-        <description>The class definition (full qualified name and its properties) used to encrypt the password</description>
-        <config-property-name>PasswordCodec</config-property-name>
-        <config-property-type>java.lang.String</config-property-type>
-        <config-property-value>org.apache.activemq.artemis.utils.DefaultSensitiveStringCodec;key=clusterpassword;algorithm=something</config-property-value>
-      </config-property>-->
-
-      <outbound-resourceadapter>
-         <connection-definition>
-            <managedconnectionfactory-class>org.apache.activemq.artemis.ra.ActiveMQRAManagedConnectionFactory</managedconnectionfactory-class>
-
-            <config-property>
-               <description>The default session type</description>
-               <config-property-name>SessionDefaultType</config-property-name>
-               <config-property-type>java.lang.String</config-property-type>
-               <config-property-value>javax.jms.Queue</config-property-value>
-            </config-property>
-            <config-property>
-               <description>Try to obtain a lock within specified number of seconds; less than or equal to 0 disable this functionality</description>
-               <config-property-name>UseTryLock</config-property-name>
-               <config-property-type>java.lang.Integer</config-property-type>
-               <config-property-value>0</config-property-value>
-            </config-property>
-
-            <connectionfactory-interface>org.apache.activemq.artemis.ra.ActiveMQRAConnectionFactory</connectionfactory-interface>
-            <connectionfactory-impl-class>org.apache.activemq.artemis.ra.ActiveMQRAConnectionFactoryImpl</connectionfactory-impl-class>
-            <connection-interface>javax.jms.Session</connection-interface>
-            <connection-impl-class>org.apache.activemq.artemis.ra.ActiveMQRASession</connection-impl-class>
-         </connection-definition>
-         <transaction-support>XATransaction</transaction-support>
-         <authentication-mechanism>
-            <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
-            <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
-         </authentication-mechanism>
-         <reauthentication-support>false</reauthentication-support>
-      </outbound-resourceadapter>
-
-      <inbound-resourceadapter>
-         <messageadapter>
-            <messagelistener>
-               <messagelistener-type>javax.jms.MessageListener</messagelistener-type>
-               <activationspec>
-                  <activationspec-class>org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec</activationspec-class>
-                  <required-config-property>
-                      <config-property-name>destination</config-property-name>
-                  </required-config-property>
-               </activationspec>
-            </messagelistener>
-         </messageadapter>
-      </inbound-resourceadapter>
-
-   </resourceadapter>
-</connector>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/sub-modules/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/sub-modules/pom.xml b/examples/broker-features/sub-modules/pom.xml
deleted file mode 100644
index aeeae3c..0000000
--- a/examples/broker-features/sub-modules/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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.clustered</groupId>
-      <artifactId>broker-features</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <groupId>org.apache.activemq.examples.modules</groupId>
-   <artifactId>broker-modules</artifactId>
-   <packaging>pom</packaging>
-   <name>ActiveMQ Artemis Modules Examples</name>
-
-   <!-- Properties -->
-   <properties>
-      <!--
-      Explicitly declaring the source encoding eliminates the following
-      message: [WARNING] Using platform encoding (UTF-8 actually) to copy
-      filtered resources, i.e. build is platform dependent!
-      -->
-      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-      <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
-   </properties>
-
-   <profiles>
-      <!-- The modules examples need to be executed manually,
-           for that reason we won't provide an examples profile here to execute all of them at once -->
-      <profile>
-         <id>release</id>
-         <modules>
-            <module>aerogear</module>
-            <module>artemis-ra-rar</module>
-            <module>vertx</module>
-         </modules>
-      </profile>
-   </profiles>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/sub-modules/vertx/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/sub-modules/vertx/pom.xml b/examples/broker-features/sub-modules/vertx/pom.xml
deleted file mode 100644
index e38a299..0000000
--- a/examples/broker-features/sub-modules/vertx/pom.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-<?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.modules</groupId>
-      <artifactId>broker-modules</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>artemis-vertx-example</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis Vert.x Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-      <vertx.version>2.1.2</vertx.version>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-server</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-core-client</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-commons</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>io.netty</groupId>
-         <artifactId>netty-all</artifactId>
-         <version>${netty.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
-      <dependency>
-         <groupId>io.vertx</groupId>
-         <artifactId>vertx-core</artifactId>
-         <version>${vertx.version}</version>
-         <scope>provided</scope>
-      </dependency>
-      <dependency>
-         <groupId>io.vertx</groupId>
-         <artifactId>vertx-platform</artifactId>
-         <version>${vertx.version}</version>
-         <scope>provided</scope>
-      </dependency>
-      <dependency>
-         <groupId>io.vertx</groupId>
-         <artifactId>vertx-hazelcast</artifactId>
-         <version>${vertx.version}</version>
-         <scope>provided</scope>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-vertx-integration</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-
-   </dependencies>
-   <build>
-      <plugins>
-         <plugin>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-maven-plugin</artifactId>
-            <executions>
-               <execution>
-                  <id>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <libList>
-                        <arg>org.apache.activemq.examples.modules:artemis-vertx-example:${project.version}</arg>
-                     </libList>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server0</location>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.core.example.VertxConnectorExample</clientClass>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.modules</groupId>
-                  <artifactId>artemis-vertx-example</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/sub-modules/vertx/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/sub-modules/vertx/readme.html b/examples/broker-features/sub-modules/vertx/readme.html
deleted file mode 100644
index e8f053a..0000000
--- a/examples/broker-features/sub-modules/vertx/readme.html
+++ /dev/null
@@ -1,103 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Vert.x Connector Service 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>Vert.x Connector Service Example</h1>
-
-     <p>This example shows you how to configure ActiveMQ Artemis to use the Vert.x Connector Service.</p>
-
-     <p>ActiveMQ Artemis supports 2 types of Vert.x connector, incoming and outgoing.
-     Incoming connector consumes from Vert.x event bus and forwards to a configurable address.
-     Outgoing connector consumes from a configurable address and forwards to a configurable Vert.x event bus.
-     </p>
-
-     <p>In this example, an incoming connector and an outgoing connector are configured. A simple java Verticle
-     is deployed. The verticle registers a message handler on the outgoing connector's address ("outgoing.vertx.address").
-     A String message is sent to Vert.x event bus on the incoming connector's address("incoming.vertx.address").
-     The message then will be forwarded to a ActiveMQ Artemis queue by the incoming connector. The outgoing connector listens to
-     the ActiveMQ Artemis queue and forwards the message from ActiveMQ Artemis to Vert.x event bus on the outgoing connector's address.
-     The verticle finally receives the message from it's event bus.</p>
-
-     <p>For more information on Vert.x concept please visit the <a href="http://vertx.io/">Vertx site</a></p>
-
-     <h2>Example step-by-step</h2>
-     <p><i>To run the server, simply type <code>mvn verify</code>
-         from this directory.</p>
-
-     <ol>
-        <li>First we need to create a Vert.x PlatformManager</li>
-        <pre class="prettyprint">
-           <code>platformManager = PlatformLocator.factory.createPlatformManager(PORT, HOST);</code>
-        </pre>
-
-        <li>We deploy a Verticle using the platformManager</li>
-        <pre class="prettyprint">
-           <code>String verticle = "org.apache.activemq.artemis.core.example.ExampleVerticle";
-           platformManager.deployVerticle(verticle, null, new URL[0], 1, null,
-                  new Handler<AsyncResult<String>>(){
-
-                     @Override
-                     public void handle(AsyncResult<String> result)
-                     {
-                        if (!result.succeeded())
-                        {
-                           throw new RuntimeException("failed to deploy verticle", result.cause());
-                        }
-                        latch0.countDown();
-                     }
-
-           });</code>
-        </pre>
-
-        <li>We register a message handler with the event bus in the Verticle to listen on the outgoing connector's address.</li>
-        <pre class="prettyprint">
-           <code>EventBus eventBus = vertx.eventBus();
-           eventBus.registerHandler(VertxConnectorExample.OUTGOING,
-                      new Handler<Message<?>>() {
-                         @Override
-                         public void handle(Message<?> startMsg)
-                         {
-                            Object body = startMsg.body();
-                            System.out.println("Verticle receives a message: " + body);
-                            VertxConnectorExample.result.set(VertxConnectorExample.MSG.equals(body));
-                            latch0.countDown();
-                         }
-                      });
-           </code>
-        </pre>
-
-        <li>We send a message to incoming connector's address via event bus</li>
-        <pre class="prettyprint">
-           <code>
-              EventBus bus = platformManager.vertx().eventBus();
-              bus.send(INCOMING, MSG);
-           </code>
-        </pre>
-
-        <li>The message will eventually arrives at the Verticle's message handler.</li>
-     </ol>
-  </body>
-</html>


[37/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 2b2ba2e..0000000
--- a/examples/broker-features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?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 topic used by the example-->
-      <topic name="exampleTopic"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-
-      <!-- Acceptors -->
-
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example topic-->
-         <security-setting match="jms.topic.exampleTopic">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/durable-subscription/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/durable-subscription/src/main/resources/jndi.properties b/examples/broker-features/standard/durable-subscription/src/main/resources/jndi.properties
deleted file mode 100644
index 54bed6d..0000000
--- a/examples/broker-features/standard/durable-subscription/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-topic.topic/exampleTopic=exampleTopic

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/embedded-simple/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/embedded-simple/pom.xml b/examples/broker-features/standard/embedded-simple/pom.xml
deleted file mode 100644
index 8ffd616..0000000
--- a/examples/broker-features/standard/embedded-simple/pom.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?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>embedded-simple</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Simple Embedded Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-server</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-jms-server</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.EmbeddedExample</clientClass>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.broker</groupId>
-                  <artifactId>embedded-simple</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/embedded-simple/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/embedded-simple/readme.html b/examples/broker-features/standard/embedded-simple/readme.html
deleted file mode 100644
index 1bbd7aa..0000000
--- a/examples/broker-features/standard/embedded-simple/readme.html
+++ /dev/null
@@ -1,96 +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.
--->
-
-<html>
-   <head>
-      <title>ActiveMQ Artemis Embedded JMS Server 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>Embedded JMS Server Example</h1>
-
-      <p>This examples shows how to setup and run an embedded JMS server using ActiveMQ Artemis along with ActiveMQ Artemis configuration files.</p>
-
-      <h2>Example step-by-step</h2>
-      <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-      <ol>
-         <li>Create ActiveMQ Artemis core configuration files and make sure they are within your classpath.  By default, ActiveMQ
-             expects the configuration file name to be "broker.xml".</li>
-         <li>Create an embedded ActiveMQ Artemis JMS server</li>
-         <pre class="prettyprint">
-            <code>EmbeddedJMS jmsServer = new EmbeddedJMS();</code>
-         </pre>
-
-         <li>Setup security configurations</li>
-         <pre class="prettyprint">
-            <code>SecurityConfiguration securityConfig = new SecurityConfiguration();
-            securityConfig.addUser("guest", "guest");
-            securityConfig.addRole("guest", "guest");
-            securityConfig.setDefaultUser("guest");
-            jmsServer.setSecurityManager(new ActiveMQSecurityManagerImpl(securityConfig));</code>
-         </pre>
-
-         <li>Start the embedded ActiveMQ Artemis JMS server</li>
-         <pre class="prettyprint">
-            <code>jmsServer.start()</code>
-         </pre>
-
-         <li>Create JMS resources (connection factory and queue) for the example</li>
-         <pre class="prettyprint">
-            <code>JMSServerManager jmsServerManager = jmsServer.getJMSServerManager();
-            List<String> connectors = new ArrayList<String>();
-            connectors.add("in-vm");
-            jmsServerManager.createConnectionFactory("ConnectionFactory", false, JMSFactoryType.CF, connectors, "ConnectionFactory");
-            jmsServerManager.createQueue(false, "exampleQueue", null, false, "queue/exampleQueue");</code>
-         </pre>
-
-         <p>At this point the JMS server is started and any JMS clients can look up JMS resources from the JNDI to send/receive
-            messages from the server. To keep the example simple, we will send and receive a JMS message from the same JVM
-            used to run the JMS server.</p>
-
-         <li>Lookup JMS resources defined in the configuration </li>
-         <pre class="prettyprint">
-            <code>ConnectionFactory cf = (ConnectionFactory)jmsServer.lookup("ConnectionFactory");
-            Queue queue = (Queue)jmsServer.lookup("queue/exampleQueue");</code>
-         </pre>
-
-         <li>Send and receive a message using JMS API</li>
-         <p>See the <a href="../queue/readme.html">Queue Example</a> for detailed steps to send and receive a JMS message</p>
-
-         <p>Finally, we stop the JMS server and its associated resources.</p>
-
-         <li>Close the connection</li>
-         <pre class="prettyprint">
-            <code>if (connection != null)
-            {
-               connection.close();
-            }</code>
-         </pre>
-
-         <li>Stop the JMS server</li>
-         <pre class="prettyprint">
-            <code>jmsServer.stop();</code>
-         </pre>
-
-      </ol>
-   </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java b/examples/broker-features/standard/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
deleted file mode 100644
index 7d00c7e..0000000
--- a/examples/broker-features/standard/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
+++ /dev/null
@@ -1,86 +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 org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
-import org.apache.activemq.artemis.jms.server.JMSServerManager;
-import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
-import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;
-
-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 java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-/**
- * This example demonstrates how to run an ActiveMQ Artemis embedded with JMS
- */
-public class EmbeddedExample {
-
-   public static void main(final String[] args) throws Exception {
-      EmbeddedJMS jmsServer = new EmbeddedJMS();
-
-      SecurityConfiguration securityConfig = new SecurityConfiguration();
-      securityConfig.addUser("guest", "guest");
-      securityConfig.addRole("guest", "guest");
-      securityConfig.setDefaultUser("guest");
-      jmsServer.setSecurityManager(new ActiveMQSecurityManagerImpl(securityConfig));
-
-      jmsServer.start();
-      System.out.println("Started Embedded JMS Server");
-
-      JMSServerManager jmsServerManager = jmsServer.getJMSServerManager();
-      List<String> connectors = new ArrayList<String>();
-      connectors.add("in-vm");
-      jmsServerManager.createConnectionFactory("ConnectionFactory", false, JMSFactoryType.CF, connectors, "ConnectionFactory");
-      jmsServerManager.createQueue(false, "exampleQueue", null, false, "queue/exampleQueue");
-
-      ConnectionFactory cf = (ConnectionFactory) jmsServer.lookup("ConnectionFactory");
-      Queue queue = (Queue) jmsServer.lookup("queue/exampleQueue");
-
-      // Step 10. Send and receive a message using JMS API
-      Connection connection = null;
-      try {
-         connection = cf.createConnection();
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageProducer producer = session.createProducer(queue);
-         TextMessage message = session.createTextMessage("Hello sent at " + new Date());
-         System.out.println("Sending message: " + message.getText());
-         producer.send(message);
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-         connection.start();
-         TextMessage messageReceived = (TextMessage) messageConsumer.receive(1000);
-         System.out.println("Received message:" + messageReceived.getText());
-      }
-      finally {
-         if (connection != null) {
-            connection.close();
-         }
-
-         // Step 11. Stop the JMS server
-         jmsServer.stop();
-         System.out.println("Stopped the JMS Server");
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/embedded-simple/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/embedded-simple/src/main/resources/broker.xml b/examples/broker-features/standard/embedded-simple/src/main/resources/broker.xml
deleted file mode 100644
index 0448e3b..0000000
--- a/examples/broker-features/standard/embedded-simple/src/main/resources/broker.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?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">
-
-   <core xmlns="urn:activemq:core">
-
-      <persistence-enabled>false</persistence-enabled>
-
-      <connectors>
-         <connector name="in-vm">vm://0</connector>
-      </connectors>
-
-      <acceptors>
-         <acceptor name="in-vm">vm://0</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="#">
-            <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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/embedded/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/embedded/pom.xml b/examples/broker-features/standard/embedded/pom.xml
deleted file mode 100644
index ee576c4..0000000
--- a/examples/broker-features/standard/embedded/pom.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?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>embedded</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Embedded Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-server</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-jms-server</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <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>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.EmbeddedExample</clientClass>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.broker</groupId>
-                  <artifactId>embedded</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/embedded/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/embedded/readme.html b/examples/broker-features/standard/embedded/readme.html
deleted file mode 100644
index 2da6ef7..0000000
--- a/examples/broker-features/standard/embedded/readme.html
+++ /dev/null
@@ -1,38 +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.
--->
-
-<html>
-   <head>
-      <title>ActiveMQ Artemis Embedded JMS Server 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>Embedded JMS Server Example</h1>
-      <pre>To run the example, simply type <b>mvn verify</b> from this directory</pre>
-
-      <p>This examples shows how to setup and run an embedded JMS server using ActiveMQ Artemis.</p>
-      <p>ActiveMQ Artemis was designed using POJOs (Plain Old Java Objects) which means embedding ActiveMQ Artemis in your own application
-          is as simple as instantiating a few objects.</p>
-      <p>This example does not use any configuration files. The server is configured using POJOs and can be easily ported to any dependency injection framework.<br />
-         We will setup and run a full-fledged JMS server which binds its JMS resources to JNDI and can be accessed by remote clients.</p>
-
-   </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java b/examples/broker-features/standard/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
deleted file mode 100644
index cb39fd0..0000000
--- a/examples/broker-features/standard/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
+++ /dev/null
@@ -1,107 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import java.util.ArrayList;
-import java.util.Date;
-
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
-import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
-import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
-import org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfiguration;
-import org.apache.activemq.artemis.jms.server.config.JMSConfiguration;
-import org.apache.activemq.artemis.jms.server.config.JMSQueueConfiguration;
-import org.apache.activemq.artemis.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
-import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl;
-import org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationImpl;
-import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
-
-/**
- * This example demonstrates how to run an ActiveMQ Artemis embedded with JMS
- */
-public final class EmbeddedExample {
-
-   public static void main(final String[] args) throws Exception {
-      // Step 1. Create ActiveMQ Artemis core configuration, and set the properties accordingly
-      Configuration configuration = new ConfigurationImpl();
-      configuration.setPersistenceEnabled(false);
-      configuration.setJournalDirectory("target/data/journal");
-      configuration.setSecurityEnabled(false);
-      configuration.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
-
-      TransportConfiguration connectorConfig = new TransportConfiguration(NettyConnectorFactory.class.getName());
-
-      configuration.getConnectorConfigurations().put("connector", connectorConfig);
-
-      // Step 2. Create the JMS configuration
-      JMSConfiguration jmsConfig = new JMSConfigurationImpl();
-
-      // Step 3. Configure the JMS ConnectionFactory
-      ArrayList<String> connectorNames = new ArrayList<String>();
-      connectorNames.add("connector");
-      ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl().setName("cf").setConnectorNames(connectorNames).setBindings("cf");
-      jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);
-
-      // Step 4. Configure the JMS Queue
-      JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl().setName("queue1").setDurable(false).setBindings("queue/queue1");
-      jmsConfig.getQueueConfigurations().add(queueConfig);
-
-      // Step 5. Start the JMS Server using the ActiveMQ Artemis core server and the JMS configuration
-      EmbeddedJMS jmsServer = new EmbeddedJMS();
-      jmsServer.setConfiguration(configuration);
-      jmsServer.setJmsConfiguration(jmsConfig);
-      jmsServer.start();
-      System.out.println("Started Embedded JMS Server");
-
-      // Step 6. Lookup JMS resources defined in the configuration
-      ConnectionFactory cf = (ConnectionFactory) jmsServer.lookup("cf");
-      Queue queue = (Queue) jmsServer.lookup("queue/queue1");
-
-      // Step 7. Send and receive a message using JMS API
-      Connection connection = null;
-      try {
-         connection = cf.createConnection();
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageProducer producer = session.createProducer(queue);
-         TextMessage message = session.createTextMessage("Hello sent at " + new Date());
-         System.out.println("Sending message: " + message.getText());
-         producer.send(message);
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-         connection.start();
-         TextMessage messageReceived = (TextMessage) messageConsumer.receive(1000);
-         System.out.println("Received message:" + messageReceived.getText());
-      }
-      finally {
-         if (connection != null) {
-            connection.close();
-         }
-
-         // Step 11. Stop the JMS server
-         jmsServer.stop();
-         System.out.println("Stopped the JMS Server");
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/expiry/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/expiry/pom.xml b/examples/broker-features/standard/expiry/pom.xml
deleted file mode 100644
index 983cc32..0000000
--- a/examples/broker-features/standard/expiry/pom.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?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>expiry</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Expiry 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>${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.ExpiryExample</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>expiry</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/expiry/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/expiry/readme.html b/examples/broker-features/standard/expiry/readme.html
deleted file mode 100644
index d13cac0..0000000
--- a/examples/broker-features/standard/expiry/readme.html
+++ /dev/null
@@ -1,61 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Message Expiration 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 Expiration 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 configure ActiveMQ Artemis so messages are expipired after a certain time.</p>
-     <p>Messages can be retained in the messaging system for a limited period of time before being removed.
-         JMS specification states that clients should not receive messages that have been expired (but it does not guarantee this will not happen).</p>
-     <p>ActiveMQ Artemis can assign a <em>expiry address</em> to a given queue so that when messages are expired, they are removed from the queue and
-        routed to this address. These "expired" messages can later be consumed for further inspection.
-     <p>
-         The example will send 1 message with a short <em>time-to-live</em> to a queue. We will wait for the message to expire and checks that the message
-         is no longer in the queue it was sent to.
-         We will instead consume it from an <em>expiry queue</em> where it was moved when it expired.
-     </p>
-     <h2>Example setup</h2>
-     <p>Expiry destinations are defined in the configuration file <a href="server0/broker.xml">broker.xml</a>:</p>
-     <pre class="prettyprint">
-         <code>&lt;address-setting match="jms.queue.exampleQueue"&gt;
-            &lt;expiry-address&gt;jms.queue.expiryQueue&lt;/expiry-address&gt;
-         &lt;/address-setting&gt;
-         </code>
-     </pre>
-     <p>This configuration will moved expired messages from the <code>exampleQueue</code> to the <code>expiryQueue</code></p>
-     <p>ActiveMQ Artemis allows to specify either a <code>Queue</code> by prefixing the <code>expiry-address</code> with <code>jms.queue.</code>
-         or a <code>Topic</code> by prefixing with <code>jms.topic.</code>.<br />
-         In this example, we will use a <code>Queue</code> to hold the expired messages.</p>
-     <p>Since we want to consume messages from this expiryQueue, we also need to add a JNDI binding to perform a lookup.
-         This is configured in <a href="server0/activemq-jms.xml">activemq-jms.xml</a></p>
-     <pre class="prettyprint">
-         <code>&lt;queue name="expiryQueue"&gt;
-            &lt;entry name="/queue/expiryQueue"/&gt;
-         &lt;/queue&gt;</code>
-     </pre>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java b/examples/broker-features/standard/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java
deleted file mode 100644
index 996da74..0000000
--- a/examples/broker-features/standard/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java
+++ /dev/null
@@ -1,120 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-/**
- * An example showing how messages are moved to an expiry queue when they expire.
- */
-public class ExpiryExample {
-
-   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. Messages sent by this producer will be retained for 1s (1000ms) before expiration
-         producer.setTimeToLive(1000);
-
-         // Step 8. Create a Text Message
-         TextMessage message = session.createTextMessage("this is a text message");
-
-         // Step 9. Send the Message
-         producer.send(message);
-         System.out.println("Sent message to " + queue.getQueueName() + ": " + message.getText());
-
-         // Step 10. Sleep for 5s. Once we wake up, the message will have been expired
-         System.out.println("Sleep a little bit to let the message expire...");
-         Thread.sleep(5000);
-
-         // Step 11. Create a JMS Message Consumer for the queue
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-
-         // Step 12. Start the Connection
-         connection.start();
-
-         // Step 13. Trying to receive a message. Since there is none on the queue, the call will timeout after 5000ms
-         // and messageReceived will be null
-         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-         System.out.println("Received message from " + queue.getQueueName() + ": " + messageReceived);
-
-         // Step 14. Perfom a lookup on the expiry queue
-         Queue expiryQueue = (Queue) initialContext.lookup("queue/expiryQueue");
-
-         // Step 15. Create a JMS Message Consumer for the expiry queue
-         MessageConsumer expiryConsumer = session.createConsumer(expiryQueue);
-
-         // Step 16. Receive the message from the expiry queue
-         messageReceived = (TextMessage) expiryConsumer.receive(5000);
-
-         // Step 17. The message sent to the queue was moved to the expiry queue when it expired.
-         System.out.println("Received message from " + expiryQueue.getQueueName() + ": " + messageReceived.getText());
-
-         // The message received from the expiry queue has the same content than the expired message but its JMS headers
-         // differ
-         // (from JMS point of view, it's not the same message).
-         // ActiveMQ Artemis defines additional properties to correlate the message received from the expiry queue with the
-         // message expired from the queue
-
-         System.out.println();
-         // Step 18. the messageReceived's destination is now the expiry queue.
-         System.out.println("Destination of the expired message: " + ((Queue) messageReceived.getJMSDestination()).getQueueName());
-         // Step 19. and its own expiration (the time to live in the *expiry* queue)
-         System.out.println("Expiration time of the expired message (relative to the expiry queue): " + messageReceived.getJMSExpiration());
-
-         System.out.println();
-         // Step 20. the *origin* destination is stored in the _AMQ_ORIG_ADDRESS property
-         System.out.println("*Origin destination* of the expired message: " + messageReceived.getStringProperty("_AMQ_ORIG_ADDRESS"));
-         // Step 21. the actual expiration time is stored in the _AMQ_ACTUAL_EXPIRY property
-         System.out.println("*Actual expiration time* of the expired message: " + messageReceived.getLongProperty("_AMQ_ACTUAL_EXPIRY"));
-      }
-      finally {
-         // Step 22. Be sure to close the resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 4907097..0000000
--- a/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?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"/>
-
-      <!--the expiry queue where expired messages will be sent-->
-      <queue name="expiryQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.#">
-            <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-settings>
-
-      <address-settings>
-         <!--override the expiry address for the example-->
-         <address-setting match="jms.queue.exampleQueue">
-            <expiry-address>jms.queue.expiryQueue</expiry-address>
-         </address-setting>
-      </address-settings>
-
-   </core>
-</configuration>

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/http-transport/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/http-transport/pom.xml b/examples/broker-features/standard/http-transport/pom.xml
deleted file mode 100644
index cfea5ef..0000000
--- a/examples/broker-features/standard/http-transport/pom.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?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>http-transport</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Http Transport 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>${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:8080?http-enabled=true</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.HttpTransportExample</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>http-transport</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/http-transport/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/http-transport/readme.html b/examples/broker-features/standard/http-transport/readme.html
deleted file mode 100644
index 061c939..0000000
--- a/examples/broker-features/standard/http-transport/readme.html
+++ /dev/null
@@ -1,52 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS HTTP Transport 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 HTTP 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 configure ActiveMQ Artemis to use the HTTP protocol as its transport layer.</p>
-
-     <p>ActiveMQ Artemis supports a variety of network protocols to be its underlying transport without any specific code change.</p>
-
-     <p>This example is taken from the queue example without any code change. By changing the configuration file, one can get ActiveMQ Artemis working with HTTP transport.</p>
-     <p>All you need to do is open the server0/broker.xml and enable HTTP like the following</p>
-
-
-      <pre class="prettyprint">
-      <code>
-      &lt;connector name=&quot;netty-connector&quot;&gt;tcp://localhost:8080?httpEnabled=true&lt;/connector&gt;
-
-      &lt;!-- Acceptors --&gt;
-
-      &lt;acceptor name=&quot;netty-acceptor&quot;&gt;tcp://localhost:8080 &lt;/acceptor&gt;
-      </code>
-      </pre>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java b/examples/broker-features/standard/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java
deleted file mode 100644
index 265f0c6..0000000
--- a/examples/broker-features/standard/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.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 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 org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * A simple JMS Queue example that uses HTTP protocol.
- */
-public class HttpTransportExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection connection = null;
-      try {
-         // Step 2. Perfom a lookup on the queue
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         // Step 3. Perform a lookup on the Connection Factory
-         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:8080?http-enabled=true");
-
-         // Step 4.Create a JMS Connection
-         connection = cf.createConnection();
-
-         System.out.println("connection created: " + connection);
-
-         // 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 {
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index d1a4d2a..0000000
--- a/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?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>
-
-      <!-- Acceptors -->
-
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:8080</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-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/instantiate-connection-factory/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/instantiate-connection-factory/pom.xml b/examples/broker-features/standard/instantiate-connection-factory/pom.xml
deleted file mode 100644
index ac6024b..0000000
--- a/examples/broker-features/standard/instantiate-connection-factory/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?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>instantiate-connection-factory</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Instantiate Connection Factory 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>
-                     <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.InstantiateConnectionFactoryExample
-                     </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>instantiate-connection-factory</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/instantiate-connection-factory/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/instantiate-connection-factory/readme.html b/examples/broker-features/standard/instantiate-connection-factory/readme.html
deleted file mode 100644
index b084471..0000000
--- a/examples/broker-features/standard/instantiate-connection-factory/readme.html
+++ /dev/null
@@ -1,49 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Instantiate Connection Factory 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 Instantiate Connection Factory 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>Usually, JMS Objects such as ConnectionFactories, Queue and Topic instances are looked up from JNDI
-     before being used by the client code. This objects are called "administered objects" in JMS specification
-     terminology.</p>
-     <p>However, in some cases a JNDI server may not be available or desired. To come to the rescue ActiveMQ
-     also supports the direct instantiation of these administered objects on the client side.</p>
-     <p>This allows the full set of JMS functionality to be available without requiring a JNDI server!</p>
-     <p>This example is very simple and based on the simple Queue example, however in this example we
-     instantiate the JMS Queue and ConnectionFactory objects directly.</p>
-     <p>A wide variety of methods are available for instantiating ConnectionFactory objects. In this example
-     we use a simple method which just takes the server connection details so it knows where to make the
-     connection to.</p>
-     <p>Other methods are available so all the connection factory parameters can be specified
-     including specifying UDP discovery so the client does not need hard-wired knowledge of where the servers
-     are that it wishes to connect to, or for specifying live-backup pairs of servers for failover.</p>
-     <p>For more information on instantiating ConnectionFactories directly please consult the user manual and
-     javadoc.</p>
-       </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java b/examples/broker-features/standard/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
deleted file mode 100644
index 47bc66c..0000000
--- a/examples/broker-features/standard/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.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 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 org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * This example demonstrates how a JMS client can directly instantiate it's JMS Objects like
- * Queue, ConnectionFactory, etc. without having to use JNDI at all.
- *
- * For more information please see the readme.html file.
- */
-public class InstantiateConnectionFactoryExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection connection = null;
-      try {
-         // Step 1. Directly instantiate the JMS Queue object.
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         // Starting with Artemis 1.0.1 you can just use the URI to instantiate the object directly
-         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616");
-
-         // 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 {
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/interceptor/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/interceptor/pom.xml b/examples/broker-features/standard/interceptor/pom.xml
deleted file mode 100644
index fbf9654..0000000
--- a/examples/broker-features/standard/interceptor/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?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>interceptor</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Interceptor 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>
-                     <libList><arg>org.apache.activemq.examples.broker:interceptor:${project.version}</arg></libList>
-                     <ignore>${noServer}</ignore>
-                     <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.InterceptorExample</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>interceptor</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>


[13/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/expiry/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/expiry/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/expiry/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/expiry/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/6b17d966/examples/features/standard/expiry/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/expiry/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/expiry/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..4907097
--- /dev/null
+++ b/examples/features/standard/expiry/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,70 @@
+<?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"/>
+
+      <!--the expiry queue where expired messages will be sent-->
+      <queue name="expiryQueue"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="jms.#">
+            <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-settings>
+
+      <address-settings>
+         <!--override the expiry address for the example-->
+         <address-setting match="jms.queue.exampleQueue">
+            <expiry-address>jms.queue.expiryQueue</expiry-address>
+         </address-setting>
+      </address-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/expiry/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/expiry/src/main/resources/jndi.properties b/examples/features/standard/expiry/src/main/resources/jndi.properties
new file mode 100644
index 0000000..231fa30
--- /dev/null
+++ b/examples/features/standard/expiry/src/main/resources/jndi.properties
@@ -0,0 +1,21 @@
+# 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
+queue.queue/expiryQueue=expiryQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/http-transport/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/http-transport/pom.xml b/examples/features/standard/http-transport/pom.xml
new file mode 100644
index 0000000..cfea5ef
--- /dev/null
+++ b/examples/features/standard/http-transport/pom.xml
@@ -0,0 +1,110 @@
+<?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>http-transport</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Http Transport 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>${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:8080?http-enabled=true</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.HttpTransportExample</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>http-transport</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/http-transport/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/http-transport/readme.html b/examples/features/standard/http-transport/readme.html
new file mode 100644
index 0000000..061c939
--- /dev/null
+++ b/examples/features/standard/http-transport/readme.html
@@ -0,0 +1,52 @@
+<!--
+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 HTTP Transport 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 HTTP 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 configure ActiveMQ Artemis to use the HTTP protocol as its transport layer.</p>
+
+     <p>ActiveMQ Artemis supports a variety of network protocols to be its underlying transport without any specific code change.</p>
+
+     <p>This example is taken from the queue example without any code change. By changing the configuration file, one can get ActiveMQ Artemis working with HTTP transport.</p>
+     <p>All you need to do is open the server0/broker.xml and enable HTTP like the following</p>
+
+
+      <pre class="prettyprint">
+      <code>
+      &lt;connector name=&quot;netty-connector&quot;&gt;tcp://localhost:8080?httpEnabled=true&lt;/connector&gt;
+
+      &lt;!-- Acceptors --&gt;
+
+      &lt;acceptor name=&quot;netty-acceptor&quot;&gt;tcp://localhost:8080 &lt;/acceptor&gt;
+      </code>
+      </pre>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java b/examples/features/standard/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java
new file mode 100644
index 0000000..265f0c6
--- /dev/null
+++ b/examples/features/standard/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.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.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 org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * A simple JMS Queue example that uses HTTP protocol.
+ */
+public class HttpTransportExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection = null;
+      try {
+         // Step 2. Perfom a lookup on the queue
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // Step 3. Perform a lookup on the Connection Factory
+         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:8080?http-enabled=true");
+
+         // Step 4.Create a JMS Connection
+         connection = cf.createConnection();
+
+         System.out.println("connection created: " + connection);
+
+         // 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 {
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/http-transport/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/http-transport/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/http-transport/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/http-transport/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/http-transport/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/http-transport/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/http-transport/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/http-transport/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/6b17d966/examples/features/standard/http-transport/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/http-transport/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/http-transport/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..d1a4d2a
--- /dev/null
+++ b/examples/features/standard/http-transport/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,61 @@
+<?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>
+
+      <!-- Acceptors -->
+
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:8080</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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/instantiate-connection-factory/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/instantiate-connection-factory/pom.xml b/examples/features/standard/instantiate-connection-factory/pom.xml
new file mode 100644
index 0000000..ac6024b
--- /dev/null
+++ b/examples/features/standard/instantiate-connection-factory/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>instantiate-connection-factory</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Instantiate Connection Factory 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>
+                     <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.InstantiateConnectionFactoryExample
+                     </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>instantiate-connection-factory</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/instantiate-connection-factory/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/instantiate-connection-factory/readme.html b/examples/features/standard/instantiate-connection-factory/readme.html
new file mode 100644
index 0000000..b084471
--- /dev/null
+++ b/examples/features/standard/instantiate-connection-factory/readme.html
@@ -0,0 +1,49 @@
+<!--
+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 Instantiate Connection Factory 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 Instantiate Connection Factory 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>Usually, JMS Objects such as ConnectionFactories, Queue and Topic instances are looked up from JNDI
+     before being used by the client code. This objects are called "administered objects" in JMS specification
+     terminology.</p>
+     <p>However, in some cases a JNDI server may not be available or desired. To come to the rescue ActiveMQ
+     also supports the direct instantiation of these administered objects on the client side.</p>
+     <p>This allows the full set of JMS functionality to be available without requiring a JNDI server!</p>
+     <p>This example is very simple and based on the simple Queue example, however in this example we
+     instantiate the JMS Queue and ConnectionFactory objects directly.</p>
+     <p>A wide variety of methods are available for instantiating ConnectionFactory objects. In this example
+     we use a simple method which just takes the server connection details so it knows where to make the
+     connection to.</p>
+     <p>Other methods are available so all the connection factory parameters can be specified
+     including specifying UDP discovery so the client does not need hard-wired knowledge of where the servers
+     are that it wishes to connect to, or for specifying live-backup pairs of servers for failover.</p>
+     <p>For more information on instantiating ConnectionFactories directly please consult the user manual and
+     javadoc.</p>
+       </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java b/examples/features/standard/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
new file mode 100644
index 0000000..47bc66c
--- /dev/null
+++ b/examples/features/standard/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.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.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 org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * This example demonstrates how a JMS client can directly instantiate it's JMS Objects like
+ * Queue, ConnectionFactory, etc. without having to use JNDI at all.
+ *
+ * For more information please see the readme.html file.
+ */
+public class InstantiateConnectionFactoryExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection = null;
+      try {
+         // Step 1. Directly instantiate the JMS Queue object.
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // Starting with Artemis 1.0.1 you can just use the URI to instantiate the object directly
+         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616");
+
+         // 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 {
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/interceptor/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/interceptor/pom.xml b/examples/features/standard/interceptor/pom.xml
new file mode 100644
index 0000000..fbf9654
--- /dev/null
+++ b/examples/features/standard/interceptor/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>interceptor</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Interceptor 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>
+                     <libList><arg>org.apache.activemq.examples.broker:interceptor:${project.version}</arg></libList>
+                     <ignore>${noServer}</ignore>
+                     <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.InterceptorExample</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>interceptor</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/interceptor/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/interceptor/readme.html b/examples/features/standard/interceptor/readme.html
new file mode 100644
index 0000000..42b1e18
--- /dev/null
+++ b/examples/features/standard/interceptor/readme.html
@@ -0,0 +1,72 @@
+<!--
+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 Interceptor 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 Interceptor 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 implement and configure a simple incoming, server-side interceptor with ActiveMQ Artemis.</p>
+
+     <p>ActiveMQ Artemis allows an application to use an interceptor to hook into the messaging system. All that needs to do is to implement the
+     Interceptor interface, as defined below: </p>
+     <pre class="prettyprint">
+     <code>
+         public interface Interceptor
+         {
+            boolean intercept(Packet packet, RemotingConnection connection) throws ActiveMQException;
+         }
+     </code>
+     </pre>
+     <p>Once you have your own interceptor class, add it to the broker.xml, as follows:</p>
+     <pre class="prettyprint">
+     <code>
+        &lt;configuration&gt;
+        ...
+           &lt;remoting-incoming-interceptors&gt;
+              &lt;class-name&gt;org.apache.activemq.artemis.jms.example.SimpleInterceptor&lt;/class-name&gt;
+           &lt;/remoting-incoming-interceptors&gt;
+        ...
+        &lt;/configuration&gt;
+     </code>
+     </pre>
+
+     <p>With interceptor, you can handle various events in message processing. In this example, a simple interceptor, SimpleInterceptor, is implemented and configured.
+     When the example is running, the interceptor will print out each events that are passed in the interceptor. And it will add a string property to the message being
+     delivered. You can see that after the message is received, there will be a new string property appears in the received message.</p>
+
+     <p>With our interceptor we always return <code>true</code> from the <code>intercept</code> method. If we were
+     to return <code>false</code> that signifies that no more interceptors are to run or the target
+     is not to be called. Return <code>false</code> to abort processing of the packet.</p>
+  </body>
+</html>
+
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/InterceptorExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/InterceptorExample.java b/examples/features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/InterceptorExample.java
new file mode 100644
index 0000000..b78875f
--- /dev/null
+++ b/examples/features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/InterceptorExample.java
@@ -0,0 +1,88 @@
+/*
+ * 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 example that shows how to implement and use interceptors with ActiveMQ Artemis.
+ */
+public class InterceptorExample {
+
+   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("Sending message [" + message.getText() +
+                               "] with String property: " +
+                               message.getStringProperty("newproperty"));
+
+         // 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() +
+                               "] with String property: " +
+                               messageReceived.getStringProperty("newproperty"));
+      }
+      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/6b17d966/examples/features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/SimpleInterceptor.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/SimpleInterceptor.java b/examples/features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/SimpleInterceptor.java
new file mode 100644
index 0000000..6836930
--- /dev/null
+++ b/examples/features/standard/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/SimpleInterceptor.java
@@ -0,0 +1,48 @@
+/*
+ * 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 org.apache.activemq.artemis.api.core.ActiveMQException;
+import org.apache.activemq.artemis.api.core.Interceptor;
+import org.apache.activemq.artemis.api.core.Message;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.protocol.core.Packet;
+import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionSendMessage;
+import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
+
+/**
+ * A simple Interceptor implementation
+ */
+public class SimpleInterceptor implements Interceptor {
+
+   public boolean intercept(final Packet packet, final RemotingConnection connection) throws ActiveMQException {
+      System.out.println("SimpleInterceptor gets called!");
+      System.out.println("Packet: " + packet.getClass().getName());
+      System.out.println("RemotingConnection: " + connection.getRemoteAddress());
+
+      if (packet instanceof SessionSendMessage) {
+         SessionSendMessage realPacket = (SessionSendMessage) packet;
+         Message msg = realPacket.getMessage();
+         msg.putStringProperty(new SimpleString("newproperty"), new SimpleString("Hello from interceptor!"));
+      }
+      // We return true which means "call next interceptor" (if there is one) or target.
+      // If we returned false, it means "abort call" - no more interceptors would be called and neither would
+      // the target
+      return true;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/interceptor/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/interceptor/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/interceptor/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/interceptor/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/interceptor/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/interceptor/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/interceptor/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/interceptor/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/6b17d966/examples/features/standard/interceptor/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/interceptor/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/interceptor/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..fc82158
--- /dev/null
+++ b/examples/features/standard/interceptor/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,65 @@
+<?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.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+
+
+      <remoting-incoming-interceptors>
+         <class-name>org.apache.activemq.artemis.jms.example.SimpleInterceptor</class-name>
+      </remoting-incoming-interceptors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/interceptor/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/interceptor/src/main/resources/jndi.properties b/examples/features/standard/interceptor/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/interceptor/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/6b17d966/examples/features/standard/jms-auto-closeable/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-auto-closeable/pom.xml b/examples/features/standard/jms-auto-closeable/pom.xml
new file mode 100644
index 0000000..844d859
--- /dev/null
+++ b/examples/features/standard/jms-auto-closeable/pom.xml
@@ -0,0 +1,106 @@
+<?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>auto-closeable</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Auto Closable 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>
+               </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.JMSAutoCloseableExample</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>auto-closeable</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-auto-closeable/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-auto-closeable/readme.html b/examples/features/standard/jms-auto-closeable/readme.html
new file mode 100644
index 0000000..80dc410
--- /dev/null
+++ b/examples/features/standard/jms-auto-closeable/readme.html
@@ -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.
+-->
+
+<html>
+  <head>
+    <title>ActiveMQ Artemis JMS Auto Closable 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 Auto Closable 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 JMS resources, such as connections, sessions and consumers, in JMS 2 can be automatically closed on error.</p>
+     <p>In this instance we auto close a connection after a subsequent call to a JMS producer send fails</p>
+
+     <h2>Example step-by-step</h2>
+
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
+        <pre class="prettyprint">
+           <code>InitialContext initialContext = getContext();</code>
+        </pre>
+
+        <li>We look-up the JMS queue object from JNDI</li>
+        <pre class="prettyprint">
+           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>We look-up the JMS connection factory object from JNDI</li>
+        <pre class="prettyprint">
+           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>We create a JMS context but we do it inside the try-with-resources statement like so:</li>
+        <pre class="prettyprint">
+           <code>
+            try
+            (
+               JMSContext jmsContext = cf.createContext()
+            )
+           </code>
+        </pre>
+
+        <li>Inside the following try block we first create the producer</li>
+        <pre class="prettyprint">
+           <code>JMSProducer jmsProducer = jmsContext.createProducer();</code>
+        </pre>
+
+        <li>We then try to send a message. It is this call that throws an exception as the producer doesn't have the privileges
+        to send a message</li>
+        <pre class="prettyprint">
+          <code>jmsProducer.send(queue, "this message will fail security!");</code>
+       </pre>
+
+        <li>We catch the exception from the send message and can do what we want, however the JMSContext will have been closed
+        prior to entering the catch block.</li>
+        <pre class="prettyprint">
+           <code>System.out.println("expected exception from jmsProducer.send: " + e.getMessage());</code>
+        </pre>
+
+        <li>And finally, we close the Initial Context, note we no longer have to worry about clearing up the JMSContext.</li>
+
+        <pre class="prettyprint">
+           <code>finally
+           {
+              if (initialContext != null)
+              {
+                 initialContext.close();
+              }
+           }</code>
+        </pre>
+
+
+
+     </ol>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java b/examples/features/standard/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java
new file mode 100644
index 0000000..d53a373
--- /dev/null
+++ b/examples/features/standard/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.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.
+ */
+package org.apache.activemq.artemis.jms.example;
+
+import javax.jms.JMSContext;
+import javax.jms.JMSProducer;
+import javax.jms.Queue;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * A simple JMS example that shows how AutoCloseable is used by JMS 2 resources.
+ */
+public class JMSAutoCloseableExample {
+
+   public static void main(final String[] args) throws Exception {
+      // Step 2. Perfom a lookup on the queue
+      Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+      // Step 4.Create a JMS Context using the try-with-resources statement
+      try
+         (
+            // Even though ConnectionFactory is not closeable it would be nice to close an ActiveMQConnectionFactory
+            ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
+            JMSContext jmsContext = cf.createContext()
+         ) {
+         // Step 5. create a jms producer
+         JMSProducer jmsProducer = jmsContext.createProducer();
+
+         // Step 6. Try sending a message, we don't have the appropriate privileges to do this so this will throw an exception
+         jmsProducer.send(queue, "A Message from JMS2!");
+
+         System.out.println("Received:" + jmsContext.createConsumer(queue).receiveBody(String.class));
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-auto-closeable/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-auto-closeable/src/main/resources/jndi.properties b/examples/features/standard/jms-auto-closeable/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/jms-auto-closeable/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/6b17d966/examples/features/standard/jms-bridge/jms-bridge.png
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-bridge/jms-bridge.png b/examples/features/standard/jms-bridge/jms-bridge.png
new file mode 100644
index 0000000..d671bf3
Binary files /dev/null and b/examples/features/standard/jms-bridge/jms-bridge.png differ

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-bridge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-bridge/pom.xml b/examples/features/standard/jms-bridge/pom.xml
new file mode 100644
index 0000000..35a5363
--- /dev/null
+++ b/examples/features/standard/jms-bridge/pom.xml
@@ -0,0 +1,159 @@
+<?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>bridge</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Bridge Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.JMSBridgeExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.broker</groupId>
+                  <artifactId>bridge</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>


[32/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/no-consumer-buffering/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/no-consumer-buffering/readme.html b/examples/broker-features/standard/no-consumer-buffering/readme.html
deleted file mode 100644
index 596562d..0000000
--- a/examples/broker-features/standard/no-consumer-buffering/readme.html
+++ /dev/null
@@ -1,205 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis No Consumer Buffering 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>No Consumer Buffering 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>By default, ActiveMQ Artemis consumers buffer messages from the server in a client side buffer
-     before actual delivery actually occurs.</p>
-     <p>This improves performance since otherwise every time you called receive() or had processed the last
-     message in a MessageListener onMessage() method, the ActiveMQ Artemis client would have to go the
-     server to request the next message involving a network round trip for every message reducing performance.</p>
-     <p>Therefore, by default, ActiveMQ Artemis pre-fetches messages into a buffer on each consumer. The total maximum size of
-     messages in bytes that will be buffered on each consumer is determined by the <code>consumer-window-size</code>
-     parameter on the connection factory.</p>
-     <p>In some cases it is not desirable to buffer any messages on the client side consumer.</p>
-     <p>An example would be an order queue which had multiple consumers that processed orders from the queue.
-     Each order takes a significant time to process, but each one should be processed in a timely fashion.</p>
-     <p>If orders were buffered in each consumer, and a new consumer was added that consumer would not be able
-     to process orders which were already in the client side buffer of another consumer.</p>
-     <p>To turn off client side buffering of messages, set <code>consumer-window-size</code> to zero.</p>
-
-     <p>With ActiveMQ Artemis you can specify a maximum consume rate at which a JMS MessageConsumer will consume messages.
-     This can be specified when creating or deploying the connection factory. See <code>activemq-jms.xml</code></p>
-     <h2>Example step-by-step</h2>
-     <p>In this example we specify a <code>consumer-window-size</code> of <code>0</code> bytes in the <code>activemq-jms.xml</code>
-     file when deploying the connection factory:</p>
-     <pre class="prettyprint">
-     <code>
-   &lt;connection-factory name="ConnectionFactory"&gt;
-      &lt;connector-ref connector-name="netty-connector"/&gt;
-      &lt;entries&gt;
-         &lt;entry name="ConnectionFactory"/&gt;
-      &lt;/entries&gt;
-
-      &lt;!-- We set the consumer window size to 0, which means messages are not buffered at all
-      on the client side --&gt;
-      &lt;consumer-window-size&gt;0&lt;/consumer-window-size&gt;
-
-   &lt;/connection-factory&gt;
-     </code>
-     </pre>
-     <p>We create a consumer on a queue and send 10 messages to it. We then create another consumer on
-     the same queue.</p>
-     <p>We then consume messages from each consumer in a semi-random order. We note that the messages
-     are consumed in the order they were sent.</p>
-     <p>If the messages had been buffered in each consumer they would not be available to be consumed
-     in an order determined afer delivery.</p>
-
-     <ol>
-        <li>Create an initial context to perform the JNDI lookup.</li>
-        <pre class="prettyprint">
-           <code>initialContext = getContext(0);</code>
-        </pre>
-
-        <li>Perfom a lookup on the queue</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>Perform a lookup on the Connection Factory</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>Create a JMS Connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>Create a JMS Session</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>Create a JMS MessageProducer</li>
-        <pre class="prettyprint">
-          <code>MessageProducer producer = session.createProducer(queue);</code>
-        </pre>
-
-        <li>Create a JMS MessageConsumer</li>
-        <pre class="prettyprint">
-           <code>MessageConsumer consumer1 = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>Start the connection</li>
-
-        <pre class="prettyprint">
-           <code>
-     connection.start();
-           </code>
-        </pre>
-
-
-        <li>Send 10 messages to the queue</li>
-        <pre class="prettyprint">
-           <code>
-     final int numMessages = 10;
-
-     for (int i = 0; i < numMessages; i++)
-     {
-        TextMessage message = session.createTextMessage("This is text message: " + i);
-
-        producer.send(message);
-     }
-           </code>
-        </pre>
-
-        <li>Create another JMS MessageConsumer on the same queue.</li>
-        <pre class="prettyprint">
-           <code>MessageConsumer consumer2 = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>Consume three messages from consumer2</li>
-
-        <pre class="prettyprint">
-           <code>
-   for (int i = 0; i < 3; i++)
-   {
-      TextMessage message = (TextMessage)consumer2.receive(2000);
-
-      System.out.println("Consumed message from consumer2: " + message.getText());
-   }
-           </code>
-        </pre>
-
-        <li>Consume five messages from consumer1</li>
-
-        <pre class="prettyprint">
-           <code>
-   for (int i = 0; i < 5; i++)
-   {
-      TextMessage message = (TextMessage)consumer1.receive(2000);
-
-      System.out.println("Consumed message from consumer1: " + message.getText());
-   }
-           </code>
-        </pre>
-
-        <li>Consume two more messages from consumer2</li>
-
-        <pre class="prettyprint">
-           <code>
-   for (int i = 0; i < 2; i++)
-   {
-      TextMessage message = (TextMessage)consumer1.receive(2000);
-
-      System.out.println("Consumed message from consumer2: " + message.getText());
-   }
-           </code>
-        </pre>
-
-
-        <li>Be sure to close our resources!</li>
-
-        <pre class="prettyprint">
-           <code>
-           finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
-
-     <h2>More information</h2>
-
-     <ul>
-         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#flow-control.consumer.window">Consumer Window-Based Flow Control chapter</a></li>
-     </ul>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/no-consumer-buffering/src/main/java/org/apache/activemq/artemis/jms/example/NoConsumerBufferingExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/no-consumer-buffering/src/main/java/org/apache/activemq/artemis/jms/example/NoConsumerBufferingExample.java b/examples/broker-features/standard/no-consumer-buffering/src/main/java/org/apache/activemq/artemis/jms/example/NoConsumerBufferingExample.java
deleted file mode 100644
index 6f321b0..0000000
--- a/examples/broker-features/standard/no-consumer-buffering/src/main/java/org/apache/activemq/artemis/jms/example/NoConsumerBufferingExample.java
+++ /dev/null
@@ -1,110 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * This example demonstrates how ActiveMQ Artemis consumers can be configured to not buffer any messages from
- * the server.
- */
-public class NoConsumerBufferingExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection connection = null;
-      try {
-         // Step 2. Perfom a lookup on the queue
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         // Step 3. new Connection factory with consumerWindowsize=0
-         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?consumerWindowSize=0");
-
-         // 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 JMS MessageConsumer
-
-         MessageConsumer consumer1 = session.createConsumer(queue);
-
-         // Step 8. Start the connection
-
-         connection.start();
-
-         // Step 9. Send 10 messages to the queue
-
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session.createTextMessage("This is text message: " + i);
-
-            producer.send(message);
-         }
-
-         System.out.println("Sent messages");
-
-         // Step 10. Create another consumer on the same queue
-
-         MessageConsumer consumer2 = session.createConsumer(queue);
-
-         // Step 11. Consume three messages from consumer2
-
-         for (int i = 0; i < 3; i++) {
-            TextMessage message = (TextMessage) consumer2.receive(2000);
-
-            System.out.println("Consumed message from consumer2: " + message.getText());
-         }
-
-         // Step 12. Consume five messages from consumer1
-
-         for (int i = 0; i < 5; i++) {
-            TextMessage message = (TextMessage) consumer1.receive(2000);
-
-            System.out.println("Consumed message from consumer1: " + message.getText());
-         }
-
-         // Step 13. Consume another two messages from consumer2
-
-         for (int i = 0; i < 2; i++) {
-            TextMessage message = (TextMessage) consumer2.receive(2000);
-
-            System.out.println("Consumed message from consumer1: " + message.getText());
-         }
-      }
-      finally {
-         // Step 9. Be sure to close our resources!
-
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/paging/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/paging/pom.xml b/examples/broker-features/standard/paging/pom.xml
deleted file mode 100644
index d78efc9..0000000
--- a/examples/broker-features/standard/paging/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>paging</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Paging 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>
-                     <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.PagingExample</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>paging</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/paging/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/paging/readme.html b/examples/broker-features/standard/paging/readme.html
deleted file mode 100644
index 7c74320..0000000
--- a/examples/broker-features/standard/paging/readme.html
+++ /dev/null
@@ -1,187 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Paging 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>Paging 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 how ActiveMQ Artemis would avoid running out of memory resources by paging messages.</p>
-     <p>A maxSize can be specified per Destination via the destinations settings configuration file (broker.xml).</p>
-     <p>When messages routed to an address exceed the specified maxSize the server will begin to write messages to the file
-     system, this is called paging. This will continue to occur until messages have been delivered to consumers and subsequently
-     acknowledged freeing up memory. Messages will then be read from the file system , i.e. depaged, and routed as normal. </p>
-     <p>Acknowledgement plays an important factor on paging as messages will stay on the file system until the memory is released
-     so it is important to make sure that the client acknowledges its messages.</p>
-
-
-     <h2>Example step-by-step</h2>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI. pagingQueue is configured to hold a very limited number of bytes in memory</li>
-        <pre class="prettyprint">
-           <code>Queue pageQueue = (Queue) initialContext.lookup("/queue/pagingQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI.</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted. We will use client acknowledgement on this example.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);</code>
-        </pre>
-
-
-         <li>Create a JMS Message Producer for pageQueueAddress</li>
-         <pre class="prettyprint"><code>
-         MessageProducer pageMessageProducer = session.createProducer(pageQueue);
-         </pre></code>
-
-         <li>We don't need persistent messages in order to use paging. (This step is optional)</li>
-         <pre class="prettyprint"><code>
-         pageMessageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-         </pre></code>
-
-         <li>Create a Binary Bytes Message with 10K arbitrary bytes</li>
-         <pre class="prettyprint"><code>
-         BytesMessage message = session.createBytesMessage();
-         message.writeBytes(new byte[10 * 1024]);
-         </pre></code>
-
-
-         <li>Send only 20 messages to the Queue. This will be already enough for pagingQueue. Look at ./paging/config/activemq-queues.xml for the config.</li>
-         <pre class="prettyprint"><code>
-         for (int i = 0; i < 20; i++)
-         {
-            pageMessageProducer.send(message);
-         }
-         </pre></code>
-
-         <li>Create a JMS Message Producer</li>
-         <pre class="prettyprint"><code>
-         MessageProducer messageProducer = session.createProducer(queue);
-         </pre></code>
-
-         <li>We don't need persistent messages in order to use paging. (This step is optional)</li>
-         <pre class="prettyprint"><code>
-         messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-         </pre></code>
-
-         <li>Send the message for about 30K, which should be over the memory limit imposed by the server</li>
-         <pre class="prettyprint"><code>
-         for (int i = 0; i < 30000; i++)
-         {
-            messageProducer.send(message);
-         }
-         </pre></code>
-
-         <li>if you pause the example here, you will several files under ./build/data/paging</li>
-
-         <pre class="prettyprint"><code>
-         // Thread.sleep(30000); // if you want to just our of curiosity, you can sleep here and inspect the created files just for
-         </pre></code>
-
-
-         <li>Create a JMS Message Consumer</li>
-         <pre class="prettyprint"><code>
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-         </pre></code>
-
-
-         <li>Start the JMS Connection. This step will activate the subscribers to receive messages.</li>
-         <pre class="prettyprint"><code>
-         connection.start();
-         </pre></code>
-
-
-         <li>Receive the messages. It's important to ACK for messages as ActiveMQ Artemis will not read messages from paging until messages are ACKed</li>
-
-         <pre class="prettyprint"><code>
-         for (int i = 0; i < 30000; i++)
-         {
-            message = (BytesMessage)messageConsumer.receive(1000);
-
-            if (i % 1000 == 0)
-            {
-               System.out.println("Received " + i + " messages");
-
-               message.acknowledge();
-            }
-         }
-         </pre></code>
-
-         <li>Receive the messages from the Queue names pageQueue. Create the proper consumer for that.</li>
-         <pre class="prettyprint"><code>
-         messageConsumer.close();
-         messageConsumer = session.createConsumer(pageQueue);
-
-         for (int i = 0; i < 20; i++)
-         {
-            message = (BytesMessage)messageConsumer.receive(1000);
-
-            System.out.println("Received message " + i + " from pageQueue");
-
-            message.acknowledge();
-         }
-         </pre></code>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-     </ol>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/paging/src/main/java/org/apache/activemq/artemis/jms/example/PagingExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/paging/src/main/java/org/apache/activemq/artemis/jms/example/PagingExample.java b/examples/broker-features/standard/paging/src/main/java/org/apache/activemq/artemis/jms/example/PagingExample.java
deleted file mode 100644
index 19d8a17..0000000
--- a/examples/broker-features/standard/paging/src/main/java/org/apache/activemq/artemis/jms/example/PagingExample.java
+++ /dev/null
@@ -1,135 +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.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-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 PagingExample {
-
-   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 Connection Factory
-         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 3. We look-up the JMS queue object from JNDI. pagingQueue is configured to hold a very limited number
-         // of bytes in memory
-         Queue pageQueue = (Queue) initialContext.lookup("queue/pagingQueue");
-
-         // Step 4. Lookup for a JMS Queue
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-
-         // Step 5. Create a JMS Connection
-         connection = cf.createConnection();
-
-         // Step 6. Create a JMS Session
-         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
-         // Step 7. Create a JMS Message Producer for pageQueueAddress
-         MessageProducer pageMessageProducer = session.createProducer(pageQueue);
-
-         // Step 8. We don't need persistent messages in order to use paging. (This step is optional)
-         pageMessageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-
-         // Step 9. Create a Binary Bytes Message with 10K arbitrary bytes
-         BytesMessage message = session.createBytesMessage();
-         message.writeBytes(new byte[10 * 1024]);
-
-         // Step 10. Send only 20 messages to the Queue. This will be already enough for pagingQueue. Look at
-         // ./paging/config/activemq-queues.xml for the config.
-         for (int i = 0; i < 20; i++) {
-            pageMessageProducer.send(message);
-         }
-
-         // Step 11. Create a JMS Message Producer
-         MessageProducer messageProducer = session.createProducer(queue);
-
-         // Step 12. We don't need persistent messages in order to use paging. (This step is optional)
-         messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-
-         // Step 13. Send the message for about 1K, which should be over the memory limit imposed by the server
-         for (int i = 0; i < 1000; i++) {
-            messageProducer.send(message);
-         }
-
-         // Step 14. if you pause this example here, you will see several files under ./build/data/paging
-         // Thread.sleep(30000); // if you want to just our of curiosity, you can sleep here and inspect the created
-         // files just for
-
-         // Step 15. Create a JMS Message Consumer
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-
-         // Step 16. Start the JMS Connection. This step will activate the subscribers to receive messages.
-         connection.start();
-
-         // Step 17. Receive the messages. It's important to ACK for messages as ActiveMQ Artemis will not read messages from
-         // paging
-         // until messages are ACKed
-
-         for (int i = 0; i < 1000; i++) {
-            message = (BytesMessage) messageConsumer.receive(3000);
-
-            if (i % 100 == 0) {
-               System.out.println("Received " + i + " messages");
-               message.acknowledge();
-            }
-         }
-
-         message.acknowledge();
-
-         // Step 18. Receive the messages from the Queue names pageQueue. Create the proper consumer for that
-         messageConsumer.close();
-         messageConsumer = session.createConsumer(pageQueue);
-
-         for (int i = 0; i < 20; i++) {
-            message = (BytesMessage) messageConsumer.receive(1000);
-
-            System.out.println("Received message " + i + " from pageQueue");
-
-            message.acknowledge();
-         }
-      }
-      finally {
-         // And finally, always remember to close your JMS connections after use, in a finally block. Closing a JMS
-         // connection will automatically close all of its sessions, consumers, producer and browser objects
-
-         if (initialContext != null) {
-            initialContext.close();
-         }
-
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/paging/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/paging/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/paging/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index a7a1969..0000000
--- a/examples/broker-features/standard/paging/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?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 topic used by the example-->
-      <queue name="exampleQueue"/>
-
-      <queue name="pagingQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</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.pagingQueue">
-            <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-settings>
-
-      <address-settings>
-         <address-setting match="jms.queue.pagingQueue">
-            <max-size-bytes>100000</max-size-bytes>
-            <page-size-bytes>20000</page-size-bytes>
-         </address-setting>
-
-         <address-setting match="jms.queue.exampleQueue">
-            <max-size-bytes>10485760</max-size-bytes>
-            <page-size-bytes>1048576</page-size-bytes>
-         </address-setting>
-         <address-setting match="#">
-            <max-size-bytes>10485760</max-size-bytes>
-            <page-size-bytes>1048576</page-size-bytes>
-         </address-setting>
-      </address-settings>
-
-   </core>
-</configuration>

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/pom.xml b/examples/broker-features/standard/pom.xml
deleted file mode 100644
index 106462b..0000000
--- a/examples/broker-features/standard/pom.xml
+++ /dev/null
@@ -1,171 +0,0 @@
-<?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.clustered</groupId>
-      <artifactId>broker-features</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <groupId>org.apache.activemq.examples.broker</groupId>
-   <artifactId>jms-examples</artifactId>
-   <packaging>pom</packaging>
-   <name>ActiveMQ Artemis Standard Examples</name>
-
-   <properties>
-      <udp-address>231.7.7.7</udp-address>
-      <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
-   </properties>
-
-   <profiles>
-      <profile>
-         <id>release</id>
-         <modules>
-            <module>bridge</module>
-            <module>browser</module>
-            <module>client-kickoff</module>
-            <module>consumer-rate-limit</module>
-            <module>dead-letter</module>
-            <module>delayed-redelivery</module>
-            <module>divert</module>
-            <module>durable-subscription</module>
-            <module>embedded</module>
-            <module>embedded-simple</module>
-            <module>expiry</module>
-            <module>http-transport</module>
-            <module>interceptor</module>
-            <module>instantiate-connection-factory</module>
-            <module>jms-auto-closeable</module>
-            <module>jms-bridge</module>
-            <module>jms-completion-listener</module>
-            <module>jms-context</module>
-            <module>jms-shared-consumer</module>
-            <module>jmx</module>
-            <module>large-message</module>
-            <module>last-value-queue</module>
-            <module>management</module>
-            <module>management-notifications</module>
-            <module>message-counters</module>
-            <module>message-group</module>
-            <module>message-group2</module>
-            <module>message-priority</module>
-            <module>no-consumer-buffering</module>
-            <module>paging</module>
-            <module>pre-acknowledge</module>
-            <module>producer-rate-limit</module>
-            <module>queue</module>
-            <module>queue-requestor</module>
-            <module>queue-selector</module>
-            <module>reattach-node</module>
-            <module>rest</module>
-            <module>request-reply</module>
-            <module>scheduled-message</module>
-            <module>security</module>
-            <module>send-acknowledgements</module>
-            <module>spring-integration</module>
-            <module>ssl-enabled</module>
-            <module>static-selector</module>
-            <module>temp-queue</module>
-            <module>topic</module>
-            <module>topic-hierarchies</module>
-            <module>topic-selector-example1</module>
-            <module>topic-selector-example2</module>
-            <module>transactional</module>
-            <module>xa-heuristic</module>
-            <module>xa-receive</module>
-            <module>xa-send</module>
-         </modules>
-      </profile>
-      <profile>
-         <id>examples</id>
-         <modules>
-            <module>bridge</module>
-            <module>browser</module>
-            <module>client-kickoff</module>
-            <module>consumer-rate-limit</module>
-            <module>dead-letter</module>
-            <module>delayed-redelivery</module>
-            <module>divert</module>
-            <module>durable-subscription</module>
-            <module>embedded</module>
-            <module>embedded-simple</module>
-            <module>expiry</module>
-            <module>http-transport</module>
-            <module>interceptor</module>
-            <module>jms-auto-closeable</module>
-            <module>instantiate-connection-factory</module>
-            <module>jms-bridge</module>
-            <module>jms-completion-listener</module>
-            <module>jms-context</module>
-            <module>jms-shared-consumer</module>
-            <module>jmx</module>
-            <module>large-message</module>
-            <module>last-value-queue</module>
-            <module>management</module>
-            <module>management-notifications</module>
-            <module>message-counters</module>
-            <module>message-group</module>
-            <module>message-group2</module>
-            <module>message-priority</module>
-            <module>no-consumer-buffering</module>
-            <module>paging</module>
-            <module>pre-acknowledge</module>
-            <module>producer-rate-limit</module>
-            <module>queue</module>
-            <module>queue-requestor</module>
-            <module>queue-selector</module>
-            <module>reattach-node</module>
-
-            <module>request-reply</module>
-            <module>rest</module>
-            <module>scheduled-message</module>
-            <module>security</module>
-            <module>send-acknowledgements</module>
-            <module>spring-integration</module>
-
-            <!-- ARTEMIS-197 FIX ME
-                 this one could be the case of leaving it out for good
-                 as it may require to be run manually
-            <module>ssl-enabled</module> -->
-
-            <module>static-selector</module>
-
-            <!--this needs to be run standalone as it needs manual intervention-->
-            <!--<module>stop-server-failover</module>-->
-
-            <module>temp-queue</module>
-            <module>topic</module>
-            <module>topic-hierarchies</module>
-            <module>topic-selector-example1</module>
-            <module>topic-selector-example2</module>
-            <module>transactional</module>
-            <module>xa-heuristic</module>
-            <module>xa-receive</module>
-            <module>xa-send</module>
-         </modules>
-      </profile>
-
-   </profiles>
-
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/pre-acknowledge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/pre-acknowledge/pom.xml b/examples/broker-features/standard/pre-acknowledge/pom.xml
deleted file mode 100644
index c5da1a5..0000000
--- a/examples/broker-features/standard/pre-acknowledge/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>pre-acknowledge</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Pre Acknowledge 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>
-                     <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.PreacknowledgeExample</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>pre-acknowledge</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/pre-acknowledge/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/pre-acknowledge/readme.html b/examples/broker-features/standard/pre-acknowledge/readme.html
deleted file mode 100644
index 235c278..0000000
--- a/examples/broker-features/standard/pre-acknowledge/readme.html
+++ /dev/null
@@ -1,154 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Pre-Acknowledge 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 Pre-Acknowledge 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>Standard JMS supports three acknowledgement modes: AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, and
-     DUPS_OK_ACKNOWLEDGE. For a full description on these modes please consult the JMS specification, or any
-     JMS tutorial.</p>
-     <p>All of these standard modes involve sending acknowledgements from the client to the server. However
-     in some cases, you really don't mind losing messages in event of failure, so it would make sense
-     to acknowledge the message on the server <b>before</b> delivering it to the client.</p>
-     <p>By acknowledging the message before sending to the client, you can avoid extra network traffic and CPU
-     work done in sending acknowledgements from client to server.</p>
-     <p>The down-side of acknowledging on the server before delivery, is that if the system crashes after acknowledging
-     the message, but before the message has been received by the client, then, on recovery, that message
-     will be lost. This makes pre-acknowledgement not appropriate for all use cases, but it is very useful for some
-     use-cases when you can cope with such loss of messages<p>
-     <p>An example of a use-case where it might be a good idea to use pre-acknowledge, is for stock price update
-     messages. With these messages it might be ok to lose a message in event of crash, since the next price
-     update message will arrive soon, overriding the previous price.</p>
-     <p>In order to use pre-acknowledge functionality with ActiveMQ Artemis the session has to be created with
-     a special, ActiveMQ Artemis specific acknowledgement mode, given by the value of
-     <code>ActiveMQJMSConstants.PRE_ACKNOWLEDGE</code>.
-     <h2>Example step-by-step</h2>
-
-     <ol>
-        <li>Create an initial context to perform the JNDI lookup.</li>
-        <pre class="prettyprint">
-           <code>
-     initialContext = getContext(0);
-     </code>
-        </pre>
-
-        <li>Perform the look-ups</li>
-        <pre class="prettyprint">
-           <code>
-     Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-
-     ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>Create a the JMS objects.</li>
-        <pre class="prettyprint">
-           <code>
-     connection = cf.createConnection();
-
-     Session session = connection.createSession(false, ActiveMQSession.PRE_ACKNOWLEDGE);
-
-     MessageProducer producer = session.createProducer(queue);
-
-     MessageConsumer messageConsumer = session.createConsumer(queue);
-           </code>
-        </pre>
-
-        <li>Create and send a message.</li>
-        <pre class="prettyprint">
-           <code>
-     TextMessage message1 = session.createTextMessage("This is a text message 1");
-
-     producer.send(message1);
-
-     System.out.println("Sent message: " + message1.getText());
-           </code>
-        </pre>
-
-        <li>Print out the message count of the queue. The queue contains one message as expected
-        delivery has not yet started on the queue.</li>
-        <pre class="prettyprint">
-           <code>
-     int count = getMessageCount(connection);
-
-     System.out.println("Queue message count is " + count);
-           </code>
-        </pre>
-
-        <li>Start the Connection, delivery will now start. Give a little time for delivery to occur.</li>
-        <pre class="prettyprint">
-          <code>
-     connection.start();
-
-     Thread.sleep(1000);
-          </code>
-       </pre>
-
-        <li>Print out the message count of the queue. It should now be zero, since the message has
-         already been acknowledged even before the consumer has received it.</li>
-        <pre class="prettyprint">
-           <code>
-     count = getMessageCount(connection);
-
-     System.out.println("Queue message count is now " + count);
-           </code>
-        </pre>
-
-        <li>Finally, receive the message.</li>
-        <pre class="prettyprint">
-           <code>
-     TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
-
-     System.out.println("Received message: " + messageReceived.getText());
-           </code>
-        </pre>
-
-        <li>Be sure to close our resources!</li>
-          <pre class="prettyprint">
-           <code>
-     if (initialContext != null)
-     {
-        initialContext.close();
-     }
-     if (connection != null)
-     {
-        connection.close();
-     }
-           </code>
-        </pre>
-     </ol>
-
-     <h2>More information</h2>
-
-     <ul>
-         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#pre-acknowledge">Pre-acknowledgement Mode chapter</a></li>
-     </ul>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java b/examples/broker-features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java
deleted file mode 100644
index 834b54a..0000000
--- a/examples/broker-features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java
+++ /dev/null
@@ -1,126 +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.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueRequestor;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSConstants;
-import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * This example demonstrates the use of ActiveMQ Artemis "pre-acknowledge" functionality where
- * messages are acknowledged before they are delivered to the consumer.
- *
- * Please see the readme.html for more details.
- */
-public class PreacknowledgeExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection connection = null;
-      try {
-
-         // Step 2. instantiate the queue object
-         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
-         // new connection factory
-         ConnectionFactory cf = new ActiveMQConnectionFactory();
-
-         // Step 3. Create a the JMS objects
-         connection = cf.createConnection();
-
-         Session session = connection.createSession(false, ActiveMQJMSConstants.PRE_ACKNOWLEDGE);
-
-         MessageProducer producer = session.createProducer(queue);
-
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-
-         // Step 4. Create and send a message
-         TextMessage message1 = session.createTextMessage("This is a text message 1");
-
-         producer.send(message1);
-
-         System.out.println("Sent message: " + message1.getText());
-
-         // Step 5. Print out the message count of the queue. The queue contains one message as expected
-         // delivery has not yet started on the queue
-         int count = getMessageCount(connection);
-
-         System.out.println("Queue message count is " + count);
-
-         // Step 6. Start the Connection, delivery will now start. Give a little time for delivery to occur.
-         connection.start();
-
-         Thread.sleep(1000);
-
-         // Step 7. Print out the message countof the queue. It should now be zero, since the message has
-         // already been acknowledged even before the consumer has received it.
-         count = getMessageCount(connection);
-
-         System.out.println("Queue message count is now " + count);
-
-         if (count != 0) {
-            throw new IllegalStateException("Queue message count is not 0.");
-         }
-
-         // Step 8. Finally, receive the message
-         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-
-         System.out.println("Received message: " + messageReceived.getText());
-      }
-      finally {
-         // Step 9. Be sure to close our resources!
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-
-   // To do this we send a management message to get the message count.
-   // In real life you wouldn't create a new session every time you send a management message
-   private static int getMessageCount(final Connection connection) throws Exception {
-      QueueSession session = ((QueueConnection) connection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-
-      Queue managementQueue = ActiveMQJMSClient.createQueue("activemq.management");
-
-      QueueRequestor requestor = new QueueRequestor(session, managementQueue);
-
-      connection.start();
-
-      Message m = session.createMessage();
-
-      JMSManagementHelper.putAttribute(m, "jms.queue.exampleQueue", "messageCount");
-
-      Message response = requestor.request(m);
-
-      int messageCount = (Integer) JMSManagementHelper.getResult(response);
-
-      return messageCount;
-   }
-
-}

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

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index f29acbc..0000000
--- a/examples/broker-features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?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.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <security-setting match="jms.#">
-            <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">
-            <permission type="manage" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/pre-acknowledge/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/pre-acknowledge/src/main/resources/jndi.properties b/examples/broker-features/standard/pre-acknowledge/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/pre-acknowledge/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/producer-rate-limit/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/producer-rate-limit/pom.xml b/examples/broker-features/standard/producer-rate-limit/pom.xml
deleted file mode 100644
index 91b7603..0000000
--- a/examples/broker-features/standard/producer-rate-limit/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>producer-rate-limit</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Producer Rate Limit 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>
-                     <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.ProducerRateLimitExample</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>producer-rate-limit</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/producer-rate-limit/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/producer-rate-limit/readme.html b/examples/broker-features/standard/producer-rate-limit/readme.html
deleted file mode 100644
index 7e10ca3..0000000
--- a/examples/broker-features/standard/producer-rate-limit/readme.html
+++ /dev/null
@@ -1,176 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Message Producer Rate Limiting</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 Message Producer Rate Limiting</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>With ActiveMQ Artemis you can specify a maximum send rate at which a JMS MessageProducer will send messages.
-     This can be specified when creating or deploying the connection factory. See <code>activemq-jms.xml</code></p>
-     <p>If this value is specified then ActiveMQ Artemis will ensure that messages are never produced at a rate higher than
-     specified. This is a form of producer <i>throttling</i>.</p>
-     <h2>Example step-by-step</h2>
-     <p>In this example we specify a <code>producer-max-rate</code> of <code>50</code> messages per second in the <code>activemq-jms.xml</code>
-     file when deploying the connection factory:</p>
-     <pre class="prettyprint">
-     <code>
-   &lt;connection-factory name="ConnectionFactory"&gt;
-      &lt;connector-ref connector-name="netty-connector"/&gt;
-      &lt;entries&gt;
-         &lt;entry name="ConnectionFactory"/&gt;
-      &lt;/entries&gt;
-
-      &lt;!-- We limit producers created on this connection factory to produce messages at a maximum rate
-      of 50 messages per sec --&gt;
-      &lt;producer-max-rate&gt;50&lt;/producer-max-rate&gt;
-
-   &lt;/connection-factory&gt;
-     </code>
-     </pre>
-     <p>We then simply send as many messages as we can in 10 seconds and note how many messages are actually sent.</p>
-     <p>We note that the number of messages sent per second never exceeds the specified value of <code>50</code> messages per second.</p>
-
-     <ol>
-        <li>Create an initial context to perform the JNDI lookup.</li>
-        <pre class="prettyprint">
-           <code>initialContext = getContext(0);</code>
-        </pre>
-
-        <li>Perfom a lookup on the queue</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>Perform a lookup on the Connection Factory</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>Create a JMS Connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>Create a JMS Session</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>Create a JMS Message Producer</li>
-        <pre class="prettyprint">
-          <code>MessageProducer producer = session.createProducer(queue);</code>
-        </pre>
-
-        <li>Send as many messages as we can in 10 seconds</li>
-        <pre class="prettyprint">
-           <code>
-        final long duration = 10000;
-
-        int i = 0;
-
-        long start = System.currentTimeMillis();
-
-        while (System.currentTimeMillis() - start <= duration)
-        {
-           TextMessage message = session.createTextMessage("This is text message: " + i++);
-
-           producer.send(message);
-        }
-
-        long end = System.currentTimeMillis();
-
-        double rate = 1000 * (double)i / (end - start);
-
-        System.out.println("We sent " + i + " messages in " + (end - start) + " milliseconds");
-
-        System.out.println("Actual send rate was " + rate + " messages per second");
-           </code>
-        </pre>
-
-        <li>We note that the sending rate doesn't exceed 50 messages per second. Here's some example output from a real
-        run</li>
-
-        <pre class="prettyprint">
-           <code>
-     [java] Will now send as many messages as we can in 10 seconds...
-     [java] We sent 500 messages in 10072 milliseconds
-     [java] Actual send rate was 49.64257347100874 messages per second
-           </code>
-        </pre>
-
-
-        <li>For good measure we consumer the messages we produced.</li>
-        <pre class="prettyprint">
-           <code>
-        MessageConsumer messageConsumer = session.createConsumer(queue);
-
-        connection.start();
-
-        System.out.println("Now consuming the messages...");
-
-        i = 0;
-        while (true)
-        {
-           TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
-
-           if (messageReceived == null)
-           {
-              break;
-           }
-
-           i++;
-        }
-
-        System.out.println("Received " + i + " messages");
-
-           </code>
-        </pre>
-
-        <li>Be sure to close our resources!</li>
-
-        <pre class="prettyprint">
-           <code>
-           finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
-  </body>
-</html>


[12/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-bridge/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-bridge/readme.html b/examples/features/standard/jms-bridge/readme.html
new file mode 100644
index 0000000..1ee0ff6
--- /dev/null
+++ b/examples/features/standard/jms-bridge/readme.html
@@ -0,0 +1,246 @@
+<!--
+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 Bridge 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 Bridge 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 create a JMS Bridge between two ActiveMQ Artemis servers.</p>
+     <img src="jms-bridge.png"  />
+     <p>The example will use two ActiveMQ Artemis servers:</p>
+     <ul>
+        <li>Server #0 &ndash; the <em>Source</em> server. It will be configured with a JMS Topic bound to JNDI under <code>source/topic</code>
+        <li>Server #1 &ndash; the <em>Target</em> server. It will be configured with a JMS Queue bound to JNDI under <code>target/queue</code><br />
+     </ul>
+     <p>Both ActiveMQ Artemis server will run their own JNDI server used by the JMS Bridge and the JMS Client to lookup JMS
+        resources (ConnectionFactory and Destination).</p>
+     <p>The JMS Bridge will be started in the example code and be configured to bridge messages from the <em>source</em> destination
+     (the topic hosted on server #0) and the <em>target</em> destination (the queue hosted on server #1)</p>
+     <p>The client will check the bridge works by:</p>
+     <ol>
+        <li>sending a message to the <em>source</em> topic</li>
+        <li>receive a message from the <em>target</em> queue</li>
+        <li>check that both messages correspond to the same content.</li>
+     </ol>
+     <h3>JMS Bridge Configuration</h3>
+     <p>The JMS Bridge is a <abbr title="Plain Old Java Object">POJO</abbr> that we configure with both source and target
+        JNDI configurations. In the actual example we are programatically creating the Bridge, however the following section
+        describes how you would do this if you wanted to deploy with an actual ActiveMQ Artemis server via the activemq-beans.xml.
+
+     <h4>Configuring the Bridge with the JBoss Microcontainer</h4>
+     <p>
+        in which we inject JNDI configurations
+        so that it looks up its source and target JMS resources.
+        The JMS Bridge is defined a bean and setup by JBoss Microntainer in the same VM than Server #1, the target server.</p>
+
+      </p>The JMS Bridge sample configuration can be found in <code>resources/activemq-beans.xml</code>, firstly we define the
+     Bridge itself:</p>
+      <pre class="prettyprint">
+         &lt;!-- The JMS Bridge -->
+         &lt;bean name="JMSBridge" class="org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl">
+         ...
+         &lt;/bean>
+      </pre>
+      <p>the <code>JMSBridgeImpl</code> constructor is used to inject all the properties required to run the JMS Bridge.</p>
+      <p>Its first four arguments defines how the bridge will lookup:</p>
+      <ol>
+         <li>its <em>source</em> JMS ConnectionFactory</li>
+         <li>its <em>source</em> JMS Destination</li>
+         <li>its <em>target</em> JMS ConnectionFactory</li>
+         <li>its <em>target</em> JMS Destination</li>
+     </ol>
+     <p>Using other POJOs, the JMS Bridge is configured to retrieve:</p>
+     <ul>
+        <li>its <em>source</em> JMS ConnectionFactory by looking up <code>/source/ConnectionFactory</code> using
+           the <code>SourceJNDI</code> configuration</li>
+        <li>its <em>source</em> JMS Destination by looking up <code>/source/topic</code> using
+           the <code>SourceJNDI</code> configuration</li>
+        <li>its <em>target</em> JMS ConnectionFactory by looking up <code>/target/ConnectionFactory</code> using
+           the <code>TargetJNDI</code> configuration</li>
+           <li>its <em>target</em> JMS ConnectionFactory by looking up <code>/target/queue</code> using
+        the <code>TargetJNDI</code> configuration</li>
+     </ul>
+     <p>In turn, <code>SourceJNDI</code> and <code>TargetJNDI</code> are POJOs defining how to connect to JNDI server.
+        SourceJNDI URL must point to your source server, while LocalJNDI must point to your target server:</p>
+   <pre class="prettyprint">
+      &lt;bean name="SourceJNDI" class="java.util.Hashtable">
+         ...
+                &lt;entry>
+                   &lt;key>java.naming.provider.url&lt;/key>
+                   &lt;!-- **************************************** -->
+                   &lt;!-- Replace with the *source* server address -->
+                   &lt;!-- **************************************** -->
+                   &lt;value>jnp://192.168.0.10:1099&lt;/value>
+         ...
+       &lt;/bean>
+       &lt;bean name="TargetJNDI" class="java.util.Hashtable">
+         ...
+                &lt;ntry>
+                   &lt;key>java.naming.provider.url&lt;/key>
+                   &lt;!-- **************************************** -->
+                   &lt;!-- Replace with the *target* server address -->
+                   &lt;!-- **************************************** -->
+                   &lt;value>jnp://1192.168.0.11:1099&lt;/value>
+                &lt;/entry>
+         ...
+       &lt;/bean>
+      </pre>
+     <h2>Example step-by-step</h2>
+     <p>To run the example after having setup both ActiveMQ Artemis servers and the JMS bridge:</p>
+     <ol>
+        <li>To run the example simply run <code>mvn verify -Pexample</code></li>
+     </ol>
+      <p>Let's look at the Client code (in <code>JMSBridgeExample</code> class):</p>
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS resources</li>
+        <pre class="prettyprint">
+           InitialContext sourceContext = createContext(sourceServer);
+           InitialContext targetContext = createContext(targetServer);
+        </pre>
+        <li>We then create a JMS Bridge and start it, Note, for certain quality of service modes such as
+            ONCE_AND_ONCE_ONLY and AT_LEAST_ONCE a Transaction Manager is required to ensure Messages are delivered
+            accordingly.  A Transaction Manager can be either loaded via implementation of TransactionManagerLocator intefer
+            and loaded via standard a ServiceLoader or by explicitly setting an instance of a Transaction Manager on the
+            bridge using setTranscationManager(TransactionManager tm) method.  In this example we'll be using the DUPLICATES_OK
+            quality of service so there is no need for a Transaction Manager.
+        <pre class="prettyprint">
+            JMSBridge jmsBridge = new JMSBridgeImpl(
+               new JNDIConnectionFactoryFactory(sourceJndiParams, "source/ConnectionFactory"),
+               new JNDIConnectionFactoryFactory(targetJndiParams, "target/ConnectionFactory"),
+               new JNDIDestinationFactory(sourceJndiParams, "source/topic"),
+               new JNDIDestinationFactory(targetJndiParams, "target/queue"),
+               null,
+               null,
+               null,
+               null,
+               null,
+               5000,
+               10,
+               QualityOfServiceMode.DUPLICATES_OK,
+               1,
+               -1,
+               null,
+               null,
+               true);
+            ....
+        jmsBridge.start();
+        </pre>
+        <li>We look up the JMS resources from the Source server</li>
+        <pre class="prettyprint">
+           ConnectionFactory sourceConnectionFactory = (ConnectionFactory)sourceContext.lookup("source/ConnectionFactory");
+           Topic sourceTopic = (Topic)sourceContext.lookup("source/topic");
+        </pre>
+
+        <li>We create JMS objects to send a message to the source destination</li>
+        <pre class="prettyprint">
+           sourceConnection = sourceConnectionFactory.createConnection();
+           Session sourceSession = sourceConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+           MessageProducer sourceProducer = sourceSession.createProducer(sourceTopic);
+        </pre>
+
+        <li>We send a message to the source destination</li>
+        <pre class="prettyprint">
+           TextMessage message = sourceSession.createTextMessage("this is a text message sent at " + System.currentTimeMillis());
+           sourceProducer.send(message);
+        </pre>
+
+        <li>We close the connection to the source server</li>
+        <pre class="prettyprint">
+           sourceConnection.close();
+        </pre>
+
+        <p>At this point, the JMS Bridge will consume the message from the source topic and
+           sends it to the target queue.
+           The client will check the bridge works by consuming a message from the target queue.</p>
+
+        <li>We look up the JMS resources from the target server</li>
+        <pre class="prettyprint">
+           ConnectionFactory targetConnectionFactory = (ConnectionFactory)targetContext.lookup("target/ConnectionFactory");
+           Queue targetQueue = (Queue)targetContext.lookup("target/queue");
+        </pre>
+
+        <li>We create JMS objects to receive a message from the target destination</li>
+        <pre class="prettyprint">
+           targetConnection = targetConnectionFactory.createConnection();
+           Session targetSession = targetConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+           MessageConsumer targetConsumer = targetSession.createConsumer(targetQueue);
+       </pre>
+
+        <li>We start the target connection to start receiving messages
+        <pre class="prettyprint">
+           targetConnection.start();
+        </pre>
+
+        <li>We receive the message and print it. Its content is the same than the message
+           the client sent to the source topic</li>
+        <pre class="prettyprint">
+           TextMessage messageReceived = (TextMessage)targetConsumer.receive(5000);
+        </pre>
+
+        <li>We display the message ID and its "bridged" message ID</li>
+        <pre class="prettyprint">
+           System.out.format("Message ID         : %s\n", messageReceived.getJMSMessageID());
+           System.out.format("Bridged Message ID : %s\n", messageReceived.getStringProperty("AMQ_BRIDGE_MSG_ID_LIST"));
+        </pre>
+
+        <p>Note that the message received from the target queue is <em>not the same message</em> sent to the source topic
+           (their message IDs are different) but they have the <em>same content</em>.
+
+        <li>And finally, we stop the Bridge and <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 (jmsBridge != null)
+              {
+                jmsBridge.stop();
+              }
+              if (initialContext != null)
+              {
+                initialContext.close();
+              }
+              if (connection != null)
+              {
+                 connection.close();
+              }
+           }</code>
+        </pre>
+
+
+
+     </ol>
+
+     <h2>More information</h2>
+
+     <ul>
+        <li>User Manual's <a href="../../../docs/user-manual/en/html_single/appserver-integration.html#jms-bridge">JMS Bridge chapter</a></li>
+        <li>The <a href="../../javaee/jms-bridge/readme.html">Java EE JMS Bridge example</a> shows how to configure a JMS Bridge
+           inside JBoss Application Server to bridge destinations from the same server.</a>
+     </p>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java b/examples/features/standard/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java
new file mode 100644
index 0000000..8a65cd5
--- /dev/null
+++ b/examples/features/standard/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java
@@ -0,0 +1,136 @@
+/*
+ * 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.jms.Topic;
+import javax.naming.InitialContext;
+import java.util.Hashtable;
+
+import org.apache.activemq.artemis.jms.bridge.JMSBridge;
+import org.apache.activemq.artemis.jms.bridge.QualityOfServiceMode;
+import org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl;
+import org.apache.activemq.artemis.jms.bridge.impl.JNDIConnectionFactoryFactory;
+import org.apache.activemq.artemis.jms.bridge.impl.JNDIDestinationFactory;
+
+/**
+ * An example which sends a message to a source topic and consume from a target queue.
+ * The source and target destinations are located on 2 different ActiveMQ Artemis server.
+ * The source and target queues are bridged by a JMS Bridge configured and running on the "target" server.
+ */
+public class JMSBridgeExample {
+
+   public static void main(final String[] args) throws Exception {
+      String sourceServer = "tcp://localhost:61616";
+      String targetServer = "tcp://localhost:61617";
+
+      System.out.println("client will publish messages to " + sourceServer +
+                            " and receives message from " +
+                            targetServer);
+
+      // Step 1. Create JNDI contexts for source and target servers
+      InitialContext sourceContext = JMSBridgeExample.createContext(sourceServer);
+      InitialContext targetContext = JMSBridgeExample.createContext(targetServer);
+
+      Hashtable<String, String> sourceJndiParams = createJndiParams(sourceServer);
+      Hashtable<String, String> targetJndiParams = createJndiParams(targetServer);
+      // Step 2. Create and start a JMS Bridge
+      // Note, the Bridge needs a transaction manager, in this instance we will use the JBoss TM
+      JMSBridge jmsBridge = new JMSBridgeImpl(new JNDIConnectionFactoryFactory(sourceJndiParams, "ConnectionFactory"), new JNDIConnectionFactoryFactory(targetJndiParams, "ConnectionFactory"), new JNDIDestinationFactory(sourceJndiParams, "source/topic"), new JNDIDestinationFactory(targetJndiParams, "target/queue"), null, null, null, null, null, 5000, 10, QualityOfServiceMode.DUPLICATES_OK, 1, -1, null, null, true);
+
+      Connection sourceConnection = null;
+      Connection targetConnection = null;
+      try {
+         jmsBridge.start();
+         // Step 3. Lookup the *source* JMS resources
+         ConnectionFactory sourceConnectionFactory = (ConnectionFactory) sourceContext.lookup("ConnectionFactory");
+         Topic sourceTopic = (Topic) sourceContext.lookup("source/topic");
+
+         // Step 4. Create a connection, a session and a message producer for the *source* topic
+         sourceConnection = sourceConnectionFactory.createConnection();
+         Session sourceSession = sourceConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer sourceProducer = sourceSession.createProducer(sourceTopic);
+
+         // Step 5. Create and send a text message to the *source* queue
+         TextMessage message = sourceSession.createTextMessage("this is a text message sent at " + System.currentTimeMillis());
+         sourceProducer.send(message);
+         System.out.format("Sent message to %s: %s%n", ((Topic) message.getJMSDestination()).getTopicName(), message.getText());
+         System.out.format("Message ID : %s%n", message.getJMSMessageID());
+
+         // Step 6. Close the *source* connection
+         sourceConnection.close();
+
+         // Step 7. Lookup the *target* JMS resources
+         ConnectionFactory targetConnectionFactory = (ConnectionFactory) targetContext.lookup("ConnectionFactory");
+         Queue targetQueue = (Queue) targetContext.lookup("target/queue");
+
+         // Step 8. Create a connection, a session and a message consumer for the *target* queue
+         targetConnection = targetConnectionFactory.createConnection();
+         Session targetSession = targetConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer targetConsumer = targetSession.createConsumer(targetQueue);
+
+         // Step 9. Start the connection to receive messages from the *target* queue
+         targetConnection.start();
+
+         // Step 10. Receive a message from the *target* queue
+         TextMessage messageReceived = (TextMessage) targetConsumer.receive(5000);
+         System.out.format("%nReceived from %s: %s%n", ((Queue) messageReceived.getJMSDestination()).getQueueName(), messageReceived.getText());
+
+         // Step 11. Display the received message's ID and this "bridged" message ID
+         System.out.format("Message ID         : %s%n", messageReceived.getJMSMessageID());
+         System.out.format("Bridged Message ID : %s%n", messageReceived.getStringProperty("AMQ_BRIDGE_MSG_ID_LIST"));
+      }
+      finally {
+         // Step 12. Be sure to close the resources!
+         if (jmsBridge != null) {
+            jmsBridge.stop();
+         }
+         if (sourceContext != null) {
+            sourceContext.close();
+         }
+         if (targetContext != null) {
+            targetContext.close();
+         }
+         if (sourceConnection != null) {
+            sourceConnection.close();
+         }
+         if (targetConnection != null) {
+            targetConnection.close();
+         }
+      }
+   }
+
+   private static InitialContext createContext(final String server) throws Exception {
+      Hashtable<String, String> jndiProps = createJndiParams(server);
+      return new InitialContext(jndiProps);
+   }
+
+   private static Hashtable<String, String> createJndiParams(String server) {
+      Hashtable<String, String> jndiProps = new Hashtable<String, String>();
+      jndiProps.put("connectionFactory.ConnectionFactory", server);
+      jndiProps.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
+      jndiProps.put("queue.target/queue", "target");
+      jndiProps.put("topic.source/topic", "topic");
+      return jndiProps;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/jms-bridge/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/jms-bridge/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/6b17d966/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..df456d7
--- /dev/null
+++ b/examples/features/standard/jms-bridge/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,53 @@
+<?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">
+      <topic name="topic"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+
+      <acceptors>
+         <acceptor name="netty">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <security-settings>
+         <security-setting match="jms.#">
+            <permission type="consume" roles="guest"/>
+            <permission type="send" roles="guest"/>
+            <permission type="createNonDurableQueue" roles="guest"/>
+            <permission type="deleteNonDurableQueue" roles="guest"/>
+         </security-setting>
+      </security-settings>
+   </core>
+</configuration>
+

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/artemis-roles.properties b/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/artemis-users.properties b/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/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/6b17d966/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/broker.xml b/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..e65720c
--- /dev/null
+++ b/examples/features/standard/jms-bridge/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,53 @@
+<?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">
+      <queue name="target"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+
+      <acceptors>
+         <acceptor name="netty">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <security-settings>
+         <security-setting match="jms.#">
+            <permission type="consume" roles="guest"/>
+            <permission type="send" roles="guest"/>
+            <permission type="createNonDurableQueue" roles="guest"/>
+            <permission type="deleteNonDurableQueue" roles="guest"/>
+         </security-setting>
+      </security-settings>
+   </core>
+</configuration>
+

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-completion-listener/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-completion-listener/pom.xml b/examples/features/standard/jms-completion-listener/pom.xml
new file mode 100644
index 0000000..139432f
--- /dev/null
+++ b/examples/features/standard/jms-completion-listener/pom.xml
@@ -0,0 +1,110 @@
+<?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>completion-listener</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Completion Listener 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>${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.JMSCompletionListenerExample</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>completion-listener</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-completion-listener/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-completion-listener/readme.html b/examples/features/standard/jms-completion-listener/readme.html
new file mode 100644
index 0000000..36be17a
--- /dev/null
+++ b/examples/features/standard/jms-completion-listener/readme.html
@@ -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.
+-->
+
+<html>
+  <head>
+    <title>ActiveMQ Artemis JMS Completion Listener 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 Completion Listener 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 a message asynchronously to ActiveMQ Artemis and use a CompletionListener to be notified of
+     the Broker receiving it</p>
+
+     <h2>Example step-by-step</h2>
+
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
+        <pre class="prettyprint">
+           <code>InitialContext initialContext = getContext();</code>
+        </pre>
+
+        <li>We look-up the JMS queue object from JNDI</li>
+        <pre class="prettyprint">
+           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>We look-up the JMS connection factory object from JNDI</li>
+        <pre class="prettyprint">
+           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>We create a JMS context</li>
+        <pre class="prettyprint">
+           <code>jmsContext = cf.createContext();</code>
+        </pre>
+
+        <li>We create a JMS Producer.</li>
+        <pre class="prettyprint">
+           <code>JMSProducer producer = jmsContext.createProducer();</code>
+        </pre>
+
+        <li>We set a CompletionListener on the Producer</li>
+        <pre class="prettyprint">
+          <code>producer.setAsync(new CompletionListener()
+                {
+                   @Override
+                   public void onCompletion(Message message)
+                   {
+                      System.out.println("message acknowledged by ActiveMQ");
+                      latch.countDown();
+                   }
+
+                   @Override
+                   public void onException(Message message, Exception e)
+                   {
+                      e.printStackTrace();
+                   }
+                });</code>
+       </pre>
+
+        <li>We send a message</li>
+        <pre class="prettyprint">
+           <code>producer.send(queue, "this is a string");</code>
+        </pre>
+
+         <li> and then wait for the Completion Listener to be called</li>
+        <pre class="prettyprint">
+           <code>return latch.await(5, TimeUnit.SECONDS);</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 (jmsContext != null)
+              {
+                 jmsContext.close();
+              }
+           }</code>
+        </pre>
+
+
+
+     </ol>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java b/examples/features/standard/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java
new file mode 100644
index 0000000..4688ba3
--- /dev/null
+++ b/examples/features/standard/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java
@@ -0,0 +1,82 @@
+/*
+ * 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.CompletionListener;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSContext;
+import javax.jms.JMSProducer;
+import javax.jms.Message;
+import javax.jms.Queue;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * A JMS Completion Listener Example.
+ */
+public class JMSCompletionListenerExample {
+
+   public static void main(final String[] args) throws Exception {
+      JMSContext jmsContext = null;
+      try {
+         // Step 2. Perfom a lookup on the queue
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // Step 3. Perform a lookup on the Connection Factory
+         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?confirmationWindowSize=10240");
+
+         // Step 4.Create a JMS Context
+         jmsContext = cf.createContext();
+
+         // Step 5. Create a message producer.
+         JMSProducer producer = jmsContext.createProducer();
+
+         final CountDownLatch latch = new CountDownLatch(1);
+
+         //Step 6. We want to send the message Asynchronously and be notified when the Broker receives it so we set a completion handler
+         producer.setAsync(new CompletionListener() {
+            @Override
+            public void onCompletion(Message message) {
+               System.out.println("message acknowledged by ActiveMQ");
+               latch.countDown();
+            }
+
+            @Override
+            public void onException(Message message, Exception e) {
+               e.printStackTrace();
+            }
+         });
+
+         //Step 6. Send the Message
+         producer.send(queue, "this is a string");
+
+         //Step 7. wait for the Completion handler
+         if (!latch.await(5, TimeUnit.SECONDS)) {
+            throw new IllegalStateException("Completion listener not called as expected.");
+         }
+      }
+      finally {
+         if (jmsContext != null) {
+            jmsContext.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-completion-listener/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-completion-listener/src/main/resources/jndi.properties b/examples/features/standard/jms-completion-listener/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/jms-completion-listener/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/6b17d966/examples/features/standard/jms-context/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-context/pom.xml b/examples/features/standard/jms-context/pom.xml
new file mode 100644
index 0000000..1f3e017
--- /dev/null
+++ b/examples/features/standard/jms-context/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>context</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Context 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>
+                     <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.JMSContextExample</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>context</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-context/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-context/readme.html b/examples/features/standard/jms-context/readme.html
new file mode 100644
index 0000000..34895a2
--- /dev/null
+++ b/examples/features/standard/jms-context/readme.html
@@ -0,0 +1,35 @@
+<!--
+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 Context 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 Context 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 by using a JMS Context</p>
+     <p>A JMSContext is part of JMS 2.0 and combines the JMS Connection and Session Objects into a simple Interface</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java b/examples/features/standard/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java
new file mode 100644
index 0000000..d2a341c
--- /dev/null
+++ b/examples/features/standard/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.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.
+ */
+package org.apache.activemq.artemis.jms.example;
+
+import javax.jms.DeliveryMode;
+import javax.jms.JMSContext;
+import javax.jms.Queue;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * A simple JMS Queue example that creates a producer and consumer on a queue and sends then receives a message.
+ */
+public class JMSContextExample {
+
+   public static void main(final String[] args) throws Exception {
+      // Instantiate the queue
+      Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+      // Instantiate the ConnectionFactory (Using the default URI on this case)
+      // Also instantiate the jmsContext
+      // Using closeable interface
+      try (ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
+           JMSContext jmsContext = cf.createContext()) {
+         // Create a message producer, note that we can chain all this into one statement
+         jmsContext.createProducer().setDeliveryMode(DeliveryMode.PERSISTENT).send(queue, "this is a string");
+
+         // Create a Consumer and receive the payload of the message direct.
+         String payLoad = jmsContext.createConsumer(queue).receiveBody(String.class);
+
+         System.out.println("payLoad = " + payLoad);
+
+      }
+
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-shared-consumer/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-shared-consumer/pom.xml b/examples/features/standard/jms-shared-consumer/pom.xml
new file mode 100644
index 0000000..e5fa1ce
--- /dev/null
+++ b/examples/features/standard/jms-shared-consumer/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>shared-consumer</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Shared Consumer 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.JMSSharedConsumerExample</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>shared-consumer</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-shared-consumer/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-shared-consumer/readme.html b/examples/features/standard/jms-shared-consumer/readme.html
new file mode 100644
index 0000000..b92b340
--- /dev/null
+++ b/examples/features/standard/jms-shared-consumer/readme.html
@@ -0,0 +1,119 @@
+<!--
+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 Shared Consumer 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 Shared Consumer 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 can use shared consumers to share a subscription on a topic. In JMS 1.1 this was not allowed
+     and so caused a scalability issue. In JMS 2 this restriction has been lifted so you can share the load across different
+         threads and connections.</p>
+
+     <h2>Example step-by-step</h2>
+
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
+        <pre class="prettyprint">
+           <code>InitialContext initialContext = getContext();</code>
+        </pre>
+
+        <li>We look-up the JMS topic object from JNDI</li>
+        <pre class="prettyprint">
+           <code>Topic topic = (Topic) initialContext.lookup("/topic/exampleTopic");</code>
+        </pre>
+
+        <li>We look-up the JMS connection factory object from JNDI</li>
+        <pre class="prettyprint">
+           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>We create a JMS context</li>
+        <pre class="prettyprint">
+           <code>jmsContext = cf.createContext();</code>
+        </pre>
+
+        <li>We create a JMS Producer.</li>
+        <pre class="prettyprint">
+           <code>JMSProducer producer = jmsContext.createProducer();</code>
+        </pre>
+
+        <li>We create a shared consumer using the subscription name <literal>sc1</literal></li>
+        <pre class="prettyprint">
+          <code>JMSConsumer jmsConsumer = jmsContext.createSharedConsumer(topic, "sc1");</code>
+       </pre>
+
+        <li>We then create a second JMS context for a second shared consumer</li>
+        <pre class="prettyprint">
+           <code>jmsContext2 = cf.createContext();</code>
+        </pre>
+
+         <li>we then create the second shared consumer using the same subscription name</li>
+        <pre class="prettyprint">
+           <code>JMSConsumer jmsConsumer2 = jmsContext2.createSharedConsumer(topic, "sc1");</code>
+        </pre>
+
+         <li>we then send 2 messages</li>
+        <pre class="prettyprint">
+           <code>
+           producer.send(topic, "this is a String!");
+
+           producer.send(topic, "this is a second String!") ;</code>
+        </pre>
+
+         <li>we then receive the 2 messages using both shared consumers</li>
+        <pre class="prettyprint">
+           <code>
+           String body = jmsConsumer.receiveBody(String.class, 5000);
+
+           body = jmsConsumer2.receiveBody(String.class, 5000);</code>
+        </pre>
+
+        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
+
+        <pre class="prettyprint">
+           <code>finally
+           {
+              if (initialContext != null)
+              {
+                 initialContext.close();
+              }
+              if (jmsContext != null)
+              {
+                 jmsContext.close();
+              }
+               if (jmsContext2 != null)
+               {
+               jmsContext2.close();
+               }
+           }</code>
+        </pre>
+
+
+
+     </ol>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java b/examples/features/standard/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java
new file mode 100644
index 0000000..da43eb0
--- /dev/null
+++ b/examples/features/standard/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java
@@ -0,0 +1,87 @@
+/*
+ * 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.ConnectionFactory;
+import javax.jms.JMSConsumer;
+import javax.jms.JMSContext;
+import javax.jms.JMSProducer;
+import javax.jms.Topic;
+import javax.naming.InitialContext;
+
+/**
+ * A JMS Example that uses shared consumers.
+ */
+public class JMSSharedConsumerExample {
+
+   public static void main(final String[] args) throws Exception {
+      InitialContext initialContext = null;
+      JMSContext jmsContext = null;
+      JMSContext jmsContext2 = null;
+      try {
+         // Step 1. Create an initial context to perform the JNDI lookup.
+         initialContext = new InitialContext();
+
+         // Step 2. Perfom a lookup on the queue
+         Topic topic = (Topic) initialContext.lookup("topic/exampleTopic");
+
+         // Step 3. Perform a lookup on the Connection Factory
+         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 4.Create a JMS Context
+         jmsContext = cf.createContext();
+
+         // Step 5. Create a message producer.
+         JMSProducer producer = jmsContext.createProducer();
+
+         // Step 6. Create a shared consumer
+         JMSConsumer jmsConsumer = jmsContext.createSharedConsumer(topic, "sc1");
+
+         // Step 7. Create a second JMS Context for a second shared consumer
+         jmsContext2 = cf.createContext();
+
+         // Step 8. Create the second shared consumer
+         JMSConsumer jmsConsumer2 = jmsContext2.createSharedConsumer(topic, "sc1");
+
+         // Step 9. send 2 messages
+         producer.send(topic, "this is a String!");
+
+         producer.send(topic, "this is a second String!");
+
+         // Step 10. receive the messages shared by both consumers
+         String body = jmsConsumer.receiveBody(String.class, 5000);
+
+         System.out.println("body = " + body);
+
+         body = jmsConsumer2.receiveBody(String.class, 5000);
+
+         System.out.println("body = " + body);
+      }
+      finally {
+         // Step 11. Be sure to close our JMS resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (jmsContext != null) {
+            jmsContext.close();
+         }
+         if (jmsContext2 != null) {
+            jmsContext2.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/jms-shared-consumer/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/jms-shared-consumer/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/6b17d966/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..2b2ba2e
--- /dev/null
+++ b/examples/features/standard/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,61 @@
+<?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 topic used by the example-->
+      <topic name="exampleTopic"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
+
+      <!-- Acceptors -->
+
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example topic-->
+         <security-setting match="jms.topic.exampleTopic">
+            <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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jms-shared-consumer/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/jms-shared-consumer/src/main/resources/jndi.properties b/examples/features/standard/jms-shared-consumer/src/main/resources/jndi.properties
new file mode 100644
index 0000000..54bed6d
--- /dev/null
+++ b/examples/features/standard/jms-shared-consumer/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
+topic.topic/exampleTopic=exampleTopic

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jmx/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/jmx/pom.xml b/examples/features/standard/jmx/pom.xml
new file mode 100644
index 0000000..693b2fc
--- /dev/null
+++ b/examples/features/standard/jmx/pom.xml
@@ -0,0 +1,117 @@
+<?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>jmx</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS "JMX" Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <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-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>
+                     <!-- options used for JMX on the example -->
+                     <javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
+                     </javaOptions>
+                  </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.JMXExample</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>jmx</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>


[08/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/paging/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/paging/src/main/resources/jndi.properties b/examples/features/standard/paging/src/main/resources/jndi.properties
new file mode 100644
index 0000000..6f70010
--- /dev/null
+++ b/examples/features/standard/paging/src/main/resources/jndi.properties
@@ -0,0 +1,21 @@
+# 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
+queue.queue/pagingQueue=pagingQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/pom.xml b/examples/features/standard/pom.xml
new file mode 100644
index 0000000..106462b
--- /dev/null
+++ b/examples/features/standard/pom.xml
@@ -0,0 +1,171 @@
+<?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.clustered</groupId>
+      <artifactId>broker-features</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <groupId>org.apache.activemq.examples.broker</groupId>
+   <artifactId>jms-examples</artifactId>
+   <packaging>pom</packaging>
+   <name>ActiveMQ Artemis Standard Examples</name>
+
+   <properties>
+      <udp-address>231.7.7.7</udp-address>
+      <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
+   </properties>
+
+   <profiles>
+      <profile>
+         <id>release</id>
+         <modules>
+            <module>bridge</module>
+            <module>browser</module>
+            <module>client-kickoff</module>
+            <module>consumer-rate-limit</module>
+            <module>dead-letter</module>
+            <module>delayed-redelivery</module>
+            <module>divert</module>
+            <module>durable-subscription</module>
+            <module>embedded</module>
+            <module>embedded-simple</module>
+            <module>expiry</module>
+            <module>http-transport</module>
+            <module>interceptor</module>
+            <module>instantiate-connection-factory</module>
+            <module>jms-auto-closeable</module>
+            <module>jms-bridge</module>
+            <module>jms-completion-listener</module>
+            <module>jms-context</module>
+            <module>jms-shared-consumer</module>
+            <module>jmx</module>
+            <module>large-message</module>
+            <module>last-value-queue</module>
+            <module>management</module>
+            <module>management-notifications</module>
+            <module>message-counters</module>
+            <module>message-group</module>
+            <module>message-group2</module>
+            <module>message-priority</module>
+            <module>no-consumer-buffering</module>
+            <module>paging</module>
+            <module>pre-acknowledge</module>
+            <module>producer-rate-limit</module>
+            <module>queue</module>
+            <module>queue-requestor</module>
+            <module>queue-selector</module>
+            <module>reattach-node</module>
+            <module>rest</module>
+            <module>request-reply</module>
+            <module>scheduled-message</module>
+            <module>security</module>
+            <module>send-acknowledgements</module>
+            <module>spring-integration</module>
+            <module>ssl-enabled</module>
+            <module>static-selector</module>
+            <module>temp-queue</module>
+            <module>topic</module>
+            <module>topic-hierarchies</module>
+            <module>topic-selector-example1</module>
+            <module>topic-selector-example2</module>
+            <module>transactional</module>
+            <module>xa-heuristic</module>
+            <module>xa-receive</module>
+            <module>xa-send</module>
+         </modules>
+      </profile>
+      <profile>
+         <id>examples</id>
+         <modules>
+            <module>bridge</module>
+            <module>browser</module>
+            <module>client-kickoff</module>
+            <module>consumer-rate-limit</module>
+            <module>dead-letter</module>
+            <module>delayed-redelivery</module>
+            <module>divert</module>
+            <module>durable-subscription</module>
+            <module>embedded</module>
+            <module>embedded-simple</module>
+            <module>expiry</module>
+            <module>http-transport</module>
+            <module>interceptor</module>
+            <module>jms-auto-closeable</module>
+            <module>instantiate-connection-factory</module>
+            <module>jms-bridge</module>
+            <module>jms-completion-listener</module>
+            <module>jms-context</module>
+            <module>jms-shared-consumer</module>
+            <module>jmx</module>
+            <module>large-message</module>
+            <module>last-value-queue</module>
+            <module>management</module>
+            <module>management-notifications</module>
+            <module>message-counters</module>
+            <module>message-group</module>
+            <module>message-group2</module>
+            <module>message-priority</module>
+            <module>no-consumer-buffering</module>
+            <module>paging</module>
+            <module>pre-acknowledge</module>
+            <module>producer-rate-limit</module>
+            <module>queue</module>
+            <module>queue-requestor</module>
+            <module>queue-selector</module>
+            <module>reattach-node</module>
+
+            <module>request-reply</module>
+            <module>rest</module>
+            <module>scheduled-message</module>
+            <module>security</module>
+            <module>send-acknowledgements</module>
+            <module>spring-integration</module>
+
+            <!-- ARTEMIS-197 FIX ME
+                 this one could be the case of leaving it out for good
+                 as it may require to be run manually
+            <module>ssl-enabled</module> -->
+
+            <module>static-selector</module>
+
+            <!--this needs to be run standalone as it needs manual intervention-->
+            <!--<module>stop-server-failover</module>-->
+
+            <module>temp-queue</module>
+            <module>topic</module>
+            <module>topic-hierarchies</module>
+            <module>topic-selector-example1</module>
+            <module>topic-selector-example2</module>
+            <module>transactional</module>
+            <module>xa-heuristic</module>
+            <module>xa-receive</module>
+            <module>xa-send</module>
+         </modules>
+      </profile>
+
+   </profiles>
+
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/pre-acknowledge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/pre-acknowledge/pom.xml b/examples/features/standard/pre-acknowledge/pom.xml
new file mode 100644
index 0000000..c5da1a5
--- /dev/null
+++ b/examples/features/standard/pre-acknowledge/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>pre-acknowledge</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Pre Acknowledge 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>
+                     <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.PreacknowledgeExample</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>pre-acknowledge</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/pre-acknowledge/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/pre-acknowledge/readme.html b/examples/features/standard/pre-acknowledge/readme.html
new file mode 100644
index 0000000..235c278
--- /dev/null
+++ b/examples/features/standard/pre-acknowledge/readme.html
@@ -0,0 +1,154 @@
+<!--
+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 Pre-Acknowledge 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 Pre-Acknowledge 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>Standard JMS supports three acknowledgement modes: AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, and
+     DUPS_OK_ACKNOWLEDGE. For a full description on these modes please consult the JMS specification, or any
+     JMS tutorial.</p>
+     <p>All of these standard modes involve sending acknowledgements from the client to the server. However
+     in some cases, you really don't mind losing messages in event of failure, so it would make sense
+     to acknowledge the message on the server <b>before</b> delivering it to the client.</p>
+     <p>By acknowledging the message before sending to the client, you can avoid extra network traffic and CPU
+     work done in sending acknowledgements from client to server.</p>
+     <p>The down-side of acknowledging on the server before delivery, is that if the system crashes after acknowledging
+     the message, but before the message has been received by the client, then, on recovery, that message
+     will be lost. This makes pre-acknowledgement not appropriate for all use cases, but it is very useful for some
+     use-cases when you can cope with such loss of messages<p>
+     <p>An example of a use-case where it might be a good idea to use pre-acknowledge, is for stock price update
+     messages. With these messages it might be ok to lose a message in event of crash, since the next price
+     update message will arrive soon, overriding the previous price.</p>
+     <p>In order to use pre-acknowledge functionality with ActiveMQ Artemis the session has to be created with
+     a special, ActiveMQ Artemis specific acknowledgement mode, given by the value of
+     <code>ActiveMQJMSConstants.PRE_ACKNOWLEDGE</code>.
+     <h2>Example step-by-step</h2>
+
+     <ol>
+        <li>Create an initial context to perform the JNDI lookup.</li>
+        <pre class="prettyprint">
+           <code>
+     initialContext = getContext(0);
+     </code>
+        </pre>
+
+        <li>Perform the look-ups</li>
+        <pre class="prettyprint">
+           <code>
+     Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
+
+     ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
+           </code>
+        </pre>
+
+        <li>Create a the JMS objects.</li>
+        <pre class="prettyprint">
+           <code>
+     connection = cf.createConnection();
+
+     Session session = connection.createSession(false, ActiveMQSession.PRE_ACKNOWLEDGE);
+
+     MessageProducer producer = session.createProducer(queue);
+
+     MessageConsumer messageConsumer = session.createConsumer(queue);
+           </code>
+        </pre>
+
+        <li>Create and send a message.</li>
+        <pre class="prettyprint">
+           <code>
+     TextMessage message1 = session.createTextMessage("This is a text message 1");
+
+     producer.send(message1);
+
+     System.out.println("Sent message: " + message1.getText());
+           </code>
+        </pre>
+
+        <li>Print out the message count of the queue. The queue contains one message as expected
+        delivery has not yet started on the queue.</li>
+        <pre class="prettyprint">
+           <code>
+     int count = getMessageCount(connection);
+
+     System.out.println("Queue message count is " + count);
+           </code>
+        </pre>
+
+        <li>Start the Connection, delivery will now start. Give a little time for delivery to occur.</li>
+        <pre class="prettyprint">
+          <code>
+     connection.start();
+
+     Thread.sleep(1000);
+          </code>
+       </pre>
+
+        <li>Print out the message count of the queue. It should now be zero, since the message has
+         already been acknowledged even before the consumer has received it.</li>
+        <pre class="prettyprint">
+           <code>
+     count = getMessageCount(connection);
+
+     System.out.println("Queue message count is now " + count);
+           </code>
+        </pre>
+
+        <li>Finally, receive the message.</li>
+        <pre class="prettyprint">
+           <code>
+     TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
+
+     System.out.println("Received message: " + messageReceived.getText());
+           </code>
+        </pre>
+
+        <li>Be sure to close our resources!</li>
+          <pre class="prettyprint">
+           <code>
+     if (initialContext != null)
+     {
+        initialContext.close();
+     }
+     if (connection != null)
+     {
+        connection.close();
+     }
+           </code>
+        </pre>
+     </ol>
+
+     <h2>More information</h2>
+
+     <ul>
+         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#pre-acknowledge">Pre-acknowledgement Mode chapter</a></li>
+     </ul>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java b/examples/features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java
new file mode 100644
index 0000000..834b54a
--- /dev/null
+++ b/examples/features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java
@@ -0,0 +1,126 @@
+/*
+ * 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.QueueConnection;
+import javax.jms.QueueRequestor;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSConstants;
+import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * This example demonstrates the use of ActiveMQ Artemis "pre-acknowledge" functionality where
+ * messages are acknowledged before they are delivered to the consumer.
+ *
+ * Please see the readme.html for more details.
+ */
+public class PreacknowledgeExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection = null;
+      try {
+
+         // Step 2. instantiate the queue object
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // new connection factory
+         ConnectionFactory cf = new ActiveMQConnectionFactory();
+
+         // Step 3. Create a the JMS objects
+         connection = cf.createConnection();
+
+         Session session = connection.createSession(false, ActiveMQJMSConstants.PRE_ACKNOWLEDGE);
+
+         MessageProducer producer = session.createProducer(queue);
+
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         // Step 4. Create and send a message
+         TextMessage message1 = session.createTextMessage("This is a text message 1");
+
+         producer.send(message1);
+
+         System.out.println("Sent message: " + message1.getText());
+
+         // Step 5. Print out the message count of the queue. The queue contains one message as expected
+         // delivery has not yet started on the queue
+         int count = getMessageCount(connection);
+
+         System.out.println("Queue message count is " + count);
+
+         // Step 6. Start the Connection, delivery will now start. Give a little time for delivery to occur.
+         connection.start();
+
+         Thread.sleep(1000);
+
+         // Step 7. Print out the message countof the queue. It should now be zero, since the message has
+         // already been acknowledged even before the consumer has received it.
+         count = getMessageCount(connection);
+
+         System.out.println("Queue message count is now " + count);
+
+         if (count != 0) {
+            throw new IllegalStateException("Queue message count is not 0.");
+         }
+
+         // Step 8. Finally, receive the message
+         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
+
+         System.out.println("Received message: " + messageReceived.getText());
+      }
+      finally {
+         // Step 9. Be sure to close our resources!
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+
+   // To do this we send a management message to get the message count.
+   // In real life you wouldn't create a new session every time you send a management message
+   private static int getMessageCount(final Connection connection) throws Exception {
+      QueueSession session = ((QueueConnection) connection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+
+      Queue managementQueue = ActiveMQJMSClient.createQueue("activemq.management");
+
+      QueueRequestor requestor = new QueueRequestor(session, managementQueue);
+
+      connection.start();
+
+      Message m = session.createMessage();
+
+      JMSManagementHelper.putAttribute(m, "jms.queue.exampleQueue", "messageCount");
+
+      Message response = requestor.request(m);
+
+      int messageCount = (Integer) JMSManagementHelper.getResult(response);
+
+      return messageCount;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/pre-acknowledge/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/pre-acknowledge/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/6b17d966/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..f29acbc
--- /dev/null
+++ b/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,63 @@
+<?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.dir}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <security-setting match="jms.#">
+            <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">
+            <permission type="manage" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/pre-acknowledge/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/pre-acknowledge/src/main/resources/jndi.properties b/examples/features/standard/pre-acknowledge/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/pre-acknowledge/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/6b17d966/examples/features/standard/producer-rate-limit/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/producer-rate-limit/pom.xml b/examples/features/standard/producer-rate-limit/pom.xml
new file mode 100644
index 0000000..91b7603
--- /dev/null
+++ b/examples/features/standard/producer-rate-limit/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>producer-rate-limit</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Producer Rate Limit 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>
+                     <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.ProducerRateLimitExample</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>producer-rate-limit</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/producer-rate-limit/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/producer-rate-limit/readme.html b/examples/features/standard/producer-rate-limit/readme.html
new file mode 100644
index 0000000..7e10ca3
--- /dev/null
+++ b/examples/features/standard/producer-rate-limit/readme.html
@@ -0,0 +1,176 @@
+<!--
+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 Message Producer Rate Limiting</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 Message Producer Rate Limiting</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>With ActiveMQ Artemis you can specify a maximum send rate at which a JMS MessageProducer will send messages.
+     This can be specified when creating or deploying the connection factory. See <code>activemq-jms.xml</code></p>
+     <p>If this value is specified then ActiveMQ Artemis will ensure that messages are never produced at a rate higher than
+     specified. This is a form of producer <i>throttling</i>.</p>
+     <h2>Example step-by-step</h2>
+     <p>In this example we specify a <code>producer-max-rate</code> of <code>50</code> messages per second in the <code>activemq-jms.xml</code>
+     file when deploying the connection factory:</p>
+     <pre class="prettyprint">
+     <code>
+   &lt;connection-factory name="ConnectionFactory"&gt;
+      &lt;connector-ref connector-name="netty-connector"/&gt;
+      &lt;entries&gt;
+         &lt;entry name="ConnectionFactory"/&gt;
+      &lt;/entries&gt;
+
+      &lt;!-- We limit producers created on this connection factory to produce messages at a maximum rate
+      of 50 messages per sec --&gt;
+      &lt;producer-max-rate&gt;50&lt;/producer-max-rate&gt;
+
+   &lt;/connection-factory&gt;
+     </code>
+     </pre>
+     <p>We then simply send as many messages as we can in 10 seconds and note how many messages are actually sent.</p>
+     <p>We note that the number of messages sent per second never exceeds the specified value of <code>50</code> messages per second.</p>
+
+     <ol>
+        <li>Create an initial context to perform the JNDI lookup.</li>
+        <pre class="prettyprint">
+           <code>initialContext = getContext(0);</code>
+        </pre>
+
+        <li>Perfom a lookup on the queue</li>
+        <pre class="prettyprint">
+           <code>Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>Perform a lookup on the Connection Factory</li>
+        <pre class="prettyprint">
+           <code>ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>Create a JMS Connection</li>
+        <pre class="prettyprint">
+           <code>connection = cf.createConnection();</code>
+        </pre>
+
+        <li>Create a JMS Session</li>
+        <pre class="prettyprint">
+           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
+        </pre>
+
+        <li>Create a JMS Message Producer</li>
+        <pre class="prettyprint">
+          <code>MessageProducer producer = session.createProducer(queue);</code>
+        </pre>
+
+        <li>Send as many messages as we can in 10 seconds</li>
+        <pre class="prettyprint">
+           <code>
+        final long duration = 10000;
+
+        int i = 0;
+
+        long start = System.currentTimeMillis();
+
+        while (System.currentTimeMillis() - start <= duration)
+        {
+           TextMessage message = session.createTextMessage("This is text message: " + i++);
+
+           producer.send(message);
+        }
+
+        long end = System.currentTimeMillis();
+
+        double rate = 1000 * (double)i / (end - start);
+
+        System.out.println("We sent " + i + " messages in " + (end - start) + " milliseconds");
+
+        System.out.println("Actual send rate was " + rate + " messages per second");
+           </code>
+        </pre>
+
+        <li>We note that the sending rate doesn't exceed 50 messages per second. Here's some example output from a real
+        run</li>
+
+        <pre class="prettyprint">
+           <code>
+     [java] Will now send as many messages as we can in 10 seconds...
+     [java] We sent 500 messages in 10072 milliseconds
+     [java] Actual send rate was 49.64257347100874 messages per second
+           </code>
+        </pre>
+
+
+        <li>For good measure we consumer the messages we produced.</li>
+        <pre class="prettyprint">
+           <code>
+        MessageConsumer messageConsumer = session.createConsumer(queue);
+
+        connection.start();
+
+        System.out.println("Now consuming the messages...");
+
+        i = 0;
+        while (true)
+        {
+           TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
+
+           if (messageReceived == null)
+           {
+              break;
+           }
+
+           i++;
+        }
+
+        System.out.println("Received " + i + " messages");
+
+           </code>
+        </pre>
+
+        <li>Be sure to close our resources!</li>
+
+        <pre class="prettyprint">
+           <code>
+           finally
+           {
+              if (initialContext != null)
+              {
+                initialContext.close();
+              }
+
+              if (connection != null)
+              {
+                 connection.close();
+              }
+           }</code>
+        </pre>
+
+
+
+     </ol>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java b/examples/features/standard/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java
new file mode 100644
index 0000000..a7623bb
--- /dev/null
+++ b/examples/features/standard/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java
@@ -0,0 +1,106 @@
+/*
+ * 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 org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * This example demonstrates how a message producer can be limited to produce messages at a maximum rate
+ * specified in messages per sec.
+ */
+public class ProducerRateLimitExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection = null;
+      try {
+         // Step 2. Perfom a lookup on the queue
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // Step 3. Perform a lookup on the Connection Factory
+         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?producerMaxRate=50");
+
+         // 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);
+
+         System.out.println("Will now send as many messages as we can in 10 seconds...");
+
+         // Step 7. Send as many messages as we can in 10 seconds
+
+         final long duration = 10000;
+
+         int i = 0;
+
+         long start = System.currentTimeMillis();
+
+         while (System.currentTimeMillis() - start <= duration) {
+            TextMessage message = session.createTextMessage("This is text message: " + i++);
+
+            producer.send(message);
+         }
+
+         long end = System.currentTimeMillis();
+
+         double rate = 1000 * (double) i / (end - start);
+
+         System.out.println("We sent " + i + " messages in " + (end - start) + " milliseconds");
+
+         System.out.println("Actual send rate was " + rate + " messages per second");
+
+         // Step 8. For good measure we consumer the messages we produced.
+
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         connection.start();
+
+         System.out.println("Now consuming the messages...");
+
+         i = 0;
+         while (true) {
+            TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
+
+            if (messageReceived == null) {
+               break;
+            }
+
+            i++;
+         }
+
+         System.out.println("Received " + i + " messages");
+      }
+      finally {
+         // Step 9. Be sure to close our resources!
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/producer-rate-limit/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/producer-rate-limit/src/main/resources/jndi.properties b/examples/features/standard/producer-rate-limit/src/main/resources/jndi.properties
new file mode 100644
index 0000000..0e42b2a
--- /dev/null
+++ b/examples/features/standard/producer-rate-limit/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?producerMaxRate=50
+queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/queue-requestor/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue-requestor/pom.xml b/examples/features/standard/queue-requestor/pom.xml
new file mode 100644
index 0000000..df59a6a
--- /dev/null
+++ b/examples/features/standard/queue-requestor/pom.xml
@@ -0,0 +1,104 @@
+<?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-requestor</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Queue Requestor 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>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <spawn>true</spawn>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.QueueRequestorExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.broker</groupId>
+                  <artifactId>queue-requestor</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/queue-requestor/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue-requestor/readme.html b/examples/features/standard/queue-requestor/readme.html
new file mode 100644
index 0000000..68a1c95
--- /dev/null
+++ b/examples/features/standard/queue-requestor/readme.html
@@ -0,0 +1,46 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<html>
+  <head>
+    <title>ActiveMQ Artemis JMS QueueRequestor Example</title>
+    <link rel="stylesheet" type="text/css" href="../../../common/common.css" />
+    <link rel="stylesheet" type="text/css" href="../../../common/prettify.css" />
+    <script type="text/javascript" src="../../../common/prettify.js"></script>
+  </head>
+  <body onload="prettyPrint()">
+     <h1>JMS QueueRequestor Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
+     <p>This example shows you how to use a <a href="http://java.sun.com/javaee/5/docs/api/javax/jms/QueueRequestor.html">QueueRequestor</a> with ActiveMQ Artemis.</p>
+     <p>JMS is mainly used to send messages asynchronously so that the producer of a message is not waiting for the result of the message consumption.
+        However, there are cases where it is necessary to have a synchronous behavior: the code sending a message requires a reply for this message
+        before continuing its execution.<br />
+        A QueueRequestor facilitates this use case by providing a simple request/reply abstraction on top of JMS.</p>
+     <p>The example consists in two classes:</p>
+     <dl>
+         <dt><code>TextReverserService</code></dt>
+         <dd>A JMS MessageListener which consumes text messages and sends replies containing the reversed text</dd>
+         <dt><code>QueueRequestorExample</code></dt>
+         <dd>A JMS Client which uses a QueueRequestor to send text requests to a queue and receive replies with the reversed text in a synchronous fashion</dd>
+    </dl>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/QueueRequestorExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/QueueRequestorExample.java b/examples/features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/QueueRequestorExample.java
new file mode 100644
index 0000000..607d82f
--- /dev/null
+++ b/examples/features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/QueueRequestorExample.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.JMSException;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueRequestor;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+/**
+ * A simple JMS example that shows how to use queues requestors.
+ */
+public class QueueRequestorExample {
+
+   public static void main(final String[] args) throws Exception {
+      QueueConnection 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. Look-up the JMS queue connection factory
+         QueueConnectionFactory cf = (QueueConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 4. Create a TextReverserService which consumes messages from the queue and sends message with reversed
+         // text
+         TextReverserService reverserService = new TextReverserService(cf, queue);
+
+         // Step 5. Create a JMS QueueConnection
+         connection = cf.createQueueConnection();
+
+         // Step 6. Start the connection
+         connection.start();
+
+         // Step 7. Create a JMS queue session with AUTO_ACKNOWLEDGE mode
+         QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 8. Create a JMS queue requestor to send requests to the queue
+         QueueRequestor queueRequestor = new QueueRequestor(session, queue);
+
+         // Step 9. Create a JMS message to send as a request
+         TextMessage request = session.createTextMessage("Hello, World!");
+
+         // Step 10. Use the requestor to send the request and wait to receive a reply
+         TextMessage reply = (TextMessage) queueRequestor.request(request);
+
+         // Step 11. The reply's text contains the reversed request's text
+         System.out.println("Send request: " + request.getText());
+         System.out.println("Received reply:" + reply.getText());
+
+         // Step.12 close the queue requestor
+         queueRequestor.close();
+
+         // Step 13. close the text reverser service
+         reverserService.close();
+      }
+      finally {
+         if (connection != null) {
+            try {
+               // Step 14. Be sure to close the JMS resources!
+               connection.close();
+            }
+            catch (JMSException e) {
+               e.printStackTrace();
+            }
+         }
+
+         if (initialContext != null) {
+            // Also the InitialContext
+            initialContext.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/TextReverserService.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/TextReverserService.java b/examples/features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/TextReverserService.java
new file mode 100644
index 0000000..63fdad2
--- /dev/null
+++ b/examples/features/standard/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/TextReverserService.java
@@ -0,0 +1,113 @@
+/*
+ * 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.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+/**
+ * A TextReverserService is a MessageListener which consume text messages from a destination
+ * and replies with text messages containing the reversed text.
+ * It sends replies to the destination specified by the JMS ReplyTo header of the consumed messages.
+ */
+public class TextReverserService implements MessageListener {
+
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   private final Session session;
+
+   private final Connection connection;
+
+   // Static --------------------------------------------------------
+
+   private static String reverse(final String text) {
+      return new StringBuffer(text).reverse().toString();
+   }
+
+   // Constructors --------------------------------------------------
+
+   public TextReverserService(final ConnectionFactory cf, final Destination destination) throws JMSException {
+      // create a JMS connection
+      connection = cf.createConnection();
+      // create a JMS session
+      session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+      // create a JMS MessageConsumer to consume message from the destination
+      MessageConsumer consumer = session.createConsumer(destination);
+      // let TextReverter implement MessageListener to consume messages
+      consumer.setMessageListener(this);
+
+      // start the connection to start consuming messages
+      connection.start();
+   }
+
+   // MessageListener implementation --------------------------------
+
+   public void onMessage(final Message request) {
+      TextMessage textMessage = (TextMessage) request;
+      try {
+         // retrieve the request's text
+         String text = textMessage.getText();
+         // create a reply containing the reversed text
+         TextMessage reply = session.createTextMessage(TextReverserService.reverse(text));
+
+         // retrieve the destination to reply to
+         Destination replyTo = request.getJMSReplyTo();
+         // create a producer to send the reply
+         MessageProducer producer = session.createProducer(replyTo);
+         // send the reply
+         producer.send(reply);
+         // close the producer
+         producer.close();
+      }
+      catch (JMSException e) {
+         e.printStackTrace();
+      }
+   }
+
+   // Public --------------------------------------------------------
+
+   public void close() {
+      if (connection != null) {
+         try {
+            // be sure to close the JMS resources
+            connection.close();
+         }
+         catch (JMSException e) {
+            e.printStackTrace();
+         }
+      }
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/queue-requestor/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/queue-requestor/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/6b17d966/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..6c344c2
--- /dev/null
+++ b/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,67 @@
+<?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.dir}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queues -->
+         <security-setting match="jms.queue.#">
+            <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 settings for JMS temporary queue -->
+         <security-setting match="jms.tempqueue.#">
+            <permission type="createNonDurableQueue" roles="guest"/>
+            <permission type="deleteNonDurableQueue" roles="guest"/>
+            <permission type="consume" roles="guest"/>
+            <permission type="send" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/queue-requestor/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue-requestor/src/main/resources/jndi.properties b/examples/features/standard/queue-requestor/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/queue-requestor/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/6b17d966/examples/features/standard/queue-selector/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue-selector/pom.xml b/examples/features/standard/queue-selector/pom.xml
new file mode 100644
index 0000000..9da147c
--- /dev/null
+++ b/examples/features/standard/queue-selector/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-selector</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Queue Selector 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>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.QueueSelectorExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.broker</groupId>
+                  <artifactId>queue-selector</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/queue-selector/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue-selector/readme.html b/examples/features/standard/queue-selector/readme.html
new file mode 100644
index 0000000..ef63063
--- /dev/null
+++ b/examples/features/standard/queue-selector/readme.html
@@ -0,0 +1,52 @@
+<!--
+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 Selector 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 Selector Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+     <p>This example shows you how to selectively consume messages using message selectors with queue consumers.</p>
+
+     <p>Message selectors are strings with special syntax that can be used in creating consumers. Message consumers
+     created with a message selector will only receive messages that match its selector. On message delivery, the JBoss Message
+     Server evaluates the corresponding message headers of the messages against each selector, if any, and then delivers
+     the 'matched' messages to its consumer. Please consult the JMS 1.1 specification for full details.</p>
+
+     <p>In this example, three message consumers are created on a queue. The first consumer is created with selector
+     <code>'color=red'</code>, it only receives messages that
+     have a 'color' string property of 'red' value; the second is created with selector <code>'color=green'</code>, it
+     only receives messages who have a 'color' string property of
+     'green' value; and the third without a selector, which means it receives all messages. To illustrate, three messages
+     with different 'color' property values are created and sent.</p>
+
+     <p>Selectors can be used with both queue consumers and topic consumers. The difference is that with queue consumers,
+     a message is only delivered to one consumer on the queue, while topic consumers the message will be delivered to every
+     matching consumers. In this example, if the third consumer (anyConsumer) were the first consumer created, it will
+     consume the first message delivered, therefore there is no chance for the next consumer to get the message, even if it
+     matches the selector.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/queue-selector/src/main/java/org/apache/activemq/artemis/jms/example/QueueSelectorExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/queue-selector/src/main/java/org/apache/activemq/artemis/jms/example/QueueSelectorExample.java b/examples/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/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);
+      }
+   }
+}


[23/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-jgroups/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-jgroups/pom.xml b/examples/features/clustered/clustered-jgroups/pom.xml
new file mode 100644
index 0000000..30f6a20
--- /dev/null
+++ b/examples/features/clustered/clustered-jgroups/pom.xml
@@ -0,0 +1,161 @@
+<?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.clustered</groupId>
+      <artifactId>broker-clustered</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>clustered-jgroups</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Clustered JGroups 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>
+                     <libList>
+                        <!-- You need to add jgroups.jar to the server's lib -->
+                        <arg>org.jgroups:jgroups:3.6.0.Final</arg>
+                     </libList>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <libList>
+                        <!-- You need to add jgroups.jar to the server's lib -->
+                        <arg>org.jgroups:jgroups:3.6.0.Final</arg>
+                     </libList>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ClusteredJgroupsExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <artifactId>clustered-jgroups</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-jgroups/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-jgroups/readme.html b/examples/features/clustered/clustered-jgroups/readme.html
new file mode 100644
index 0000000..2731997
--- /dev/null
+++ b/examples/features/clustered/clustered-jgroups/readme.html
@@ -0,0 +1,67 @@
+<!--
+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 Clustering with JGroups 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>ActiveMQ Artemis Clustering with JGroups 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 the working of a two node cluster using JGroups as the underlying topology broadcasting/discovery
+     technique.</p>
+     <p>We deploy a queue on to the cluster, then create a consumer on the queue on each node, and we create a producer on only one of the nodes.</p>
+     <p>We then send some messages via the producer, and we verify that <b>both</b> consumers receive the sent messages
+     in a round-robin fashion.</p>
+     <p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
+     JNDI, these could be instantiated directly.</p>
+     <p>To enable ActiveMQ Artemis to use JGroups you need to configure JGroups configuration file and make sure it is on the classpath
+         by placing in the configuration directory, the file test-jgroups-file_ping.xml is the configuration used in this
+     exaample</p>
+     <p>You then configure the jgroups file used by the broadcast and discovery groups in the configuration along with the
+         channel name which you want this cluster to share.</p>
+     <pre class="prettyprint">
+     <code>
+   &lt;broadcast-groups&gt;
+      &lt;broadcast-group name="my-broadcast-group">
+         &lt;broadcast-period>5000&lt;/broadcast-period>
+         &lt;jgroups-file>test-jgroups-file_ping.xml&lt;/jgroups-file>
+         &lt;jgroups-channel>activemq_broadcast_channel&lt;/jgroups-channel>
+         &lt;connector-ref>netty-connector&lt;/connector-ref>
+      &lt;/broadcast-group>
+   &lt;/broadcast-groups&gt;
+
+   &lt;discovery-groups&gt;
+      &lt;discovery-group name="my-discovery-group">
+         &lt;jgroups-file>test-jgroups-file_ping.xml&lt;/jgroups-file>
+         &lt;jgroups-channel>activemq_broadcast_channel&lt;/jgroups-channel>
+         &lt;refresh-timeout>10000&lt;/refresh-timeout>
+      &lt;/discovery-group>
+   &lt;/discovery-groups&gt;
+     </code>
+     </pre>
+     <p>For more information on ActiveMQ Artemis clustering in general, please see the clustering
+     section of the user manual.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java b/examples/features/clustered/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java
new file mode 100644
index 0000000..f8016b1
--- /dev/null
+++ b/examples/features/clustered/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java
@@ -0,0 +1,140 @@
+/*
+ * 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;
+import java.util.Hashtable;
+
+/**
+ * A simple example that demonstrates clustering using jgroups.
+ */
+public class ClusteredJgroupsExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection0 = null;
+
+      Connection connection1 = null;
+
+      InitialContext ic0 = null;
+
+      InitialContext ic1 = null;
+
+      try {
+         // Step 1. Get an initial context for looking up JNDI from server 0
+         Hashtable<String, Object> properties = new Hashtable<String, Object>();
+         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616");
+         properties.put("queue.queue/exampleQueue", "exampleQueue");
+         ic0 = new InitialContext(properties);
+
+         // Step 2. Look-up the JMS Queue object from JNDI
+         Queue queue = (Queue) ic0.lookup("queue/exampleQueue");
+
+         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
+         ConnectionFactory cf0 = (ConnectionFactory) ic0.lookup("ConnectionFactory");
+
+         // Step 4. Get an initial context for looking up JNDI from server 1
+         properties = new Hashtable<String, Object>();
+         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
+         ic1 = new InitialContext(properties);
+
+         // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
+         ConnectionFactory cf1 = (ConnectionFactory) ic1.lookup("ConnectionFactory");
+
+         // Step 6. We create a JMS Connection connection0 which is a connection to server 0
+         connection0 = cf0.createConnection();
+
+         // Step 7. We create a JMS Connection connection1 which is a connection to server 1
+         connection1 = cf1.createConnection();
+
+         // Step 8. We create a JMS Session on server 0
+         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 9. We create a JMS Session on server 1
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 10. We start the connections to ensure delivery occurs on them
+         connection0.start();
+
+         connection1.start();
+
+         // Step 11. We create JMS MessageConsumer objects on server 0 and server 1
+         MessageConsumer consumer0 = session0.createConsumer(queue);
+
+         MessageConsumer consumer1 = session1.createConsumer(queue);
+
+         Thread.sleep(1000);
+
+         // Step 12. We create a JMS MessageProducer object on server 0
+         MessageProducer producer = session0.createProducer(queue);
+
+         // Step 13. We send some messages to server 0
+
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session0.createTextMessage("This is text message " + i);
+
+            producer.send(message);
+
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 14. We now consume those messages on *both* server 0 and server 1.
+         // We note the messages have been distributed between servers in a round robin fashion
+         // JMS Queues implement point-to-point message where each message is only ever consumed by a
+         // maximum of one consumer
+
+         for (int i = 0; i < numMessages; i += 2) {
+            TextMessage message0 = (TextMessage) consumer0.receive(5000);
+
+            System.out.println("Got message: " + message0.getText() + " from node 0");
+
+            TextMessage message1 = (TextMessage) consumer1.receive(5000);
+
+            System.out.println("Got message: " + message1.getText() + " from node 1");
+         }
+      }
+      finally {
+         // Step 15. Be sure to close our resources!
+
+         if (connection0 != null) {
+            connection0.close();
+         }
+
+         if (connection1 != null) {
+            connection1.close();
+         }
+
+         if (ic0 != null) {
+            ic0.close();
+         }
+
+         if (ic1 != null) {
+            ic1.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..17809e5
--- /dev/null
+++ b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,97 @@
+<?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>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <broadcast-period>5000</broadcast-period>
+            <jgroups-file>test-jgroups-file_ping.xml</jgroups-file>
+            <jgroups-channel>active_broadcast_channel</jgroups-channel>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <jgroups-file>test-jgroups-file_ping.xml</jgroups-file>
+            <jgroups-channel>active_broadcast_channel</jgroups-channel>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/client-jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/client-jndi.properties b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/client-jndi.properties
new file mode 100644
index 0000000..5cbe72c
--- /dev/null
+++ b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/client-jndi.properties
@@ -0,0 +1,19 @@
+# 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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/test-jgroups-file_ping.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/test-jgroups-file_ping.xml b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/test-jgroups-file_ping.xml
new file mode 100644
index 0000000..5fb6ab4
--- /dev/null
+++ b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server0/test-jgroups-file_ping.xml
@@ -0,0 +1,73 @@
+<?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.
+-->
+
+<config xmlns="urn:org:jgroups"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="urn:org:jgroups file:schema/JGroups-2.8.xsd">
+    <TCP loopback="true"
+         recv_buf_size="20000000"
+         send_buf_size="640000"
+         discard_incompatible_packets="true"
+         max_bundle_size="64000"
+         max_bundle_timeout="30"
+         enable_bundling="true"
+         use_send_queues="false"
+         sock_conn_timeout="300"
+
+         thread_pool.enabled="true"
+         thread_pool.min_threads="1"
+         thread_pool.max_threads="10"
+         thread_pool.keep_alive_time="5000"
+         thread_pool.queue_enabled="false"
+         thread_pool.queue_max_size="100"
+         thread_pool.rejection_policy="run"
+
+         oob_thread_pool.enabled="true"
+         oob_thread_pool.min_threads="1"
+         oob_thread_pool.max_threads="8"
+         oob_thread_pool.keep_alive_time="5000"
+         oob_thread_pool.queue_enabled="false"
+         oob_thread_pool.queue_max_size="100"
+         oob_thread_pool.rejection_policy="run"/>
+
+   <!-- a location that can be found by both server's running -->
+    <FILE_PING location="../../file.ping.dir"/>
+    <MERGE2 max_interval="30000"
+              min_interval="10000"/>
+    <FD_SOCK/>
+    <FD timeout="10000" max_tries="5" />
+    <VERIFY_SUSPECT timeout="1500"  />
+    <BARRIER />
+    <pbcast.NAKACK
+                   use_mcast_xmit="false"
+                   retransmit_timeout="300,600,1200,2400,4800"
+                   discard_delivered_msgs="true"/>
+    <UNICAST timeout="300,600,1200" />
+    <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                   max_bytes="400000"/>
+    <pbcast.GMS print_local_addr="true" join_timeout="3000"
+
+                view_bundling="true"/>
+    <FC max_credits="2000000"
+        min_threshold="0.10"/>
+    <FRAG2 frag_size="60000"  />
+    <pbcast.STATE_TRANSFER/>
+    <pbcast.FLUSH timeout="0"/>
+</config>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..267eae7
--- /dev/null
+++ b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,96 @@
+<?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:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <broadcast-period>5000</broadcast-period>
+            <jgroups-file>test-jgroups-file_ping.xml</jgroups-file>
+            <jgroups-channel>active_broadcast_channel</jgroups-channel>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <jgroups-file>test-jgroups-file_ping.xml</jgroups-file>
+            <jgroups-channel>active_broadcast_channel</jgroups-channel>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/client-jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/client-jndi.properties b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/client-jndi.properties
new file mode 100644
index 0000000..7f579c1
--- /dev/null
+++ b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/client-jndi.properties
@@ -0,0 +1,19 @@
+# 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
+java.naming.provider.url=tcp://localhost:61617

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/test-jgroups-file_ping.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/test-jgroups-file_ping.xml b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/test-jgroups-file_ping.xml
new file mode 100644
index 0000000..1137496
--- /dev/null
+++ b/examples/features/clustered/clustered-jgroups/src/main/resources/activemq/server1/test-jgroups-file_ping.xml
@@ -0,0 +1,73 @@
+<?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.
+-->
+
+<config xmlns="urn:org:jgroups"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.0.xsd">
+    <TCP loopback="true"
+         recv_buf_size="20000000"
+         send_buf_size="640000"
+         discard_incompatible_packets="true"
+         max_bundle_size="64000"
+         max_bundle_timeout="30"
+         enable_bundling="true"
+         use_send_queues="false"
+         sock_conn_timeout="300"
+
+         thread_pool.enabled="true"
+         thread_pool.min_threads="1"
+         thread_pool.max_threads="10"
+         thread_pool.keep_alive_time="5000"
+         thread_pool.queue_enabled="false"
+         thread_pool.queue_max_size="100"
+         thread_pool.rejection_policy="run"
+
+         oob_thread_pool.enabled="true"
+         oob_thread_pool.min_threads="1"
+         oob_thread_pool.max_threads="8"
+         oob_thread_pool.keep_alive_time="5000"
+         oob_thread_pool.queue_enabled="false"
+         oob_thread_pool.queue_max_size="100"
+         oob_thread_pool.rejection_policy="run"/>
+
+    <!-- a location that can be found by both server's running -->
+    <FILE_PING location="../../file.ping.dir"/>
+    <MERGE2 max_interval="30000"
+              min_interval="10000"/>
+    <FD_SOCK/>
+    <FD timeout="10000" max_tries="5" />
+    <VERIFY_SUSPECT timeout="1500"  />
+    <BARRIER />
+    <pbcast.NAKACK
+                   use_mcast_xmit="false"
+                   retransmit_timeout="300,600,1200,2400,4800"
+                   discard_delivered_msgs="true"/>
+    <UNICAST timeout="300,600,1200" />
+    <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                   max_bytes="400000"/>
+    <pbcast.GMS print_local_addr="true" join_timeout="3000"
+
+                view_bundling="true"/>
+    <FC max_credits="2000000"
+        min_threshold="0.10"/>
+    <FRAG2 frag_size="60000"  />
+    <pbcast.STATE_TRANSFER/>
+    <pbcast.FLUSH timeout="0"/>
+</config>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-queue/pom.xml b/examples/features/clustered/clustered-queue/pom.xml
new file mode 100644
index 0000000..78a8c8b
--- /dev/null
+++ b/examples/features/clustered/clustered-queue/pom.xml
@@ -0,0 +1,154 @@
+<?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.clustered</groupId>
+      <artifactId>broker-clustered</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>clustered-queue</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Clustered 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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ClusteredQueueExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <artifactId>clustered-queue</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-queue/readme.html b/examples/features/clustered/clustered-queue/readme.html
new file mode 100644
index 0000000..b5fce81
--- /dev/null
+++ b/examples/features/clustered/clustered-queue/readme.html
@@ -0,0 +1,56 @@
+<!--
+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 Load Balanced Clustered 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 Load Balanced Clustered 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 demonstrates a JMS queue deployed on two different nodes. The two nodes are configured to form a cluster.</p>
+     <p>We then create a consumer on the queue on each node, and we create a producer on only one of the nodes.</p>
+     <p>We then send some messages via the producer, and we verify that <b>both</b> consumers receive the sent messages
+     in a round-robin fashion.</p>
+     <p>In other words, ActiveMQ Artemis <b>load balances</b> the sent messages across all consumers on the cluster</p>
+     <p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
+     JNDI, these could be instantiated directly.</p>
+     <p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster between the two nodes
+     and to load balance the messages between the nodes.</p>
+     <pre class="prettyprint">
+     <code>&lt;cluster-connection name="my-cluster"&gt;
+        &lt;address&gt;jms&lt;/address&gt;
+        &lt;connector-ref>netty-connector&lt;/connector-ref>
+        &lt;retry-interval&gt;500&lt;/retry-interval&gt;
+        &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
+        &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
+        &lt;max-hops&gt;1&lt;/max-hops&gt;
+        &lt;discovery-group-ref discovery-group-name="my-discovery-group"/&gt;
+     &lt;/cluster-connection&gt;
+     </code>
+     </pre>
+     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
+     section of the user manual.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java b/examples/features/clustered/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java
new file mode 100644
index 0000000..f92514b
--- /dev/null
+++ b/examples/features/clustered/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java
@@ -0,0 +1,117 @@
+/*
+ * 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 org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
+ * nodes of the cluster.
+ */
+public class ClusteredQueueExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection0 = null;
+
+      Connection connection1 = null;
+
+      try {
+         // Step 2. Instantiate the Queue
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // Instantiate connection towards server 0
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
+
+         // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
+
+         // Step 6. We create a JMS Connection connection0 which is a connection to server 0
+         connection0 = cf0.createConnection();
+
+         // Step 7. We create a JMS Connection connection1 which is a connection to server 1
+         connection1 = cf1.createConnection();
+
+         // Step 8. We create a JMS Session on server 0
+         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 9. We create a JMS Session on server 1
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 10. We start the connections to ensure delivery occurs on them
+         connection0.start();
+
+         connection1.start();
+
+         // Step 11. We create JMS MessageConsumer objects on server 0 and server 1
+         MessageConsumer consumer0 = session0.createConsumer(queue);
+
+         MessageConsumer consumer1 = session1.createConsumer(queue);
+
+         Thread.sleep(1000);
+
+         // Step 12. We create a JMS MessageProducer object on server 0
+         MessageProducer producer = session0.createProducer(queue);
+
+         // Step 13. We send some messages to server 0
+
+         final int numMessages = 10;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session0.createTextMessage("This is text message " + i);
+
+            producer.send(message);
+
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 14. We now consume those messages on *both* server 0 and server 1.
+         // We note the messages have been distributed between servers in a round robin fashion
+         // JMS Queues implement point-to-point message where each message is only ever consumed by a
+         // maximum of one consumer
+
+         for (int i = 0; i < numMessages; i += 2) {
+            TextMessage message0 = (TextMessage) consumer0.receive(5000);
+
+            System.out.println("Got message: " + message0.getText() + " from node 0");
+
+            TextMessage message1 = (TextMessage) consumer1.receive(5000);
+
+            System.out.println("Got message: " + message1.getText() + " from node 1");
+         }
+      }
+      finally {
+         // Step 15. Be sure to close our resources!
+
+         if (connection0 != null) {
+            connection0.close();
+         }
+
+         if (connection1 != null) {
+            connection1.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-queue/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-queue/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-queue/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..eb30a90
--- /dev/null
+++ b/examples/features/clustered/clustered-queue/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,95 @@
+<?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>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-queue/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-queue/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-queue/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..531fed1
--- /dev/null
+++ b/examples/features/clustered/clustered-queue/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,96 @@
+<?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>target/server1/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>target/server1/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>target/server1/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>target/server1/data/messaging/paging</paging-directory>
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <broadcast-groups>
+         <broadcast-group name="my-broadcast-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>100</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="my-discovery-group">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>10000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <discovery-group-ref discovery-group-name="my-discovery-group"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-static-discovery/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery/pom.xml b/examples/features/clustered/clustered-static-discovery/pom.xml
new file mode 100644
index 0000000..b3ce3c1
--- /dev/null
+++ b/examples/features/clustered/clustered-static-discovery/pom.xml
@@ -0,0 +1,239 @@
+<?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.clustered</groupId>
+      <artifactId>broker-clustered</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>clustered-static-discovery</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Clustered Static Discovery Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server2</instance>
+                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create3</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server3</instance>
+                     <configuration>${basedir}/target/classes/activemq/server3</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <spawn>true</spawn>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server2</location>
+                     <testURI>tcp://localhost:61618</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server2</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start3</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server3</location>
+                     <testURI>tcp://localhost:61619</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server3</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.StaticClusteredQueueExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server2</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop3</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server3</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.clustered</groupId>
+                  <artifactId>clustered-static-discovery</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-static-discovery/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery/readme.html b/examples/features/clustered/clustered-static-discovery/readme.html
new file mode 100644
index 0000000..88931b9
--- /dev/null
+++ b/examples/features/clustered/clustered-static-discovery/readme.html
@@ -0,0 +1,58 @@
+<!--
+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 Load Balanced Static Clustered 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 Load Balanced Static Clustered 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 demonstrates a JMS queue deployed on two different nodes. The two nodes are configured to form a cluster
+       from a <em>static</em> list of nodes.</p>
+     <p>We then create a consumer on the queue on each node, and we create a producer on only one of the nodes.</p>
+     <p>We then send some messages via the producer, and we verify that <b>both</b> consumers receive the sent messages
+     in a round-robin fashion.</p>
+     <p>In other words, ActiveMQ Artemis <b>load balances</b> the sent messages across all consumers on the cluster</p>
+     <p>This example uses JNDI to lookup the JMS Queue and ConnectionFactory objects. If you prefer not to use
+     JNDI, these could be instantiated directly.</p>
+     <p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster between the two nodes
+     and to load balance the messages between the nodes.</p>
+     <pre class="prettyprint">
+     <code>&lt;cluster-connection name="my-cluster"&gt;
+        &lt;address&gt;jms&lt;/address&gt;
+        &lt;connector-ref>netty-connector&lt;/connector-ref>
+        &lt;retry-interval&gt;500&lt;/retry-interval&gt;
+        &lt;use-duplicate-detection&gt;true&lt;/use-duplicate-detection&gt;
+        &lt;message-load-balancing&gt;STRICT&lt;/message-load-balancing&gt;
+        &lt;max-hops&gt;1&lt;/max-hops&gt;
+        &lt;static-connectors>
+           &lt;connector-ref>server1-connector&lt;/connector-ref>
+        &lt;/static-connectors>
+     &lt;/cluster-connection&gt;
+     </code>
+     </pre>
+     <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
+     section of the user manual.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java b/examples/features/clustered/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java
new file mode 100644
index 0000000..453fafc
--- /dev/null
+++ b/examples/features/clustered/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java
@@ -0,0 +1,173 @@
+/*
+ * 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 org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.util.ServerUtil;
+
+/**
+ * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
+ * nodes of the cluster. The cluster is created from a static list of nodes.
+ */
+public class StaticClusteredQueueExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection initialConnection = null;
+
+      Connection connection0 = null;
+
+      Connection connection1 = null;
+
+      Connection connection2 = null;
+
+      Connection connection3 = null;
+
+      try {
+         // Step 2. Use direct instantiation (or JNDI if you like)
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // Step 3. new JMS Connection Factory object from JNDI on server 3
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61619");
+
+         //grab an initial connection and wait, in reality you wouldn't do it this way but since we want to ensure an
+         // equal load balance we do this and then create 4 connections round robined
+         initialConnection = cf0.createConnection();
+
+         Thread.sleep(2000);
+         // Step 6. We create a JMS Connection connection0 which is a connection to server 0
+         connection0 = cf0.createConnection();
+
+         // Step 7. We create a JMS Connection connection1 which is a connection to server 1
+         connection1 = cf0.createConnection();
+
+         // Step 6. We create a JMS Connection connection0 which is a connection to server 0
+         connection2 = cf0.createConnection();
+
+         // Step 7. We create a JMS Connection connection1 which is a connection to server 1
+         connection3 = cf0.createConnection();
+
+         // Step 8. We create a JMS Session on server 0
+         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 9. We create a JMS Session on server 1
+         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 8. We create a JMS Session on server 0
+         Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 9. We create a JMS Session on server 1
+         Session session3 = connection3.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         // Step 10. We start the connections to ensure delivery occurs on them
+         connection0.start();
+
+         connection1.start();
+
+         connection2.start();
+
+         connection3.start();
+
+         // Step 11. We create JMS MessageConsumer objects on server 0 and server 1
+         MessageConsumer consumer0 = session0.createConsumer(queue);
+
+         MessageConsumer consumer1 = session1.createConsumer(queue);
+
+         MessageConsumer consumer2 = session2.createConsumer(queue);
+
+         MessageConsumer consumer3 = session3.createConsumer(queue);
+
+         Thread.sleep(2000);
+
+         // Step 12. We create a JMS MessageProducer object on server 3
+         MessageProducer producer = session3.createProducer(queue);
+
+         // Step 13. We send some messages to server 0
+
+         final int numMessages = 20;
+
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session0.createTextMessage("This is text message " + i);
+
+            producer.send(message);
+
+            System.out.println("Sent message: " + message.getText());
+         }
+         Thread.sleep(2000);
+         // Step 14. We now consume those messages on *both* server 0 and server 1.
+         // We note the messages have been distributed between servers in a round robin fashion
+         // JMS Queues implement point-to-point message where each message is only ever consumed by a
+         // maximum of one consumer
+         int con0Node = ServerUtil.getServer(connection0);
+         int con1Node = ServerUtil.getServer(connection1);
+         int con2Node = ServerUtil.getServer(connection2);
+         int con3Node = ServerUtil.getServer(connection3);
+
+         if (con0Node + con1Node + con2Node + con3Node != 6) {
+            throw new IllegalStateException();
+         }
+         for (int i = 0; i < numMessages; i += 4) {
+            TextMessage message0 = (TextMessage) consumer0.receive(5000);
+
+            System.out.println("Got message: " + message0.getText() + " from node " + con0Node);
+
+            TextMessage message1 = (TextMessage) consumer1.receive(5000);
+
+            System.out.println("Got message: " + message1.getText() + " from node " + con1Node);
+
+            TextMessage message2 = (TextMessage) consumer2.receive(5000);
+
+            System.out.println("Got message: " + message2.getText() + " from node " + con2Node);
+
+            TextMessage message3 = (TextMessage) consumer3.receive(5000);
+
+            System.out.println("Got message: " + message3.getText() + " from node " + con3Node);
+         }
+      }
+      finally {
+         // Step 15. Be sure to close our resources!
+
+         if (initialConnection != null) {
+            initialConnection.close();
+         }
+
+         if (connection0 != null) {
+            connection0.close();
+         }
+
+         if (connection1 != null) {
+            connection1.close();
+         }
+
+         if (connection2 != null) {
+            connection2.close();
+         }
+
+         if (connection3 != null) {
+            connection3.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..b1bfd11
--- /dev/null
+++ b/examples/features/clustered/clustered-static-discovery/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>
+         <!-- connector to the server1 -->
+         <connector name="server1-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <static-connectors>
+               <connector-ref>server1-connector</connector-ref>
+            </static-connectors>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..0412576
--- /dev/null
+++ b/examples/features/clustered/clustered-static-discovery/src/main/resources/activemq/server1/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:61617</connector>
+         <!-- connector to the server0 -->
+         <connector name="server0-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <!-- Clustering configuration -->
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <retry-interval>500</retry-interval>
+            <use-duplicate-detection>true</use-duplicate-detection>
+            <message-load-balancing>STRICT</message-load-balancing>
+            <max-hops>1</max-hops>
+            <static-connectors>
+               <connector-ref>server0-connector</connector-ref>
+            </static-connectors>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>


[17/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/stop-server-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/stop-server-failover/pom.xml b/examples/features/ha/stop-server-failover/pom.xml
new file mode 100644
index 0000000..7fb647c
--- /dev/null
+++ b/examples/features/ha/stop-server-failover/pom.xml
@@ -0,0 +1,160 @@
+<?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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>stop-server-failover</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Stop Server Failover 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>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>false</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>true</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server0</location>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server0</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <location>${basedir}/target/server1</location>
+                     <testURI>tcp://localhost:61617</testURI>
+                     <args>
+                        <param>run</param>
+                     </args>
+                     <name>server1</name>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.StopServerFailoverExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>stop-server-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/stop-server-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/ha/stop-server-failover/readme.html b/examples/features/ha/stop-server-failover/readme.html
new file mode 100644
index 0000000..9486cd6
--- /dev/null
+++ b/examples/features/ha/stop-server-failover/readme.html
@@ -0,0 +1,44 @@
+<!--
+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 Failover Without Transactions 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 Failover Without Transactions 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 two servers coupled as a live-backup pair for high availability (HA), and a client
+     connection failing over from live to backup when the live server is crashed.</p>
+     <p>Failover behavior differs whether the JMS session is transacted or not.</p>
+     <p>When a <em>non-transacted</em> JMS session is used, once and only once delivery is not guaranteed
+        and it is possible some messages will be lost or delivered twice, depending when the failover to the backup server occurs.</p>
+     <p>It is up to the client to deal with such cases. To ensure once and only once delivery, the client must
+        use transacted JMS sessions (as shown in the example for <a href="../transaction-failover/readme.html">failover with transactions</a>).</p>
+     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
+     section of the user manual.</p>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/stop-server-failover/src/main/java/org/apache/activemq/artemis/jms/example/StopServerFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/stop-server-failover/src/main/java/org/apache/activemq/artemis/jms/example/StopServerFailoverExample.java b/examples/features/ha/stop-server-failover/src/main/java/org/apache/activemq/artemis/jms/example/StopServerFailoverExample.java
new file mode 100644
index 0000000..38f06c0
--- /dev/null
+++ b/examples/features/ha/stop-server-failover/src/main/java/org/apache/activemq/artemis/jms/example/StopServerFailoverExample.java
@@ -0,0 +1,117 @@
+/*
+ * 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.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+/**
+ * A simple example that demonstrates failover of the JMS connection from one node to another
+ * when the live server crashes using a JMS <em>non-transacted</em> session.
+ */
+public class StopServerFailoverExample {
+
+   public static void main(final String[] args) throws Exception {
+      final int numMessages = 10;
+
+      Connection connection = null;
+
+      InitialContext initialContext = null;
+
+      try {
+         // Step 1. Get an initial context for looking up JNDI from the server #1
+         initialContext = new InitialContext();
+
+         // Step 2. Look up the JMS resources from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 3. Create a JMS Connection
+         connection = connectionFactory.createConnection();
+
+         // Step 4. Create a *non-transacted* JMS Session with client acknowledgement
+         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+         // Step 5. Start the connection to ensure delivery occurs
+         connection.start();
+
+         // Step 6. Create a JMS MessageProducer and a MessageConsumer
+         MessageProducer producer = session.createProducer(queue);
+         MessageConsumer consumer = session.createConsumer(queue);
+
+         // Step 7. Send some messages to server #1, the live server
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message = session.createTextMessage("This is text message " + i);
+            producer.send(message);
+            System.out.println("Sent message: " + message.getText());
+         }
+
+         // Step 8. Receive and acknowledge half of the sent messages
+         TextMessage message0 = null;
+         for (int i = 0; i < numMessages / 2; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+         message0.acknowledge();
+
+         // Step 9. Receive the 2nd half of the sent messages but *do not* acknowledge them yet
+         for (int i = numMessages / 2; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.println("Got message: " + message0.getText());
+         }
+
+         // Step 10. Crash server #0, the live server, and wait a little while to make sure
+         // it has really crashed
+         System.out.println("Stop the live server by logging into JConsole and then press any key to continue...");
+         System.in.read();
+
+         // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
+         // backup server has occurred
+         try {
+            message0.acknowledge();
+         }
+         catch (JMSException e) {
+            System.err.println("Got exception while acknowledging message: " + e.getMessage());
+         }
+
+         // Step 12. Consume again the 2nd half of the messages again. Note that they are not considered as redelivered.
+         for (int i = numMessages / 2; i < numMessages; i++) {
+            message0 = (TextMessage) consumer.receive(5000);
+            System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
+         }
+         message0.acknowledge();
+      }
+      finally {
+         // Step 13. Be sure to close our resources!
+
+         if (connection != null) {
+            connection.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/stop-server-failover/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/ha/stop-server-failover/src/main/resources/jndi.properties b/examples/features/ha/stop-server-failover/src/main/resources/jndi.properties
new file mode 100644
index 0000000..7f7a19f
--- /dev/null
+++ b/examples/features/ha/stop-server-failover/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/6b17d966/examples/features/ha/transaction-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/transaction-failover/pom.xml b/examples/features/ha/transaction-failover/pom.xml
new file mode 100644
index 0000000..76a4a8e
--- /dev/null
+++ b/examples/features/ha/transaction-failover/pom.xml
@@ -0,0 +1,104 @@
+<?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.failover</groupId>
+      <artifactId>broker-failover</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>transaction-failover</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Transaction Failover Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.geronimo.specs</groupId>
+         <artifactId>geronimo-jms_2.0_spec</artifactId>
+      </dependency>
+   </dependencies>
+
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.TransactionFailoverExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.failover</groupId>
+                  <artifactId>transaction-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/transaction-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/ha/transaction-failover/readme.html b/examples/features/ha/transaction-failover/readme.html
new file mode 100644
index 0000000..15f119f
--- /dev/null
+++ b/examples/features/ha/transaction-failover/readme.html
@@ -0,0 +1,46 @@
+<!--
+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 Failover With Transaction 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 Failover With Transaction Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
+
+
+     <p>This example demonstrates two servers coupled as a live-backup pair for high availability (HA), and a client
+     connection failing over from live to backup when the live server is crashed.</p>
+     <p>Failover behavior differs whether the JMS session is transacter or not.</p>
+     <p>When a <em>transacted</em> JMS session is used, once-and-only once delivery is guaranteed.</p>
+     <ul>
+        <li>if the failover occurs while there is an in-flight transaction, the transaction will be flagged as <em>rollback only</em>. In that case, the JMS client
+           will need to retry the transaction work.</li>
+        <li>if the failover occurs while there is <em>no</em> in-flight transaction, the failover will be transparent to the user.</li>
+     </ul>
+     <p>ActiveMQ Artemis also provides an example for <a href="../non-transactional-failover/readme.html">non-transaction failover</a>.</p>
+     <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
+     section of the user manual.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/TransactionFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/features/ha/transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/TransactionFailoverExample.java b/examples/features/ha/transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/TransactionFailoverExample.java
new file mode 100644
index 0000000..58c514a
--- /dev/null
+++ b/examples/features/ha/transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/TransactionFailoverExample.java
@@ -0,0 +1,167 @@
+/*
+ * 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 org.apache.activemq.artemis.api.core.Message;
+import org.apache.activemq.artemis.util.ServerUtil;
+
+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.jms.TransactionRolledBackException;
+import javax.naming.InitialContext;
+
+/**
+ * A simple example that demonstrates failover of the JMS connection from one node to another
+ * when the live server crashes using a JMS <em>transacted</em> session.
+ */
+public class TransactionFailoverExample {
+
+   // You need to guarantee uniqueIDs when using duplicate detection
+   // It needs to be unique even after a restart
+   // as these IDs are stored on the journal for control
+   // We recommend some sort of UUID, but for this example the Current Time as string would be enough
+   static String uniqueID = Long.toString(System.currentTimeMillis());
+
+   private static Process server0;
+
+   private static Process server1;
+
+   public static void main(final String[] args) throws Exception {
+      final int numMessages = 10;
+
+      Connection connection = null;
+
+      InitialContext initialContext = null;
+
+      try {
+         server0 = ServerUtil.startServer(args[0], TransactionFailoverExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], TransactionFailoverExample.class.getSimpleName() + "1", 1, 5000);
+
+         // Step 1. Get an initial context for looking up JNDI from the server #1
+         initialContext = new InitialContext();
+
+         // Step 2. Look-up the JMS resources from JNDI
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 3. We create a JMS Connection
+         connection = connectionFactory.createConnection();
+
+         // Step 4. We create a *transacted* JMS Session
+         Session session = connection.createSession(true, 0);
+
+         // Step 5. We start the connection to ensure delivery occurs
+         connection.start();
+
+         // Step 6. We create a JMS MessageProducer
+         MessageProducer producer = session.createProducer(queue);
+
+         // Step 7. We create a JMS MessageConsumer
+         MessageConsumer consumer = session.createConsumer(queue);
+
+         // Step 8. We send half of the messages, kill the live server and send the remaining messages
+         sendMessages(session, producer, numMessages, true);
+
+         // Step 9. As failover occurred during transaction, the session has been marked for rollback only
+         try {
+            session.commit();
+         }
+         catch (TransactionRolledBackException e) {
+            System.err.println("transaction has been rolled back: " + e.getMessage());
+         }
+
+         // Step 10. We resend all the messages
+         sendMessages(session, producer, numMessages, false);
+
+         // Step 11. We commit the session successfully: the messages will be all delivered to the activated backup
+         // server
+         session.commit();
+
+         // Step 12. We are now transparently reconnected to server #0, the backup server.
+         // We consume the messages sent before the crash of the live server and commit the session.
+         for (int i = 0; i < numMessages; i++) {
+            TextMessage message0 = (TextMessage) consumer.receive(5000);
+
+            if (message0 == null) {
+               throw new IllegalStateException("Example failed - message wasn't received");
+            }
+
+            System.out.println("Got message: " + message0.getText());
+         }
+
+         session.commit();
+
+         System.out.println("Other message on the server? " + consumer.receive(5000));
+      }
+      finally {
+         // Step 13. Be sure to close our resources!
+
+         if (connection != null) {
+            connection.close();
+         }
+
+         if (initialContext != null) {
+            initialContext.close();
+         }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
+      }
+   }
+
+   private static void sendMessages(final Session session,
+                                    final MessageProducer producer,
+                                    final int numMessages,
+                                    final boolean killServer) throws Exception {
+
+      // We send half of messages
+      for (int i = 0; i < numMessages / 2; i++) {
+         TextMessage message = session.createTextMessage("This is text message " + i);
+
+         message.setStringProperty(Message.HDR_DUPLICATE_DETECTION_ID.toString(), uniqueID + i);
+
+         producer.send(message);
+
+         System.out.println("Sent message: " + message.getText());
+      }
+
+      if (killServer) {
+         Thread.sleep(5000);
+
+         ServerUtil.killServer(server0);
+      }
+
+      // We send the remaining half of messages
+      for (int i = numMessages / 2; i < numMessages; i++) {
+         TextMessage message = session.createTextMessage("This is text message " + i);
+
+         // We set the duplicate detection header - so the server will ignore the same message
+         // if sent again after failover
+
+         message.setStringProperty(Message.HDR_DUPLICATE_DETECTION_ID.toString(), uniqueID + i);
+
+         producer.send(message);
+
+         System.out.println("Sent message: " + message.getText());
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/transaction-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/transaction-failover/src/main/resources/activemq/server0/broker.xml b/examples/features/ha/transaction-failover/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..916fdf5
--- /dev/null
+++ b/examples/features/ha/transaction-failover/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,98 @@
+<?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>
+
+      <ha-policy>
+         <shared-store>
+            <master>
+               <failover-on-shutdown>true</failover-on-shutdown>
+            </master>
+         </shared-store>
+      </ha-policy>
+
+      <!-- Connectors -->
+
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <broadcast-groups>
+         <broadcast-group name="bg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>1000</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="dg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>60000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <discovery-group-ref discovery-group-name="dg-group1"/>
+         </cluster-connection>
+      </cluster-connections>
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/transaction-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/ha/transaction-failover/src/main/resources/activemq/server1/broker.xml b/examples/features/ha/transaction-failover/src/main/resources/activemq/server1/broker.xml
new file mode 100644
index 0000000..055f04a
--- /dev/null
+++ b/examples/features/ha/transaction-failover/src/main/resources/activemq/server1/broker.xml
@@ -0,0 +1,98 @@
+<?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>
+
+      <ha-policy>
+         <shared-store>
+            <slave>
+               <failover-on-shutdown>true</failover-on-shutdown>
+            </slave>
+         </shared-store>
+      </ha-policy>
+
+      <!-- Connectors -->
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61617</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+      </acceptors>
+
+      <broadcast-groups>
+         <broadcast-group name="bg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <broadcast-period>1000</broadcast-period>
+            <connector-ref>netty-connector</connector-ref>
+         </broadcast-group>
+      </broadcast-groups>
+
+      <discovery-groups>
+         <discovery-group name="dg-group1">
+            <group-address>${udp-address:231.7.7.7}</group-address>
+            <group-port>9876</group-port>
+            <refresh-timeout>60000</refresh-timeout>
+         </discovery-group>
+      </discovery-groups>
+
+      <cluster-connections>
+         <cluster-connection name="my-cluster">
+            <address>jms</address>
+            <connector-ref>netty-connector</connector-ref>
+            <discovery-group-ref discovery-group-name="dg-group1"/>
+         </cluster-connection>
+      </cluster-connections>
+
+      <!-- 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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/ha/transaction-failover/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/ha/transaction-failover/src/main/resources/jndi.properties b/examples/features/ha/transaction-failover/src/main/resources/jndi.properties
new file mode 100644
index 0000000..7f7a19f
--- /dev/null
+++ b/examples/features/ha/transaction-failover/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/6b17d966/examples/features/perf/perf/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/perf/perf/pom.xml b/examples/features/perf/perf/pom.xml
new file mode 100644
index 0000000..bcab911
--- /dev/null
+++ b/examples/features/perf/perf/pom.xml
@@ -0,0 +1,156 @@
+<?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.soak</groupId>
+      <artifactId>perf-root</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>perf</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS PerfExample Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-core-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-commons</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>io.netty</groupId>
+         <artifactId>netty-all</artifactId>
+         <version>${netty.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+   </dependencies>
+
+   <profiles>
+      <profile>
+         <id>server</id>
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.apache.activemq</groupId>
+                  <artifactId>artemis-maven-plugin</artifactId>
+                     <executions>
+                        <execution>
+                           <id>create</id>
+                           <goals>
+                              <goal>create</goal>
+                           </goals>
+                        </execution>
+                        <execution>
+                           <id>runClient</id>
+                           <goals>
+                              <goal>runClient</goal>
+                           </goals>
+                           <configuration>
+                              <clientClass>org.apache.activemq.artemis.jms.example.Server</clientClass>
+                           </configuration>
+                        </execution>
+                     </executions>
+                     <dependencies>
+                        <dependency>
+                           <groupId>org.apache.activemq.examples.soak</groupId>
+                           <artifactId>perf</artifactId>
+                           <version>${project.version}</version>
+                        </dependency>
+                     </dependencies>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
+      <profile>
+         <id>listener</id>
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.codehaus.mojo</groupId>
+                  <artifactId>exec-maven-plugin</artifactId>
+                  <version>1.1</version>
+                  <executions>
+                     <execution>
+                        <phase>package</phase>
+                        <goals>
+                           <goal>java</goal>
+                        </goals>
+                     </execution>
+                  </executions>
+                  <configuration>
+                     <mainClass>org.apache.activemq.artemis.jms.example.PerfListener</mainClass>
+                  </configuration>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
+      <profile>
+         <id>sender</id>
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.codehaus.mojo</groupId>
+                  <artifactId>exec-maven-plugin</artifactId>
+                  <version>1.1</version>
+                  <executions>
+                     <execution>
+                        <phase>package</phase>
+                        <goals>
+                           <goal>java</goal>
+                        </goals>
+                     </execution>
+                  </executions>
+                  <configuration>
+                     <mainClass>org.apache.activemq.artemis.jms.example.PerfSender</mainClass>
+                  </configuration>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
+   </profiles>
+
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/perf/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/perf/perf/readme.html b/examples/features/perf/perf/readme.html
new file mode 100644
index 0000000..aa42266
--- /dev/null
+++ b/examples/features/perf/perf/readme.html
@@ -0,0 +1,39 @@
+<!--
+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 Selector 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 Simple Performance</h1>
+
+    <p>To start the server run <code>mvn verify -Pexample</code></p>
+
+    <p>To start the listener run <code>mvn -Plistener package</code></p>
+
+    <p>To start the sender run <code>mvn -Psender package</code></p>
+
+    <p>To configure the clients simply edit the <code>perf.properties</code> or <code>client.jndi.properties</code> in the
+        <code>src/main/resources</code> directory</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfBase.java
----------------------------------------------------------------------
diff --git a/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfBase.java b/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfBase.java
new file mode 100644
index 0000000..bf18077
--- /dev/null
+++ b/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfBase.java
@@ -0,0 +1,409 @@
+/*
+ * 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.BytesMessage;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
+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.Session;
+import javax.naming.InitialContext;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.Properties;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.logging.Logger;
+
+import org.apache.activemq.artemis.utils.TokenBucketLimiter;
+import org.apache.activemq.artemis.utils.TokenBucketLimiterImpl;
+
+public abstract class PerfBase {
+
+   private static final Logger log = Logger.getLogger(PerfSender.class.getName());
+
+   private static final String DEFAULT_PERF_PROPERTIES_FILE_NAME = "target/classes/perf.properties";
+
+   private static byte[] randomByteArray(final int length) {
+      byte[] bytes = new byte[length];
+
+      Random random = new Random();
+
+      for (int i = 0; i < length; i++) {
+         bytes[i] = Integer.valueOf(random.nextInt()).byteValue();
+      }
+
+      return bytes;
+   }
+
+   protected static String getPerfFileName(final String[] args) {
+      String fileName;
+
+      if (args.length > 0) {
+         fileName = args[0];
+      }
+      else {
+         fileName = PerfBase.DEFAULT_PERF_PROPERTIES_FILE_NAME;
+      }
+
+      return fileName;
+   }
+
+   protected static PerfParams getParams(final String fileName) throws Exception {
+      Properties props = null;
+
+      InputStream is = null;
+
+      try {
+         is = new FileInputStream(fileName);
+
+         props = new Properties();
+
+         props.load(is);
+      }
+      finally {
+         if (is != null) {
+            is.close();
+         }
+      }
+
+      int noOfMessages = Integer.valueOf(props.getProperty("num-messages"));
+      int noOfWarmupMessages = Integer.valueOf(props.getProperty("num-warmup-messages"));
+      int messageSize = Integer.valueOf(props.getProperty("message-size"));
+      boolean durable = Boolean.valueOf(props.getProperty("durable"));
+      boolean transacted = Boolean.valueOf(props.getProperty("transacted"));
+      int batchSize = Integer.valueOf(props.getProperty("batch-size"));
+      boolean drainQueue = Boolean.valueOf(props.getProperty("drain-queue"));
+      String destinationLookup = props.getProperty("destination-lookup");
+      String connectionFactoryLookup = props.getProperty("connection-factory-lookup");
+      int throttleRate = Integer.valueOf(props.getProperty("throttle-rate"));
+      boolean dupsOK = Boolean.valueOf(props.getProperty("dups-ok-acknowlege"));
+      boolean disableMessageID = Boolean.valueOf(props.getProperty("disable-message-id"));
+      boolean disableTimestamp = Boolean.valueOf(props.getProperty("disable-message-timestamp"));
+
+      PerfBase.log.info("num-messages: " + noOfMessages);
+      PerfBase.log.info("num-warmup-messages: " + noOfWarmupMessages);
+      PerfBase.log.info("message-size: " + messageSize);
+      PerfBase.log.info("durable: " + durable);
+      PerfBase.log.info("transacted: " + transacted);
+      PerfBase.log.info("batch-size: " + batchSize);
+      PerfBase.log.info("drain-queue: " + drainQueue);
+      PerfBase.log.info("throttle-rate: " + throttleRate);
+      PerfBase.log.info("connection-factory-lookup: " + connectionFactoryLookup);
+      PerfBase.log.info("destination-lookup: " + destinationLookup);
+      PerfBase.log.info("disable-message-id: " + disableMessageID);
+      PerfBase.log.info("disable-message-timestamp: " + disableTimestamp);
+      PerfBase.log.info("dups-ok-acknowledge: " + dupsOK);
+
+      PerfParams perfParams = new PerfParams();
+      perfParams.setNoOfMessagesToSend(noOfMessages);
+      perfParams.setNoOfWarmupMessages(noOfWarmupMessages);
+      perfParams.setMessageSize(messageSize);
+      perfParams.setDurable(durable);
+      perfParams.setSessionTransacted(transacted);
+      perfParams.setBatchSize(batchSize);
+      perfParams.setDrainQueue(drainQueue);
+      perfParams.setConnectionFactoryLookup(connectionFactoryLookup);
+      perfParams.setDestinationLookup(destinationLookup);
+      perfParams.setThrottleRate(throttleRate);
+      perfParams.setDisableMessageID(disableMessageID);
+      perfParams.setDisableTimestamp(disableTimestamp);
+      perfParams.setDupsOK(dupsOK);
+
+      return perfParams;
+   }
+
+   private final PerfParams perfParams;
+
+   protected PerfBase(final PerfParams perfParams) {
+      this.perfParams = perfParams;
+   }
+
+   private ConnectionFactory factory;
+
+   private Connection connection;
+
+   private Session session;
+
+   private Destination destination;
+
+   private long start;
+
+   private void init() throws Exception {
+      InitialContext ic = new InitialContext();
+      System.out.println("ic = " + ic);
+      factory = (ConnectionFactory) ic.lookup(perfParams.getConnectionFactoryLookup());
+
+      destination = (Destination) ic.lookup(perfParams.getDestinationLookup());
+
+      connection = factory.createConnection();
+
+      session = connection.createSession(perfParams.isSessionTransacted(), perfParams.isDupsOK() ? Session.DUPS_OK_ACKNOWLEDGE : Session.AUTO_ACKNOWLEDGE);
+
+      ic.close();
+   }
+
+   private void displayAverage(final long numberOfMessages, final long start, final long end) {
+      double duration = (1.0 * end - start) / 1000; // in seconds
+      double average = 1.0 * numberOfMessages / duration;
+      PerfBase.log.info(String.format("average: %.2f msg/s (%d messages in %2.2fs)", average, numberOfMessages, duration));
+   }
+
+   protected void runSender() {
+      try {
+         init();
+
+         if (perfParams.isDrainQueue()) {
+            drainQueue();
+         }
+
+         start = System.currentTimeMillis();
+         PerfBase.log.info("warming up by sending " + perfParams.getNoOfWarmupMessages() + " messages");
+         sendMessages(perfParams.getNoOfWarmupMessages(), perfParams.getBatchSize(), perfParams.isDurable(), perfParams.isSessionTransacted(), false, perfParams.getThrottleRate(), perfParams.getMessageSize());
+         PerfBase.log.info("warmed up");
+         start = System.currentTimeMillis();
+         sendMessages(perfParams.getNoOfMessagesToSend(), perfParams.getBatchSize(), perfParams.isDurable(), perfParams.isSessionTransacted(), true, perfParams.getThrottleRate(), perfParams.getMessageSize());
+         long end = System.currentTimeMillis();
+         displayAverage(perfParams.getNoOfMessagesToSend(), start, end);
+      }
+      catch (Exception e) {
+         e.printStackTrace();
+      }
+      finally {
+         if (session != null) {
+            try {
+               session.close();
+            }
+            catch (Exception e) {
+               e.printStackTrace();
+            }
+         }
+         if (connection != null) {
+            try {
+               connection.close();
+            }
+            catch (JMSException e) {
+               e.printStackTrace();
+            }
+         }
+      }
+   }
+
+   protected void runListener() {
+      try {
+         init();
+
+         if (perfParams.isDrainQueue()) {
+            drainQueue();
+         }
+
+         MessageConsumer consumer = session.createConsumer(destination);
+
+         connection.start();
+
+         PerfBase.log.info("READY!!!");
+
+         CountDownLatch countDownLatch = new CountDownLatch(1);
+         consumer.setMessageListener(new PerfListener(countDownLatch, perfParams));
+         countDownLatch.await();
+         long end = System.currentTimeMillis();
+         // start was set on the first received message
+         displayAverage(perfParams.getNoOfMessagesToSend(), start, end);
+      }
+      catch (Exception e) {
+         e.printStackTrace();
+      }
+      finally {
+         if (session != null) {
+            try {
+               session.close();
+            }
+            catch (Exception e) {
+               e.printStackTrace();
+            }
+         }
+         if (connection != null) {
+            try {
+               connection.close();
+            }
+            catch (JMSException e) {
+               e.printStackTrace();
+            }
+         }
+      }
+   }
+
+   private void drainQueue() throws Exception {
+      PerfBase.log.info("Draining queue");
+
+      Session drainSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+      MessageConsumer consumer = drainSession.createConsumer(destination);
+
+      connection.start();
+
+      Message message = null;
+
+      int count = 0;
+      do {
+         message = consumer.receive(3000);
+
+         if (message != null) {
+            message.acknowledge();
+
+            count++;
+         }
+      } while (message != null);
+
+      drainSession.close();
+
+      PerfBase.log.info("Drained " + count + " messages");
+   }
+
+   private void sendMessages(final int numberOfMessages,
+                             final int txBatchSize,
+                             final boolean durable,
+                             final boolean transacted,
+                             final boolean display,
+                             final int throttleRate,
+                             final int messageSize) throws Exception {
+      MessageProducer producer = session.createProducer(destination);
+
+      producer.setDeliveryMode(perfParams.isDurable() ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
+
+      producer.setDisableMessageID(perfParams.isDisableMessageID());
+
+      producer.setDisableMessageTimestamp(perfParams.isDisableTimestamp());
+
+      BytesMessage message = session.createBytesMessage();
+
+      byte[] payload = PerfBase.randomByteArray(messageSize);
+
+      message.writeBytes(payload);
+
+      final int modulo = 2000;
+
+      TokenBucketLimiter tbl = throttleRate != -1 ? new TokenBucketLimiterImpl(throttleRate, false) : null;
+
+      boolean committed = false;
+      for (int i = 1; i <= numberOfMessages; i++) {
+         producer.send(message);
+
+         if (transacted) {
+            if (i % txBatchSize == 0) {
+               session.commit();
+               committed = true;
+            }
+            else {
+               committed = false;
+            }
+         }
+
+         if (display && i % modulo == 0) {
+            double duration = (1.0 * System.currentTimeMillis() - start) / 1000;
+            PerfBase.log.info(String.format("sent %6d messages in %2.2fs", i, duration));
+         }
+
+         if (tbl != null) {
+            tbl.limit();
+         }
+      }
+      if (transacted && !committed) {
+         session.commit();
+      }
+   }
+
+   private class PerfListener implements MessageListener {
+
+      private final CountDownLatch countDownLatch;
+
+      private final PerfParams perfParams;
+
+      private boolean warmingUp = true;
+
+      private boolean started = false;
+
+      private final int modulo;
+
+      private final AtomicLong count = new AtomicLong(0);
+
+      public PerfListener(final CountDownLatch countDownLatch, final PerfParams perfParams) {
+         this.countDownLatch = countDownLatch;
+         this.perfParams = perfParams;
+         warmingUp = perfParams.getNoOfWarmupMessages() > 0;
+         modulo = 2000;
+      }
+
+      public void onMessage(final Message message) {
+         try {
+            if (warmingUp) {
+               boolean committed = checkCommit();
+               if (count.incrementAndGet() == perfParams.getNoOfWarmupMessages()) {
+                  PerfBase.log.info("warmed up after receiving " + count.longValue() + " msgs");
+                  if (!committed) {
+                     checkCommit();
+                  }
+                  warmingUp = false;
+               }
+               return;
+            }
+
+            if (!started) {
+               started = true;
+               // reset count to take stats
+               count.set(0);
+               start = System.currentTimeMillis();
+            }
+
+            long currentCount = count.incrementAndGet();
+            boolean committed = checkCommit();
+            if (currentCount == perfParams.getNoOfMessagesToSend()) {
+               if (!committed) {
+                  checkCommit();
+               }
+               countDownLatch.countDown();
+            }
+            if (currentCount % modulo == 0) {
+               double duration = (1.0 * System.currentTimeMillis() - start) / 1000;
+               PerfBase.log.info(String.format("received %6d messages in %2.2fs", currentCount, duration));
+            }
+         }
+         catch (Exception e) {
+            e.printStackTrace();
+         }
+      }
+
+      private boolean checkCommit() throws Exception {
+         if (perfParams.isSessionTransacted()) {
+            if (count.longValue() % perfParams.getBatchSize() == 0) {
+               session.commit();
+
+               return true;
+            }
+         }
+         return false;
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfListener.java
----------------------------------------------------------------------
diff --git a/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfListener.java b/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfListener.java
new file mode 100644
index 0000000..3f2c478
--- /dev/null
+++ b/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfListener.java
@@ -0,0 +1,46 @@
+/*
+ * 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.logging.Logger;
+
+public class PerfListener extends PerfBase {
+
+   private static final Logger log = Logger.getLogger(PerfListener.class.getName());
+
+   public static void main(final String[] args) {
+      try {
+         String fileName = PerfBase.getPerfFileName(args);
+
+         PerfParams params = PerfBase.getParams(fileName);
+
+         new PerfListener(params).run();
+      }
+      catch (Exception e) {
+         e.printStackTrace();
+      }
+   }
+
+   private PerfListener(final PerfParams perfParams) {
+      super(perfParams);
+   }
+
+   public void run() throws Exception {
+      runListener();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfParams.java
----------------------------------------------------------------------
diff --git a/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfParams.java b/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfParams.java
new file mode 100644
index 0000000..c358171
--- /dev/null
+++ b/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfParams.java
@@ -0,0 +1,158 @@
+/*
+ * 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.io.Serializable;
+
+/**
+ * Class that holds the parameters used in the performance examples
+ */
+public class PerfParams implements Serializable {
+
+   private static final long serialVersionUID = -4336539641012356002L;
+
+   private int noOfMessagesToSend = 1000;
+
+   private int noOfWarmupMessages;
+
+   private int messageSize = 1024; // in bytes
+
+   private boolean durable = false;
+
+   private boolean isSessionTransacted = false;
+
+   private int batchSize = 5000;
+
+   private boolean drainQueue = true;
+
+   private String connectionFactoryLookup;
+
+   private String destinationLookup;
+
+   private int throttleRate;
+
+   private boolean disableMessageID;
+
+   private boolean disableTimestamp;
+
+   private boolean dupsOK;
+
+   public synchronized int getNoOfMessagesToSend() {
+      return noOfMessagesToSend;
+   }
+
+   public synchronized void setNoOfMessagesToSend(final int noOfMessagesToSend) {
+      this.noOfMessagesToSend = noOfMessagesToSend;
+   }
+
+   public synchronized int getNoOfWarmupMessages() {
+      return noOfWarmupMessages;
+   }
+
+   public synchronized void setNoOfWarmupMessages(final int noOfWarmupMessages) {
+      this.noOfWarmupMessages = noOfWarmupMessages;
+   }
+
+   public synchronized int getMessageSize() {
+      return messageSize;
+   }
+
+   public synchronized void setMessageSize(final int messageSize) {
+      this.messageSize = messageSize;
+   }
+
+   public synchronized boolean isDurable() {
+      return durable;
+   }
+
+   public synchronized void setDurable(final boolean durable) {
+      this.durable = durable;
+   }
+
+   public synchronized boolean isSessionTransacted() {
+      return isSessionTransacted;
+   }
+
+   public synchronized void setSessionTransacted(final boolean isSessionTransacted) {
+      this.isSessionTransacted = isSessionTransacted;
+   }
+
+   public synchronized int getBatchSize() {
+      return batchSize;
+   }
+
+   public synchronized void setBatchSize(final int batchSize) {
+      this.batchSize = batchSize;
+   }
+
+   public synchronized boolean isDrainQueue() {
+      return drainQueue;
+   }
+
+   public synchronized void setDrainQueue(final boolean drainQueue) {
+      this.drainQueue = drainQueue;
+   }
+
+   public synchronized String getConnectionFactoryLookup() {
+      return connectionFactoryLookup;
+   }
+
+   public synchronized void setConnectionFactoryLookup(final String connectionFactoryLookup) {
+      this.connectionFactoryLookup = connectionFactoryLookup;
+   }
+
+   public synchronized String getDestinationLookup() {
+      return destinationLookup;
+   }
+
+   public synchronized void setDestinationLookup(final String destinationLookup) {
+      this.destinationLookup = destinationLookup;
+   }
+
+   public synchronized int getThrottleRate() {
+      return throttleRate;
+   }
+
+   public synchronized void setThrottleRate(final int throttleRate) {
+      this.throttleRate = throttleRate;
+   }
+
+   public synchronized boolean isDisableMessageID() {
+      return disableMessageID;
+   }
+
+   public synchronized void setDisableMessageID(final boolean disableMessageID) {
+      this.disableMessageID = disableMessageID;
+   }
+
+   public synchronized boolean isDisableTimestamp() {
+      return disableTimestamp;
+   }
+
+   public synchronized void setDisableTimestamp(final boolean disableTimestamp) {
+      this.disableTimestamp = disableTimestamp;
+   }
+
+   public synchronized boolean isDupsOK() {
+      return dupsOK;
+   }
+
+   public synchronized void setDupsOK(final boolean dupsOK) {
+      this.dupsOK = dupsOK;
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfSender.java
----------------------------------------------------------------------
diff --git a/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfSender.java b/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfSender.java
new file mode 100644
index 0000000..6649bfa
--- /dev/null
+++ b/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/PerfSender.java
@@ -0,0 +1,46 @@
+/*
+ * 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.logging.Logger;
+
+public class PerfSender extends PerfBase {
+
+   private static final Logger log = Logger.getLogger(PerfSender.class.getName());
+
+   public static void main(final String[] args) {
+      try {
+         String fileName = PerfBase.getPerfFileName(args);
+
+         PerfParams params = PerfBase.getParams(fileName);
+
+         new PerfSender(params).run();
+      }
+      catch (Exception e) {
+         e.printStackTrace();
+      }
+   }
+
+   private PerfSender(final PerfParams perfParams) {
+      super(perfParams);
+   }
+
+   public void run() throws Exception {
+      runSender();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java
----------------------------------------------------------------------
diff --git a/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java b/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java
new file mode 100644
index 0000000..33ccd0e
--- /dev/null
+++ b/examples/features/perf/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java
@@ -0,0 +1,27 @@
+/*
+ * 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;
+
+public class Server {
+
+   public static void main(String[] arg) {
+      System.out.println("***********************************************************************************");
+      System.out.println("You need to start manually under ./target/server/bin just run ./artemis run");
+      System.out.println("***********************************************************************************");
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/perf/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/perf/perf/src/main/resources/activemq/server0/broker.xml b/examples/features/perf/perf/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..a642ac5
--- /dev/null
+++ b/examples/features/perf/perf/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,46 @@
+<?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">
+      <queue name="perfQueue"/>
+   </jms>
+
+   <core xmlns="urn:activemq:core">
+
+      <security-enabled>false</security-enabled>
+      <persistence-enabled>true</persistence-enabled>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
+      </acceptors>
+
+      <queues>
+         <queue name="perfQueue">
+            <address>perfAddress</address>
+         </queue>
+      </queues>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/perf/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/perf/perf/src/main/resources/jndi.properties b/examples/features/perf/perf/src/main/resources/jndi.properties
new file mode 100644
index 0000000..bcf6926
--- /dev/null
+++ b/examples/features/perf/perf/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?tcp-no-delay=false&tcp-send-buffer-size=1048576&tcp-receive-buffer-size=1048576
+queue.perfQueue=perfQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/perf/src/main/resources/perf.properties
----------------------------------------------------------------------
diff --git a/examples/features/perf/perf/src/main/resources/perf.properties b/examples/features/perf/perf/src/main/resources/perf.properties
new file mode 100644
index 0000000..f5ca7be
--- /dev/null
+++ b/examples/features/perf/perf/src/main/resources/perf.properties
@@ -0,0 +1,30 @@
+# 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.
+
+num-messages=100000
+num-warmup-messages=1000
+message-size=1024
+durable=false
+transacted=false
+batch-size=1000
+drain-queue=false
+destination-lookup=perfQueue
+connection-factory-lookup=ConnectionFactory
+throttle-rate=-1
+dups-ok-acknowledge=false
+disable-message-id=true
+disable-message-timestamp=true

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/perf/pom.xml b/examples/features/perf/pom.xml
new file mode 100644
index 0000000..eaafdaf
--- /dev/null
+++ b/examples/features/perf/pom.xml
@@ -0,0 +1,50 @@
+<?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</groupId>
+      <artifactId>artemis-examples</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+   </parent>
+
+   <groupId>org.apache.activemq.examples.soak</groupId>
+   <artifactId>perf-root</artifactId>
+   <packaging>pom</packaging>
+   <name>ActiveMQ Artemis Performance Examples</name>
+
+   <!-- Properties -->
+   <properties>
+      <!--
+      Explicitly declaring the source encoding eliminates the following
+      message: [WARNING] Using platform encoding (UTF-8 actually) to copy
+      filtered resources, i.e. build is platform dependent!
+      -->
+      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+      <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
+   </properties>
+
+   <modules>
+      <module>perf</module>
+      <module>soak</module>
+   </modules>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/perf/soak/README
----------------------------------------------------------------------
diff --git a/examples/features/perf/soak/README b/examples/features/perf/soak/README
new file mode 100644
index 0000000..b69a1ac
--- /dev/null
+++ b/examples/features/perf/soak/README
@@ -0,0 +1,85 @@
+****************************************************
+* Soak Test For Manual Reconnection of JMS Clients *
+****************************************************
+
+Running the Soak Tests
+=======================
+
+Run The Server Standalone
+==========================
+
+Use the Profile server
+   mvn -Pserver verify
+
+That will create a server under ./target/server0
+
+
+You can define the property server.dir under the same Profile to create other servers. or you could do it manually if desired using the regular ./artemis create
+
+   $ mvn -Dserver.dir=server1 -Pserver verify
+
+server1 should contain a copy of configuration equivalent to that found under the server0 director with different
+settings.
+
+To run a server with the same configuration but on a different host.  Check out this source on the host machine and
+change:
+* activemq.remoting.netty.host property in broker.xml
+* bindAddress and rmiBindAddress properties in activemq-beans.xml
+
+  $ mvn verify -P server
+
+
+To run the server just start it manually
+
+Configure Server Dump
+=====================
+
+The server can "dump" info at regular interval. In broker.xml, set
+
+   <server-dump-interval>10000</server-dump-interval>
+
+to have infos every 10s:
+
+**** Server Dump ****
+date:            Mon Aug 17 18:19:07 CEST 2009
+free memory:      500,79 MiB
+max memory:       1,95 GiB
+total memory:     507,13 MiB
+available memory: 99,68%
+total paging memory:   0,00 B
+# of thread:     19
+# of conns:      0
+********************
+
+Run The Clients
+===============
+
+The clients can be run separate from the server using:
+
+  $ mvn verify -Premote
+
+Parameters are specified in soak.properties.
+
+The duration of the tests is configured by duration-in-minutes (defaults to 2 minutes, set to
+-1 to run the test indefinitely).
+
+To configure the soak properties different to the defaults for the clients, use the system property
+To specify the JNDI server to connect to, use the system property jndi.address
+
+  $ mvn verify -Premote -Dsoak.props=<path to properties> -Pjndi.address=jnp:remote.host:1099
+
+Every 1000th message, the clients will display their recent activity:
+
+INFO: received 10000 messages in 5,71s (total: 55s)
+
+At the end of the run, the sender and receiver will sum up their activity:
+
+INFO: Received 223364 messages in 2,01 minutes
+
+Kill The Server And Check Manual Reconnection
+==============================================
+
+You can kill the server (ctl+c or kill -9), the clients are configured to reconnect
+indefinitely to the same single server (even in case of clean shutdown)
+Once the server restarts, all the clients will resume their activities after reconnecting
+to the server.


[39/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/bridge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/bridge/pom.xml b/examples/broker-features/standard/bridge/pom.xml
deleted file mode 100644
index db1caf8..0000000
--- a/examples/broker-features/standard/bridge/pom.xml
+++ /dev/null
@@ -1,167 +0,0 @@
-<?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>core-bridge</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis Core Bridge Example</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-server</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
-   </dependencies>
-
-   <build>
-      <plugins>
-         <plugin>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-maven-plugin</artifactId>
-            <executions>
-               <execution>
-                  <id>create0</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <libList>
-                        <!-- For the transformer -->
-                        <arg>org.apache.activemq.examples.broker:core-bridge:${project.version}</arg>
-                     </libList>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server0</instance>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>create1</id>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-                  <configuration>
-                     <libList>
-                        <!-- For the transformer -->
-                        <arg>org.apache.activemq.examples.broker:core-bridge:${project.version}</arg>
-                     </libList>
-                     <ignore>${noServer}</ignore>
-                     <instance>${basedir}/target/server1</instance>
-                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                     <portOffset>1</portOffset>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server0</location>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server0</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <location>${basedir}/target/server1</location>
-                     <testURI>tcp://localhost:61617</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                     <name>server1</name>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.BridgeExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop0</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server0</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop1</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <location>${basedir}/target/server1</location>
-                     <args>
-                        <param>stop</param>
-                     </args>
-                  </configuration>
-               </execution>
-            </executions>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.examples.broker</groupId>
-                  <artifactId>core-bridge</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/bridge/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/bridge/readme.html b/examples/broker-features/standard/bridge/readme.html
deleted file mode 100644
index 698c6c2..0000000
--- a/examples/broker-features/standard/bridge/readme.html
+++ /dev/null
@@ -1,74 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Core Bridge 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>Core Bridge 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 a core bridge deployed on one server, which consumes messages from a
-     local queue and forwards them to an address on a second server.</p>
-
-     <p>Core bridges are used to create message flows between any two ActiveMQ Artemis servers which are remotely separated.
-     Core bridges are resilient and will cope with temporary connection failure allowing them to be an ideal
-     choice for forwarding over unreliable connections, e.g. a WAN.</p>
-     <p>They can also be configured with an optional filter expression, and will only forward messages that
-     match that filter.</p>
-     <p>Furthermore they can be configured to use an optional Transformer class. A user-defined Transformer class
-     can be specified which is called at forwarding time. This gives the user the opportunity to transform
-     the message in some ways, e.g. changing its properties or body</p>
-     <p>ActiveMQ Artemis also includes a <b>JMS Bridge</b>. This is similar to a core bridge, but uses the JMS API
-     and can be used to bridge between any two JMS 1.1 compliant messaging systems. The core bridge is limited to bridging
-     between ActiveMQ Artemis instances, but may provide better performance than the JMS bridge. The JMS bridge is covered in
-     a separate example.</p>
-     <p>For more information on bridges, please see the ActiveMQ Artemis user manual.</p>
-
-     <p>In this example we will demonstrate a simple sausage factory for aardvarks.</p>
-     <p>We have a JMS queue on server 0 named <code>sausage-factory</code>, and we have a
-     JMS queue on server 1 named <code>mincing-machine</code></p>
-     <p>We want to forward any messages that are sent to the <code>sausage-factory</code> queue on server 0, to the <code>mincing-machine</code>
-     on server 1.</p>
-     <p>We only want to make aardvark sausages, so we only forward messages where the property "name" is set
-     to "aardvark". It is known that other things, such are Sasquatches are also sent to the <code>sausage-factory</code> and we
-     want to reject those.</p>
-     <p>Moreover it is known that Aardvarks normally wear blue hats, and it's important that we only make sausages using
-     Aardvarks with green hats, so on the way we are going transform the property "hat" from "green" to "blue".</p>
-     <p>Here's a snippet from <code>broker.xml</code> showing the bridge configuration</p>
-     <pre class="prettyprint">
-     <code>
-     &lt;bridge name="my-bridge"&gt;
-          &lt;queue-name&gt;jms.queue.sausage-factory&lt;/queue-name&gt;
-          &lt;forwarding-address&gt;jms.queue.mincing-machine&lt;/forwarding-address&gt;
-          &lt;filter string="name='aardvark'"/&gt;
-          &lt;transformer-class-name&gt;org.apache.activemq.artemis.jms.example.HatColourChangeTransformer&lt;/transformer-class-name&gt;
-          &lt;reconnect-attempts&gt;-1&lt;/reconnect-attempts&gt;
-          &lt;static-connectors>
-             &lt;connector-ref>remote-connector&lt;/connector-ref>
-          &lt;/static-connectors>
-     &lt;/bridge&gt;
-     </code>
-     </pre>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java b/examples/broker-features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java
deleted file mode 100644
index 0fa17c2..0000000
--- a/examples/broker-features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java
+++ /dev/null
@@ -1,175 +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.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.naming.InitialContext;
-import java.util.Hashtable;
-
-/**
- * This example demonstrates a core bridge set-up between two nodes, consuming messages from a queue
- * on one node and forwarding them to an address on the second node.
- */
-public class BridgeExample {
-
-   public static void main(final String[] args) throws Exception {
-      Connection connection0 = null;
-
-      Connection connection1 = null;
-
-      InitialContext ic0 = null;
-
-      InitialContext ic1 = null;
-
-      try {
-         // Step 1 - we create an initial context for looking up JNDI on node 0
-
-         Hashtable<String, Object> properties = new Hashtable<String, Object>();
-         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", "tcp://127.0.0.1:61616");
-         properties.put("queue.queue/sausage-factory", "sausage-factory");
-         ic0 = new InitialContext(properties);
-
-         // Step 2 - we look up the sausage-factory queue from node 0
-
-         Queue sausageFactory = (Queue) ic0.lookup("queue/sausage-factory");
-
-         // Step 3 - we look up a JMS ConnectionFactory object from node 0
-
-         ConnectionFactory cf0 = (ConnectionFactory) ic0.lookup("ConnectionFactory");
-
-         // Step 4 - we create an initial context for looking up JNDI on node 1
-
-         properties = new Hashtable<String, Object>();
-         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", "tcp://127.0.0.1:61617");
-         properties.put("queue.queue/mincing-machine", "mincing-machine");
-         ic1 = new InitialContext(properties);
-
-         // Step 5 - we look up the mincing-machine queue on node 1
-
-         Queue mincingMachine = (Queue) ic1.lookup("queue/mincing-machine");
-
-         // Step 6 - we look up a JMS ConnectionFactory object from node 1
-
-         ConnectionFactory cf1 = (ConnectionFactory) ic1.lookup("ConnectionFactory");
-
-         // Step 7. We create a JMS Connection connection0 which is a connection to server 0
-
-         connection0 = cf0.createConnection();
-
-         // Step 8. We create a JMS Connection connection1 which is a connection to server 1
-         connection1 = cf1.createConnection();
-
-         // Step 9. We create a JMS Session on server 0
-
-         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 10. We create a JMS Session on server 1
-
-         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 10. We start the connection to ensure delivery occurs on them
-
-         connection1.start();
-
-         // Step 11. We create JMS MessageConsumer object
-         MessageConsumer consumer = session1.createConsumer(mincingMachine);
-
-         // Step 12. We create a JMS MessageProducer object on server 0
-         MessageProducer producer = session0.createProducer(sausageFactory);
-
-         // Step 13. We create and send a message representing an aardvark with a green hat to the sausage-factory
-         // on node 0
-         Message message = session0.createMessage();
-
-         message.setStringProperty("name", "aardvark");
-
-         message.setStringProperty("hat", "green");
-
-         producer.send(message);
-
-         System.out.println("Sent " + message.getStringProperty("name") +
-                               " message with " +
-                               message.getStringProperty("hat") +
-                               " hat to sausage-factory on node 0");
-
-         // Step 14 - we successfully receive the aardvark message from the mincing-machine one node 1. The aardvark's
-         // hat is now blue since it has been transformed!
-
-         Message receivedMessage = consumer.receive(5000);
-
-         System.out.println("Received " + receivedMessage.getStringProperty("name") +
-                               " message with " +
-                               receivedMessage.getStringProperty("hat") +
-                               " hat from mincing-machine on node 1");
-
-         // Step 13. We create and send another message, this time representing a sasquatch with a mauve hat to the
-         // sausage-factory on node 0. This won't be bridged to the mincing-machine since we only want aardvarks, not
-         // sasquatches
-
-         message = session0.createMessage();
-
-         message.setStringProperty("name", "sasquatch");
-
-         message.setStringProperty("hat", "mauve");
-
-         producer.send(message);
-
-         System.out.println("Sent " + message.getStringProperty("name") +
-                               " message with " +
-                               message.getStringProperty("hat") +
-                               " hat to sausage-factory on node 0");
-
-         // Step 14. We don't receive the message since it has not been bridged.
-
-         receivedMessage = consumer.receive(1000);
-
-         if (receivedMessage == null) {
-            System.out.println("Didn't receive that message from mincing-machine on node 1");
-         }
-         else {
-            throw new IllegalStateException();
-         }
-      }
-      finally {
-         // Step 15. Be sure to close our resources!
-
-         if (connection0 != null) {
-            connection0.close();
-         }
-
-         if (connection1 != null) {
-            connection1.close();
-         }
-
-         if (ic0 != null) {
-            ic0.close();
-         }
-
-         if (ic1 != null) {
-            ic1.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/HatColourChangeTransformer.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/HatColourChangeTransformer.java b/examples/broker-features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/HatColourChangeTransformer.java
deleted file mode 100644
index ae8cf39..0000000
--- a/examples/broker-features/standard/bridge/src/main/java/org/apache/activemq/artemis/jms/example/HatColourChangeTransformer.java
+++ /dev/null
@@ -1,38 +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 org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.core.server.ServerMessage;
-import org.apache.activemq.artemis.core.server.cluster.Transformer;
-
-public class HatColourChangeTransformer implements Transformer {
-
-   public ServerMessage transform(final ServerMessage message) {
-      SimpleString propName = new SimpleString("hat");
-
-      SimpleString oldProp = message.getSimpleStringProperty(propName);
-
-      // System.out.println("Old hat colour is " + oldProp);
-
-      // Change the colour
-      message.putStringProperty(propName, new SimpleString("blue"));
-
-      return message;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/bridge/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/bridge/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/bridge/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 250a851..0000000
--- a/examples/broker-features/standard/bridge/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?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="sausage-factory"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Connectors -->
-      <connectors>
-         <!-- Connector to the other node -->
-         <connector name="remote-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- We need to create a core queue for the JMS queue explicitly because the bridge will be deployed
-      before the JMS queue is deployed, so the first time, it otherwise won't find the queue -->
-      <queues>
-         <queue name="jms.queue.sausage-factory">
-            <address>jms.queue.sausage-factory</address>
-         </queue>
-      </queues>
-
-      <!-- We set-up a bridge that forwards from a queue on this node to an address on another node.
-      We specify a filter with the bridge, and a transformer too. The filter and transformer are optional -->
-      <bridges>
-         <bridge name="my-bridge">
-            <queue-name>jms.queue.sausage-factory</queue-name>
-            <forwarding-address>jms.queue.mincing-machine</forwarding-address>
-            <filter string="name='aardvark'"/>
-            <transformer-class-name>org.apache.activemq.artemis.jms.example.HatColourChangeTransformer</transformer-class-name>
-            <reconnect-attempts>-1</reconnect-attempts>
-            <static-connectors>
-               <connector-ref>remote-connector</connector-ref>
-            </static-connectors>
-         </bridge>
-      </bridges>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.#">
-            <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-settings>
-   </core>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/bridge/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/bridge/src/main/resources/activemq/server1/broker.xml b/examples/broker-features/standard/bridge/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 516f179..0000000
--- a/examples/broker-features/standard/bridge/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?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="mincing-machine"/>
-   </jms>
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server1/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server1/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.#">
-            <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-settings>
-   </core>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/browser/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/browser/pom.xml b/examples/broker-features/standard/browser/pom.xml
deleted file mode 100644
index 7ab1299..0000000
--- a/examples/broker-features/standard/browser/pom.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?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>browser</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Browser 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>
-                  <phase>verify</phase>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                  </configuration>
-                  <goals>
-                     <goal>create</goal>
-                  </goals>
-               </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.QueueBrowserExample</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>browser</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/browser/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/browser/readme.html b/examples/broker-features/standard/browser/readme.html
deleted file mode 100644
index 9f9e01a..0000000
--- a/examples/broker-features/standard/browser/readme.html
+++ /dev/null
@@ -1,40 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS QueueBrowser 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 QueueBrowser Example</h1>
-     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
-
-     <p>This example shows you how to use a JMS <a href="http://java.sun.com/javaee/5/docs/api/javax/jms/QueueBrowser.html">QueueBrowser</a> with ActiveMQ Artemis.<br />
-     Queues are a standard part of JMS, please consult the JMS 1.1 specification for full details.<br />
-     A QueueBrowser is used to look at messages on the queue without removing them.
-     It can scan the entire content of a queue or only messages matching a message selector.</p>
-     <p>
-         The example will send 2 messages on a queue, use a QueueBrowser to browse
-         the queue (looking at the message without removing them) and finally consume the 2 messages
-     </p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java b/examples/broker-features/standard/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java
deleted file mode 100644
index 1c9db3b..0000000
--- a/examples/broker-features/standard/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java
+++ /dev/null
@@ -1,103 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-import java.util.Enumeration;
-
-/**
- * A simple example which shows how to use a QueueBrowser to look at messages of a queue without removing them from the queue
- */
-public class QueueBrowserExample {
-
-   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
-         //          you could alternatively instantiate the connection directly
-         //          ConnectionFactory cf = new ActiveMQConnectionFactory(); // this would accept the broker URI as well
-         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 2 Text Messages
-         TextMessage message_1 = session.createTextMessage("this is the 1st message");
-         TextMessage message_2 = session.createTextMessage("this is the 2nd message");
-
-         // Step 8. Send the Message
-         producer.send(message_1);
-         producer.send(message_2);
-
-         // Step 9. Create the JMS QueueBrowser
-         QueueBrowser browser = session.createBrowser(queue);
-
-         // Step 10. Browse the messages on the queue
-         // Browsing a queue does not remove the messages from the queue
-         Enumeration messageEnum = browser.getEnumeration();
-         while (messageEnum.hasMoreElements()) {
-            TextMessage message = (TextMessage) messageEnum.nextElement();
-            System.out.println("Browsing: " + message.getText());
-         }
-
-         // Step 11. Close the browser
-         browser.close();
-
-         // Step 12. Create a JMS Message Consumer
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-
-         // Step 13. Start the Connection
-         connection.start();
-
-         // Step 14. Receive the 2 messages
-         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-         System.out.println("Received message: " + messageReceived.getText());
-         messageReceived = (TextMessage) messageConsumer.receive(5000);
-         System.out.println("Received message: " + messageReceived.getText());
-      }
-      finally {
-         // Step 15. 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/6b17d966/examples/broker-features/standard/browser/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/browser/src/main/resources/jndi.properties b/examples/broker-features/standard/browser/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/broker-features/standard/browser/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-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/6b17d966/examples/broker-features/standard/client-kickoff/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/client-kickoff/pom.xml b/examples/broker-features/standard/client-kickoff/pom.xml
deleted file mode 100644
index 6ffb19a..0000000
--- a/examples/broker-features/standard/client-kickoff/pom.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?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>client-kickoff</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Kick Off 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>
-                     <!-- options used for JMX on the example -->
-                     <javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
-                     </javaOptions>
-                  </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.ClientKickoffExample</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>client-kickoff</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/client-kickoff/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/client-kickoff/readme.html b/examples/broker-features/standard/client-kickoff/readme.html
deleted file mode 100644
index 8400e6a..0000000
--- a/examples/broker-features/standard/client-kickoff/readme.html
+++ /dev/null
@@ -1,54 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Client Kickoff 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>Client Kickoff 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 how to kick off a client connected to ActiveMQ
-         using <a href="http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/">JMX</a></p>
-
-     <p>The example will connect to ActiveMQ Artemis. Using JMX, we will list the remote addresses connected to the
-         server and close the corresponding connections. The client will be kicked off from ActiveMQ Artemis receiving
-         an exception that its JMS connection was interrupted.</p>
-
-     <h2>Example configuration</h2>
-
-     <p>ActiveMQ Artemis exposes its managed resources by default on the platform MBeanServer.</p>
-     <p>To access this MBeanServer remotely, the Java Virtual machine must be started with system properties:
-         <pre class="prettyprint">
-             <code>-Dcom.sun.management.jmxremote
-             -Dcom.sun.management.jmxremote.port=3000
-             -Dcom.sun.management.jmxremote.ssl=false
-             -Dcom.sun.management.jmxremote.authenticate=false</code>
-        </pre>
-        <p>These properties are explained in the Java 5 <a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#remote">Management guide</a>
-            (please note that for this example, we will disable user authentication for simplicity).</p>
-        <p>With these properties, ActiveMQ Artemis server will be manageable remotely using standard JMX URL on port <code>3000</code>.</p>
-     </p>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java b/examples/broker-features/standard/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java
deleted file mode 100644
index 14e9f37..0000000
--- a/examples/broker-features/standard/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java
+++ /dev/null
@@ -1,106 +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.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.management.MBeanServerConnection;
-import javax.management.MBeanServerInvocationHandler;
-import javax.management.ObjectName;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-import javax.naming.InitialContext;
-import java.util.HashMap;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
-import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
-
-/**
- * An example that shows how to kick off a client connected to ActiveMQ Artemis by using JMX.
- */
-public class ClientKickoffExample {
-
-   private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3000/jmxrmi";
-
-   public static void main(final String[] args) throws Exception {
-      QueueConnection 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 Connection Factory
-         QueueConnectionFactory cf = (QueueConnectionFactory) initialContext.lookup("ConnectionFactory");
-
-         // Step 3.Create a JMS Connection
-         connection = cf.createQueueConnection();
-
-         // Step 4. Set an exception listener on the connection to be notified after a problem occurred
-         final AtomicReference<JMSException> exception = new AtomicReference<JMSException>();
-         connection.setExceptionListener(new ExceptionListener() {
-            @Override
-            public void onException(final JMSException e) {
-               exception.set(e);
-            }
-         });
-
-         // Step 5. We start the connection
-         connection.start();
-
-         // Step 6. Create an ActiveMQServerControlMBean proxy to manage the server
-         ObjectName on = ObjectNameBuilder.DEFAULT.getActiveMQServerObjectName();
-         JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, String>());
-         MBeanServerConnection mbsc = connector.getMBeanServerConnection();
-         ActiveMQServerControl serverControl = MBeanServerInvocationHandler.newProxyInstance(mbsc, on, ActiveMQServerControl.class, false);
-
-         // Step 7. List the remote address connected to the server
-         System.out.println("List of remote addresses connected to the server:");
-         System.out.println("----------------------------------");
-         String[] remoteAddresses = serverControl.listRemoteAddresses();
-         for (String remoteAddress : remoteAddresses) {
-            System.out.println(remoteAddress);
-         }
-         System.out.println("----------------------------------");
-
-         // Step 8. Close the connections for the 1st remote address and kickoff the client
-         serverControl.closeConnectionsForAddress(remoteAddresses[0]);
-
-         // Sleep a little bit so that the stack trace from the server won't be
-         // mingled with the JMSException received on the ExceptionListener
-         Thread.sleep(1000);
-
-         // Step 9. Display the exception received by the connection's ExceptionListener
-         System.err.println("\nException received from the server:");
-         System.err.println("----------------------------------");
-         exception.get().printStackTrace();
-         System.err.println("----------------------------------");
-      }
-      finally {
-         // Step 10. Be sure to close the resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/client-kickoff/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/client-kickoff/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/client-kickoff/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 3b5a465..0000000
--- a/examples/broker-features/standard/client-kickoff/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?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">
-
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
-
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
-
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
-
-      <!-- true to expose ActiveMQ Artemis resources through JMX -->
-      <jmx-management-enabled>true</jmx-management-enabled>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty">tcp://localhost:61616</acceptor>
-      </acceptors>
-   </core>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/client-kickoff/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/client-kickoff/src/main/resources/jndi.properties b/examples/broker-features/standard/client-kickoff/src/main/resources/jndi.properties
deleted file mode 100644
index 5cbe72c..0000000
--- a/examples/broker-features/standard/client-kickoff/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,19 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/consumer-rate-limit/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/consumer-rate-limit/pom.xml b/examples/broker-features/standard/consumer-rate-limit/pom.xml
deleted file mode 100644
index c1db582..0000000
--- a/examples/broker-features/standard/consumer-rate-limit/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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>consumer-rate-limit</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Consumer Rate Limit 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>
-                     <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.ConsumerRateLimitExample</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>consumer-rate-limit</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/consumer-rate-limit/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/consumer-rate-limit/readme.html b/examples/broker-features/standard/consumer-rate-limit/readme.html
deleted file mode 100644
index 415de00..0000000
--- a/examples/broker-features/standard/consumer-rate-limit/readme.html
+++ /dev/null
@@ -1,47 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis JMS Message Consumer Rate Limiting</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 Message Consumer Rate Limiting</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>With ActiveMQ Artemis you can specify a maximum consume rate at which a JMS MessageConsumer will consume messages.
-     This can be specified when creating or configuring the connection factory. See <code>jndi.properties</code>.</p>
-     <p>If this value is specified then ActiveMQ Artemis will ensure that messages are never consumed at a rate higher than
-     the specified rate. This is a form of consumer <i>throttling</i>.</p>
-     <h2>Example step-by-step</h2>
-     <p>In this example we specify a <code>consumer-max-rate</code> of <code>10</code> messages per second in the <code>jndi.properties</code>
-     file when configuring the connection factory:</p>
-     <pre class="prettyprint">
-     <code>
-connectionFactory.ConnectionFactory=tcp://localhost:61616?consumerMaxRate=10
-     </code>
-     </pre>
-     <p>We then simply consume as many messages as we can in 10 seconds and note how many messages are actually consumed.</p>
-     <p>We note that the number of messages consumed per second never exceeds the specified value of <code>10</code> messages per second.</p>
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/consumer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ConsumerRateLimitExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/consumer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ConsumerRateLimitExample.java b/examples/broker-features/standard/consumer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ConsumerRateLimitExample.java
deleted file mode 100644
index fb98c76..0000000
--- a/examples/broker-features/standard/consumer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ConsumerRateLimitExample.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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-/**
- * This example demonstrates how a message consumer can be limited to consumer messages at a maximum rate
- * specified in messages per sec.
- */
-public class ConsumerRateLimitExample {
-
-   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 JMS Message Consumer
-
-         MessageConsumer consumer = session.createConsumer(queue);
-
-         // Step 8. Start the connection
-
-         connection.start();
-
-         // Step 9. Send a bunch of messages
-
-         final int numMessages = 150;
-
-         for (int i = 0; i < numMessages; i++) {
-            TextMessage message = session.createTextMessage("This is text message: " + i);
-
-            producer.send(message);
-         }
-
-         System.out.println("Sent messages");
-
-         System.out.println("Will now try and consume as many as we can in 10 seconds ...");
-
-         // Step 10. Consume as many messages as we can in 10 seconds
-
-         final long duration = 10000;
-
-         int i = 0;
-
-         long start = System.currentTimeMillis();
-
-         while (System.currentTimeMillis() - start <= duration) {
-            TextMessage message = (TextMessage) consumer.receive(2000);
-
-            if (message == null) {
-               throw new RuntimeException("Message was null");
-            }
-
-            i++;
-         }
-
-         long end = System.currentTimeMillis();
-
-         double rate = 1000 * (double) i / (end - start);
-
-         System.out.println("We consumed " + i + " messages in " + (end - start) + " milliseconds");
-
-         System.out.println("Actual consume rate was " + rate + " messages per second");
-      }
-      finally {
-         // Step 9. Be sure to close our resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/consumer-rate-limit/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/consumer-rate-limit/src/main/resources/jndi.properties b/examples/broker-features/standard/consumer-rate-limit/src/main/resources/jndi.properties
deleted file mode 100644
index 74729fe..0000000
--- a/examples/broker-features/standard/consumer-rate-limit/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616?consumerMaxRate=10
-queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/dead-letter/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/dead-letter/pom.xml b/examples/broker-features/standard/dead-letter/pom.xml
deleted file mode 100644
index 9c5c5a0..0000000
--- a/examples/broker-features/standard/dead-letter/pom.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?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>dead-letter</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Dead Letter 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>
-                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                     <ignore>${noServer}</ignore>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>start</id>
-                  <goals>
-                     <goal>cli</goal>
-                  </goals>
-                  <configuration>
-                     <ignore>${noServer}</ignore>
-                     <spawn>true</spawn>
-                     <testURI>tcp://localhost:61616</testURI>
-                     <args>
-                        <param>run</param>
-                     </args>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.jms.example.DeadLetterExample</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>dead-letter</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-            </dependencies>
-         </plugin>
-      </plugins>
-   </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/dead-letter/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/dead-letter/readme.html b/examples/broker-features/standard/dead-letter/readme.html
deleted file mode 100644
index e293936..0000000
--- a/examples/broker-features/standard/dead-letter/readme.html
+++ /dev/null
@@ -1,66 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Dead Letter 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>Dead Letter 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 define and deal with dead letter messages.</p>
-     <p>Messages can be delivered unsuccessfully (e.g. if the transacted session used to consume them is rolled back).
-         Such a message goes back to the JMS destination ready to be redelivered.
-         However, this means it is possible for a message to be delivered again and again without any success and remain in the destination, clogging the system.</p>
-     <p>To prevent this, messaging systems define dead letter messages: after a specified unsuccessful delivery attempts, the message is removed from the destination
-         and instead routed to a <em>dead letter address</em> where they can be consumed for further investigation.
-     <p>
-         The example will show how to configure ActiveMQ Artemis to route a message to a dead letter address after 3 unsuccessful delivery attempts.<br />
-         The example will send 1 message to a queue. We will deliver the message 3 times and rollback the session every time.<br />
-         On the 4th attempt, there won't be any message to consume: it will have been moved to a <em>dead letter address</em>.<br />
-         We will then consume this dead letter message.
-     </p>
-     <h2>Example setup</h2>
-     <p><em>Dead letter addresses</em> and <em>maximum delivery attempts</em> are defined in the configuration file <a href="src/main/resources/activemq/server0/broker.xml">broker.xml</a>:</p>
-     <pre class="prettyprint">
-         <code>&lt;address-setting match="jms.queue.exampleQueue"&gt;
-            &lt;dead-letter-address&gt;jms.queue.deadLetterQueue&lt;/dead-letter-address&gt;
-            &lt;max-delivery-attempts&gt;3&lt;/max-delivery-attempts&gt;
-         &lt;/address-setting&gt;
-         </code>
-     </pre>
-     <p>This configuration will moved dead letter messages from <code>exampleQueue</code> to the <code>deadLetterQueue</code>.</p>
-     <p>ActiveMQ Artemis allows to specify either a <code>Queue</code> by prefixing the <code>dead-letter-address</code> with <code>jms.queue.</code>
-         or a <code>Topic</code> by prefixing with <code>jms.topic.</code>.<br />
-         In this example, we will use a <code>Queue</code> to hold the dead letter messages.</p>
-     <p>The maximum attempts of delivery is <code>3</code>. Once this figure is reached, a message is considered a dead letter message and is moved to
-         the <code>deadLetterQueue</code>.
-     <p>Since we want to consume messages from this deadLetterQueue, we also need to add a JNDI binding to perform a lookup.
-         This is configured in <a href="src/main/resources/activemq/server0/activemq-jms.xml">activemq-jms.xml</a></p>
-     <pre class="prettyprint">
-         <code>&lt;queue name="deadLetterQueue"&gt;
-            &lt;entry name="/queue/deadLetterQueue"/&gt;
-         &lt;/queue&gt;</code>
-     </pre>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/dead-letter/src/main/java/org/apache/activemq/artemis/jms/example/DeadLetterExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/dead-letter/src/main/java/org/apache/activemq/artemis/jms/example/DeadLetterExample.java b/examples/broker-features/standard/dead-letter/src/main/java/org/apache/activemq/artemis/jms/example/DeadLetterExample.java
deleted file mode 100644
index db28568..0000000
--- a/examples/broker-features/standard/dead-letter/src/main/java/org/apache/activemq/artemis/jms/example/DeadLetterExample.java
+++ /dev/null
@@ -1,136 +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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-/**
- * An example showing how messages are moved to dead letter destination when they are unsuccessfully delivered multiple times
- */
-public class DeadLetterExample {
-
-   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 * transacted* JMS Session
-         Session session = connection.createSession(true, 0);
-
-         // 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");
-
-         // Step 8. Send the Message
-         producer.send(message);
-         System.out.println("Sent message to " + queue.getQueueName() + ": " + message.getText());
-
-         // Step 9. Commit the session to effectively send the message
-         session.commit();
-
-         // Step 10. Create a JMS Message Consumer for the queue
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-
-         // Step 11. Start the Connection
-         connection.start();
-
-         // Step 12. We receive a message...
-         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-         System.out.println("1st delivery from " + queue.getQueueName() + ": " + messageReceived.getText());
-
-         // Step 13. ... but we roll back the session. the message returns to the queue ready to be redelivered
-         session.rollback();
-
-         // Step 14. We receive a message and roll back the session a second time
-         messageReceived = (TextMessage) messageConsumer.receive(5000);
-         System.out.println("2nd delivery from " + queue.getQueueName() + ": " + messageReceived.getText());
-         session.rollback();
-
-         // Step 15. We receive a message and roll back the session a third time
-         messageReceived = (TextMessage) messageConsumer.receive(5000);
-         System.out.println("3rd delivery from " + queue.getQueueName() + ": " + messageReceived.getText());
-         session.rollback();
-
-         // The message has been delivered unsuccessfully 3 times -> it is moved to the dead letter queue.
-
-         // Step 16. The 4th time, call will timeout after 5000ms and messageReceived will be null
-         messageReceived = (TextMessage) messageConsumer.receive(5000);
-         System.out.println("4th delivery from " + queue.getQueueName() + ": " + messageReceived);
-
-         // We will now consume the message from the dead letter queue
-
-         // Step 17. Perform a lookup on the dead letter queue
-         Queue deadLetterQueue = (Queue) initialContext.lookup("queue/deadLetterQueue");
-
-         // Step 18. Create a JMS Message Consumer for the dead letter queue
-         MessageConsumer deadLetterConsumer = session.createConsumer(deadLetterQueue);
-
-         // Step 19. Receive the message from the dead letter queue
-         messageReceived = (TextMessage) deadLetterConsumer.receive(5000);
-
-         // Step 20. The message sent to the queue was moved to the dead letter queue after 3 unsuccessful deliveries
-         System.out.println("Received message from " + deadLetterQueue.getQueueName() +
-                               ": " +
-                               messageReceived.getText());
-
-         // The message received from the dead letter queue has the same content than the undelivered message but its
-         // JMS headers
-         // differ (from JMS point of view, it's not the same message).
-         // ActiveMQ Artemis defines additional properties for messages received from the dead letter queue
-
-         System.out.println();
-         // Step 21. the messageReceived's destination is now the dead letter queue.
-         System.out.println("Destination of the message: " + ((Queue) messageReceived.getJMSDestination()).getQueueName());
-
-         // Step 22. the *origin* destination is stored in the _AMQ_ORIG_ADDRESS property
-         System.out.println("*Origin destination* of the message: " + messageReceived.getStringProperty("_AMQ_ORIG_ADDRESS"));
-
-         // Step 23. This time, we commit the session, the delivery from the dead letter queue is successful!
-         session.commit();
-      }
-      finally {
-         // Step 24. Be sure to close our JMS resources!
-         if (initialContext != null) {
-            initialContext.close();
-         }
-         if (connection != null) {
-            connection.close();
-         }
-      }
-   }
-}


[11/48] activemq-artemis git commit: renaming broker-features -> features on examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jmx/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/jmx/readme.html b/examples/features/standard/jmx/readme.html
new file mode 100644
index 0000000..8dd4fe9
--- /dev/null
+++ b/examples/features/standard/jmx/readme.html
@@ -0,0 +1,181 @@
+<!--
+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 JMX Management 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>JMX Management 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 how to manage ActiveMQ Artemis using <a href="http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/">JMX</a></p>
+
+     <h2>Example configuration</h2>
+
+     <p>ActiveMQ Artemis exposes its managed resources by default on the platform MBeanServer.</p>
+     <p>To access this MBeanServer remotely, the Java Virtual machine must be started with system properties:
+         <pre class="prettyprint">
+             <code>-Dcom.sun.management.jmxremote
+             -Dcom.sun.management.jmxremote.port=3000
+             -Dcom.sun.management.jmxremote.ssl=false
+             -Dcom.sun.management.jmxremote.authenticate=false</code>
+        </pre>
+        <p>These properties are explained in the Java 5 <a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#remote">Management guide</a>
+            (please note that for this example, we will disable user authentication for simplicity sake).</p>
+        <p>With these properties, ActiveMQ Artemis server will be manageable remotely using standard JMX URL on port <code>3000</code>.</p>
+     </p>
+
+     <h2>Example step-by-step</h2>
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get its properties from <a href="server0/client-jndi.properties">client-jndi.properties</a></li>
+        <pre class="prettyprint">
+            <code>InitialContext initialContext = getContext(0);</code>
+        </pre>
+
+        <li>We look up the JMS queue object from JNDI</li>
+        <pre class="prettyprint">
+            <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>We look up the JMS connection factory object from JNDI</li>
+        <pre class="prettyprint">
+            <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>We create a JMS connection</li>
+        <pre class="prettyprint">
+            <code>connection = cf.createConnection();</code>
+        </pre>
+
+        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
+        <pre class="prettyprint">
+            <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
+        </pre>
+
+        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
+        <pre class="prettyprint">
+            <code>MessageProducer messageProducer = session.createProducer(topic);</code>
+       </pre>
+
+        <li>We create a JMS text message that we are going to send.</li>
+        <pre class="prettyprint">
+            <code>TextMessage message = session.createTextMessage("This is a text message");</code>
+        </pre>
+
+        <li>We send message to the queue</li>
+        <pre class="prettyprint">
+            <code>messageProducer.send(message);</code>
+        </pre>
+
+        <p><em>Now that we have a message in the queue, we will manage the queue by retrieving the number of messages in the queue
+            (i.e. 1) and by removing the message which has been sent in step 8.</em></p>
+
+        <li>We retrieve the <code>ObjectName</code> corresponding to the queue using a helper class <code>ObjectNameBuilder</code></li>
+        <pre class="prettyprint">
+              <code>ObjectName on = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queue.getQueueName());</code>
+        </pre>
+
+        <li>We create a JMX Connector to connect to the server's MBeanServer using the <a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#connecting">standard JMX service URL</a></li>
+        <pre class="prettyprint">
+            <code>JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap());</code>
+        </pre>
+
+        <li>We retrieve a <code>MBeanServerConnection</code> from the JMX connector</li>
+        <pre class="prettyprint">
+           <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);</code>
+        </pre>
+
+        <li>We create a <code>JMSQueueControl</code> proxy to manage the queue on the server</li>
+        <pre class="prettyprint">
+            <code>JMSQueueControl queueControl = (JMSQueueControl)MBeanServerInvocationHandler.newProxyInstance(mbsc,
+                                                                                              on,
+                                                                                              JMSQueueControl.class,
+                                                                                              false);
+             </code>
+        </pre>
+
+        <li>We use this mbean proxy to retrieve the number of messages in the queue using the <code>getMessageCount</code> method</li>
+        <pre class="prettyprint">
+            <code>System.out.println(queueControl.getName() + " contains " + queueControl.getMessageCount() + " messages");</code>
+        </pre>
+
+        <li>We will now remove the message sent at step 8 using the <code>removeMessage</code> method with the JMS Message ID of the message</li>
+        <pre class="prettyprint">
+            <code>System.out.println("message has been removed: " + queueControl.removeMessage(message.getJMSMessageID()));</code>
+        </pre>
+
+        <li>We use again the mbean proxy to retrieve the number of messages. This time, it will display <code>0</code> messages</li>
+        <pre class="prettyprint">
+            <code>System.out.println(queueControl.getName() + " contains " + queueControl.getMessageCount() + " messages");</code>
+        </pre>
+
+        <li>Now we have finish the management operations, we close the JMX connector</li>
+        <pre class="prettyprint">
+            <code>connector.close()</code>
+        </pre>
+
+        <p><em>We will now try to consume the message sent to the queue but it won't be there: it has been removed by the management operation</em></p>
+
+        <li>We create a JMS message consumer on the queue</li>
+        <pre class="prettyprint">
+            <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
+        </pre>
+
+        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
+        <pre class="prettyprint">
+            <code>connection.start();</code>
+        </pre>
+
+        <li>We try to receive a message from the queue. Since there is none, the call will timeout after 5000ms and messageReceived will be null
+        </li>
+        <pre class="prettyprint">
+            <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
+            System.out.println("Received message: " + messageReceived);</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>
+
+     <h2>More information</h2>
+
+     <ul>
+        <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.jmx">Using Management Via JMX chapter</a></li>
+        <li><a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html">Java 5 Management guide</a></li>
+     </ul>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java b/examples/features/standard/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java
new file mode 100644
index 0000000..108897f
--- /dev/null
+++ b/examples/features/standard/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java
@@ -0,0 +1,121 @@
+/*
+ * 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 javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.management.MBeanServerConnection;
+import javax.management.MBeanServerInvocationHandler;
+import javax.management.ObjectName;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+import javax.naming.InitialContext;
+
+import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
+import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
+
+/**
+ * An example that shows how to manage ActiveMQ Artemis using JMX.
+ */
+public class JMXExample {
+
+   private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3000/jmxrmi";
+
+   public static void main(final String[] args) throws Exception {
+      QueueConnection 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
+         QueueConnectionFactory cf = (QueueConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 4.Create a JMS Connection
+         connection = cf.createQueueConnection();
+
+         // Step 5. Create a JMS Session
+         QueueSession session = connection.createQueueSession(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. Retrieve the ObjectName of the queue. This is used to identify the server resources to manage
+         ObjectName on = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queue.getQueueName());
+
+         // Step 10. Create JMX Connector to connect to the server's MBeanServer
+         JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMXExample.JMX_URL), new HashMap());
+
+         // Step 11. Retrieve the MBeanServerConnection
+         MBeanServerConnection mbsc = connector.getMBeanServerConnection();
+
+         // Step 12. Create a JMSQueueControl proxy to manage the queue on the server
+         JMSQueueControl queueControl = MBeanServerInvocationHandler.newProxyInstance(mbsc, on, JMSQueueControl.class, false);
+         // Step 13. Display the number of messages in the queue
+         System.out.println(queueControl.getName() + " contains " + queueControl.getMessageCount() + " messages");
+
+         // Step 14. Remove the message sent at step #8
+         System.out.println("message has been removed: " + queueControl.removeMessage(message.getJMSMessageID()));
+
+         // Step 15. Display the number of messages in the queue
+         System.out.println(queueControl.getName() + " contains " + queueControl.getMessageCount() + " messages");
+
+         // Step 16. We close the JMX connector
+         connector.close();
+
+         // Step 17. Create a JMS Message Consumer on the queue
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         // Step 18. Start the Connection
+         connection.start();
+
+         // Step 19. Trying to receive a message. Since the only message in the queue was removed by a management
+         // operation, there is none to consume.
+         // The call will timeout after 5000ms and messageReceived will be null
+         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
+         System.out.println("Received message: " + messageReceived);
+      }
+      finally {
+         // Step 20. Be sure to close the resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jmx/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/jmx/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/jmx/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/jmx/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jmx/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/jmx/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/jmx/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/jmx/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/6b17d966/examples/features/standard/jmx/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/jmx/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/jmx/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..7a30153
--- /dev/null
+++ b/examples/features/standard/jmx/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,64 @@
+<?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.dir}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+
+
+      <!-- true to expose ActiveMQ Artemis resources through JMX -->
+      <jmx-management-enabled>true</jmx-management-enabled>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty">tcp://localhost:61616</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-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/jmx/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/jmx/src/main/resources/jndi.properties b/examples/features/standard/jmx/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/jmx/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/6b17d966/examples/features/standard/large-message/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/large-message/pom.xml b/examples/features/standard/large-message/pom.xml
new file mode 100644
index 0000000..007ccd7
--- /dev/null
+++ b/examples/features/standard/large-message/pom.xml
@@ -0,0 +1,88 @@
+<?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>large-message</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Large Message Example</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <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>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.LargeMessageExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.broker</groupId>
+                  <artifactId>large-message</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/large-message/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/large-message/readme.html b/examples/features/standard/large-message/readme.html
new file mode 100644
index 0000000..0dc42cb
--- /dev/null
+++ b/examples/features/standard/large-message/readme.html
@@ -0,0 +1,200 @@
+<!--
+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 Large Message 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>Large Message Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, This example will start and stop the server since it will look for a failure.</pre>
+
+
+     <p>This example shows you how to send and receive very large messages with ActiveMQ Artemis.</p>
+     <p>ActiveMQ Artemis supports the sending and receiving of huge messages, much larger than can fit in available RAM
+     on the client or server. Effectively the only limit to message size is the amount of disk space you have on the server.</p>
+     <p>Large messages are persisted on the server so they can survive a server restart. In other words ActiveMQ Artemis doesn't just
+     do a simple socket stream from the sender to the consumer.</p>
+     <p>In order to do this ActiveMQ Artemis provides an extension to JMS where you can use an InputStream or OutputStream as the source and destination for your messages. You can send messages as large as it would fit in your disk.</p>
+     <p>You may also choose to read LargeMessages using the regular ByteStream or ByteMessage methods, but using the InputStream and OutputStream will provide you a much better performance</p>
+
+     <h2>Example step-by-step</h2>
+     <p>In this example we limit both the server and the client to be running in a maximum of 50MB of RAM,
+     and we send a message with a body of size 256MB.</p>
+     <p>ActiveMQ Artemis can support much large message sizes but we
+     choose these sizes and limit RAM so the example runs more quickly.</p>
+     <p>We create a file on disk representing the message body, create
+     a FileInputStream on that file and set that InputStream as the body of the message before sending.</p>
+     <p>The message is sent, then we stop the server, and restart it. This demonstrates the large message will survive a restart of the server.</p>
+     <p>Once the server is restarted we receive the message and stream it's body to another file on disk.</p>
+
+     <ol>
+        <li>Create an initial context to perform the JNDI lookup.</li>
+        <pre class="prettyprint">
+           <code>initialContext = getContext(0);</code>
+        </pre>
+
+        <li>Perfom a lookup on the queue.</li>
+        <pre class="prettyprint">
+           <code>Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>Perform a lookup on the Connection Factory. This ConnectionFactory has a special attribute set on it. activemq-jms.xml)
+            Messages with more than 10K are considered large.</li>
+        <pre class="prettyprint">
+           <code>ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>Create the JMS objects for sending the message.</li>
+        <pre class="prettyprint">
+           <code>
+        connection = cf.createConnection();
+
+        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+        MessageProducer producer = session.createProducer(queue);
+           </code>
+        </pre>
+
+        <li>Create a huge file - this will form the body of the message we will send.</li>
+        <pre class="prettyprint">
+           <code>
+        File fileInput = new File("huge_message_to_send.dat");
+
+        fileInput.createNewFile();
+
+        createFile(fileInput, FILE_SIZE);
+           </code>
+        </pre>
+
+        <li>Create a BytesMessage</li>
+        <pre class="prettyprint">
+          <code>BytesMessage message = session.createBytesMessage();</code>
+       </pre>
+
+        <li>We set the InputStream on the message. When sending the message will read the InputStream
+        until it gets EOF. In this case we point the InputStream at a file on disk, and it will suck up the entire
+        file, however we could use any InputStream not just a FileInputStream.</li>
+        <pre class="prettyprint"><code>
+         FileInputStream fileInputStream = new FileInputStream(fileInput);
+
+         BufferedInputStream bufferedInput = new BufferedInputStream(fileInputStream);
+
+         message.setObjectProperty("JMS_AMQ_InputStream", bufferedInput);
+        </code></pre>
+
+        <li>Send the Message.</li>
+        <pre class="prettyprint"><code>
+         producer.send(message);
+         </code></pre>
+
+
+        <li>We send message to the queue. After the send completion the message file will be located at ./build/data/largeMessages</li>
+        <pre class="prettyprint">
+           <code>messageProducer.send(message);</code>
+        </pre>
+
+        <li>
+        To demonstrate that that we're not simply streaming the message from sending to consumer, we stop
+        the server and restart it before consuming the message. This demonstrates that the large message gets persisted, like a
+        normal persistent message, on the server. If you look at ./build/data/largeMessages you will see the largeMessage
+        stored on disk the server.
+        </li>
+          <pre class="prettyprint">
+           <code>
+        connection.close();
+
+        initialContext.close();
+
+        stopServer(0);
+
+        // Give the server a little time to shutdown properly
+        Thread.sleep(5000);
+
+        startServer(0);
+           </code>
+        </pre>
+
+        <li>Now the server is restarted we can recreate the JMS Objects, and start the new connection.</li>
+        <pre class="prettyprint">
+           <code>
+        initialContext = getContext(0);
+
+        queue = (Queue)initialContext.lookup("/queue/exampleQueue");
+
+        cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
+
+        connection = cf.createConnection();
+
+        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+        MessageConsumer messageConsumer = session.createConsumer(queue);
+
+        connection.start();
+
+           </code>
+        </pre>
+
+        <li>Receive the message. When we receive the large message we initially just receive the message with
+        an empty body.</li>
+        <pre class="prettyprint"><code>BytesMessage messageReceived = (BytesMessage)messageConsumer.receive(120000);
+        </code></pre>
+
+        <li>We set an OutputStream on the message. This causes the message body to be written to the
+         OutputStream until there are no more bytes to be written.
+         You don't have to use a FileOutputStream, you can use any OutputStream.
+         You may choose to use the regular BytesMessage or
+         StreamMessage interface but this method is much faster for large messages.</li>
+        <pre class="prettyprint"><code>
+         File outputFile = new File("huge_message_received.dat");
+
+         FileOutputStream fileOutputStream = new FileOutputStream(outputFile);
+
+         BufferedOutputStream bufferedOutput = new BufferedOutputStream(fileOutputStream);
+
+        </code></pre>
+
+         <li>This will save the stream and wait until the entire message is written before continuing.</li>
+        <pre class="prettyprint"><code>
+         messageReceived.setObjectProperty("JMS_AMQ_SaveStream", bufferedOutput);
+        </code></pre>
+
+        <li>Be sure to close our resources!</li>
+
+        <pre class="prettyprint">
+           <code>
+           finally
+           {
+              if (initialContext != null)
+              {
+                initialContext.close();
+              }
+              if (connection != null)
+              {
+                 connection.close();
+              }
+           }</code>
+        </pre>
+     </ol>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java b/examples/features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
new file mode 100644
index 0000000..88ad6cc
--- /dev/null
+++ b/examples/features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
@@ -0,0 +1,193 @@
+/*
+ * 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 org.apache.activemq.artemis.util.ServerUtil;
+
+import javax.jms.BytesMessage;
+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.naming.InitialContext;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+/**
+ * This example demonstrates the ability of ActiveMQ Artemis to send and consume a very large message, much
+ * bigger than can fit in RAM.
+ */
+public class LargeMessageExample {
+
+   /**
+    * The message we will send is size 2GiB, even though we are only running in 50MB of RAM on both
+    * client and server.
+    * <p>
+    * This may take some considerable time to create, send and consume - if it takes too long or you
+    * don't have enough disk space just reduce the file size here
+    */
+   private static final long FILE_SIZE = 2L * 1024 * 1024 * 1024; // 2 GiB message
+
+   public static void main(final String[] args) throws Exception {
+      Process server = null;
+      Connection connection = null;
+      InitialContext initialContext = null;
+
+      try {
+         server = ServerUtil.startServer(args[0], LargeMessageExample.class.getSimpleName(), 0, 5000);
+
+         // 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. This ConnectionFactory has a special attribute set on
+         // it.
+         // Messages with more than 10K are considered large
+         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         // Step 4. Create the JMS objects
+         connection = cf.createConnection();
+
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         MessageProducer producer = session.createProducer(queue);
+
+         // Step 5. Create a huge file - this will form the body of the message we will send.
+
+         System.out.println("Creating a file to send of size " + FILE_SIZE +
+                               " bytes. This may take a little while... " +
+                               "If this is too big for your disk you can easily change the FILE_SIZE in the example.");
+
+         File fileInput = new File("huge_message_to_send.dat");
+
+         createFile(fileInput, FILE_SIZE);
+
+         System.out.println("File created.");
+
+         // Step 6. Create a BytesMessage
+         BytesMessage message = session.createBytesMessage();
+
+         // Step 7. We set the InputStream on the message. When sending the message will read the InputStream
+         // until it gets EOF. In this case we point the InputStream at a file on disk, and it will suck up the entire
+         // file, however we could use any InputStream not just a FileInputStream.
+         FileInputStream fileInputStream = new FileInputStream(fileInput);
+         BufferedInputStream bufferedInput = new BufferedInputStream(fileInputStream);
+
+         message.setObjectProperty("JMS_AMQ_InputStream", bufferedInput);
+
+         System.out.println("Sending the huge message.");
+
+         // Step 9. Send the Message
+         producer.send(message);
+
+         System.out.println("Large Message sent");
+
+         System.out.println("Stopping server.");
+
+         // Step 10. To demonstrate that that we're not simply streaming the message from sending to consumer, we stop
+         // the server and restart it before consuming the message. This demonstrates that the large message gets
+         // persisted, like a
+         // normal persistent message, on the server. If you look at ./build/data/largeMessages you will see the
+         // largeMessage stored on disk the server
+
+         connection.close();
+
+         initialContext.close();
+
+         ServerUtil.killServer(server);
+
+         server = ServerUtil.startServer(args[0], "LargeMessageExample", 0, 5000);
+
+         System.out.println("Server restarted.");
+
+         // Step 11. Now the server is restarted we can recreate the JMS Objects, and start the new connection
+
+         initialContext = new InitialContext();
+
+         queue = (Queue) initialContext.lookup("queue/exampleQueue");
+
+         cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+
+         connection = cf.createConnection();
+
+         session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         connection.start();
+
+         System.out.println("Receiving message.");
+
+         // Step 12. Receive the message. When we receive the large message we initially just receive the message with
+         // an empty body.
+         BytesMessage messageReceived = (BytesMessage) messageConsumer.receive(120000);
+
+         System.out.println("Received message with: " + messageReceived.getLongProperty("_AMQ_LARGE_SIZE") +
+                               " bytes. Now streaming to file on disk.");
+
+         // Step 13. We set an OutputStream on the message. This causes the message body to be written to the
+         // OutputStream until there are no more bytes to be written.
+         // You don't have to use a FileOutputStream, you can use any OutputStream.
+         // You may choose to use the regular BytesMessage or
+         // StreamMessage interface but this method is much faster for large messages.
+
+         File outputFile = new File("huge_message_received.dat");
+
+         FileOutputStream fileOutputStream = new FileOutputStream(outputFile);
+
+         BufferedOutputStream bufferedOutput = new BufferedOutputStream(fileOutputStream);
+
+         // Step 14. This will save the stream and wait until the entire message is written before continuing.
+         messageReceived.setObjectProperty("JMS_AMQ_SaveStream", bufferedOutput);
+
+         fileOutputStream.close();
+
+         System.out.println("File streamed to disk. Size of received file on disk is " + outputFile.length());
+      }
+      finally {
+         // Step 12. Be sure to close our resources!
+         if (initialContext != null) {
+            initialContext.close();
+         }
+
+         if (connection != null) {
+            connection.close();
+         }
+
+         ServerUtil.killServer(server);
+      }
+   }
+
+   private static void createFile(final File file, final long fileSize) throws IOException {
+      FileOutputStream fileOut = new FileOutputStream(file);
+      BufferedOutputStream buffOut = new BufferedOutputStream(fileOut);
+      byte[] outBuffer = new byte[1024 * 1024];
+      for (long i = 0; i < fileSize; i += outBuffer.length) {
+         buffOut.write(outBuffer);
+      }
+      buffOut.close();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/large-message/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/large-message/src/main/resources/jndi.properties b/examples/features/standard/large-message/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/large-message/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/6b17d966/examples/features/standard/last-value-queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/last-value-queue/pom.xml b/examples/features/standard/last-value-queue/pom.xml
new file mode 100644
index 0000000..e38c08e
--- /dev/null
+++ b/examples/features/standard/last-value-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>last-value-queue</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Last Value 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>
+                     <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.LastValueQueueExample</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>last-value-queue</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/last-value-queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/last-value-queue/readme.html b/examples/features/standard/last-value-queue/readme.html
new file mode 100644
index 0000000..1fb58ee
--- /dev/null
+++ b/examples/features/standard/last-value-queue/readme.html
@@ -0,0 +1,162 @@
+<!--
+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 Last-Value 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>Last-Value 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 configure and use last-value queues.</p>
+     <p>Last-Value queues are special queues which discard any messages when a newer message with the same value for a well-defined <em>Last-Value</em> property is put in the queue.
+         In other words, a Last-Value queue only retains the last value.</p>
+     <p>A typical example for Last-Value queue is for stock prices, where you are only interested by the latest value for a particular stock.</p>
+
+     <p>The example will send 3 messages with the same <em>Last-Value</em> property to a to a Last-Value queue.<br />
+        We will browse the queue and see that only the last message is in the queue, the first two messages have been discarded. <br />
+        We will then consume from the queue the <em>last</em> message.</p>
+
+     <h2>Example setup</h2>
+     <p>Last-Value queues are defined in the configuration file <a href="server0/broker.xml">broker.xml</a>:</p>
+     <pre class="prettyprint">
+         <code>&lt;address-setting match="jms.queue.lastValueQueue"&gt;
+                &lt;last-value-queue&gt;true&lt;/last-value-queue&gt;
+         &lt;/address-setting&gt;</code>
+     </pre>
+
+     <h2>Example step-by-step</h2>
+     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <a href="server0/client-jndi.properties">client-jndi.properties</a></li>
+        <pre class="prettyprint">
+           <code>InitialContext initialContext = getContext();</code>
+        </pre>
+
+        <li>We look up the JMS queue object from JNDI</li>
+        <pre class="prettyprint">
+           <code>Queue queue = (Queue) initialContext.lookup("/queue/lastValueQueue");</code>
+        </pre>
+
+        <li>We look up the JMS connection factory object from JNDI</li>
+        <pre class="prettyprint">
+           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>We create a JMS connection, a session and a producer for the queue</li>
+        <pre class="prettyprint">
+           <code> connection = cf.createConnection();
+            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+            MessageProducer producer = session.createProducer(queue);</code>
+       </pre>
+
+       <li>We will create and send a text message with the Last-Value property set to <code>STOCK_NAME</code></li>
+       <pre class="prettyprint">
+           <code>TextMessage message = session.createTextMessage("1st message with Last-Value property set");
+           message.setStringProperty("_AMQ_LVQ_NAME", "STOCK_NAME");
+           producer.send(message);
+           System.out.format("Sent message: %s\n", message.getText());</code>
+       </pre>
+
+       <p><em>The <em>Last-Value</em> key is defined in ActiveMQ's MessageImpl class. Its value is <code>"_AMQ_LVQ_NAME"</code></em></p>
+
+       <li>We will create and send a <em>second</em> text message with the Last-Value property set to <code>STOCK_NAME</code></li>
+       <pre class="prettyprint">
+           <code>message = session.createTextMessage("2nd message with Last-Value property set");
+           message.setStringProperty("_AMQ_LVQ_NAME", "STOCK_NAME");
+           producer.send(message);
+           System.out.format("Sent message: %s\n", message.getText());</code>
+       </pre>
+
+       <li>We will create and send a <em>third</em> text message with the Last-Value property set to <code>STOCK_NAME</code></li>
+       <pre class="prettyprint">
+           <code>message = session.createTextMessage("3rd message with Last-Value property set");
+           message.setStringProperty("_AMQ_LVQ_NAME", "STOCK_NAME");
+           producer.send(message);
+           System.out.format("Sent message: %s\n", message.getText());</code>
+       </pre>
+
+       <p><em>When the 2<sup>nd</sup> message was sent to the queue, the 1<sup>st</sup> message was discarded.<br />
+           Similarly, when the 3<sup>rd</sup> message was sent to the queue, the 2<sup>nd</sup> message was discarded.<br />
+           Only the 3<sup>rd</sup> message remains in the queue.</em></p>
+
+        <li>We will browse the queue. There will be a single message displayed: the 3<sup>rd</sup> message</li>
+        <pre class="prettyprint">
+            <code>QueueBrowser browser = session.createBrowser(queue);
+            Enumeration enumeration = browser.getEnumeration();
+            while (enumeration.hasMoreElements())
+            {
+               TextMessage messageInTheQueue = (TextMessage)enumeration.nextElement();
+               System.out.format("Message in the queue: %s\n", messageInTheQueue.getText());
+            }
+            browser.close();
+            </code>
+        </pre>
+
+        <p><em>We will now consume the message on the queue</em></p>
+
+        <li>We create a JMS message consumer on the queue</li>
+        <pre class="prettyprint">
+            <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
+        </pre>
+
+        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
+        <pre class="prettyprint">
+           <code>connection.start();</code>
+        </pre>
+
+        <li>We try to receive a message from the queue. It will be the 3<sup>rd</sup> message</li>
+        <pre class="prettyprint">
+           <code> TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
+            System.out.format("Received message: %s\n", messageReceived.getText());</code>
+        </pre>
+
+        <li>We will try to receive another message but there is no other on the queue. The <code>receive</code> method will timeout after 5 seconds</li>
+        <pre class="prettyprint">
+           <code> messageReceived = (TextMessage)messageConsumer.receive(5000);
+           System.out.format("Received message: %s\n", messageReceived);</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>
+
+     <h2>More information</h2>
+
+     <ul>
+        <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#last-value-queues">Last-Value Queues chapter</a></li>
+     </ul>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/last-value-queue/src/main/java/org/apache/activemq/artemis/jms/example/LastValueQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/last-value-queue/src/main/java/org/apache/activemq/artemis/jms/example/LastValueQueueExample.java b/examples/features/standard/last-value-queue/src/main/java/org/apache/activemq/artemis/jms/example/LastValueQueueExample.java
new file mode 100644
index 0000000..469f839
--- /dev/null
+++ b/examples/features/standard/last-value-queue/src/main/java/org/apache/activemq/artemis/jms/example/LastValueQueueExample.java
@@ -0,0 +1,104 @@
+/*
+ * 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.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.QueueBrowser;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import java.util.Enumeration;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+/**
+ * This example shows how to configure and use a <em>Last-Value</em> queues.
+ * Only the last message with a well-defined property is hold by the queue.
+ */
+public class LastValueQueueExample {
+
+   public static void main(final String[] args) throws Exception {
+      Connection connection = null;
+      try {
+         // Step 2. new Queue
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+         // Step 3. new Connection Factory
+         ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
+
+         // Step 4.Create a JMS Connection, session and producer on the queue
+         connection = cf.createConnection();
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer producer = session.createProducer(queue);
+
+         // Step 5. Create and send a text message with the Last-Value header set
+         TextMessage message = session.createTextMessage("1st message with Last-Value property set");
+         message.setStringProperty("_AMQ_LVQ_NAME", "STOCK_NAME");
+         producer.send(message);
+         System.out.format("Sent message: %s%n", message.getText());
+
+         // Step 6. Create and send a second text message with the Last-Value header set
+         message = session.createTextMessage("2nd message with Last-Value property set");
+         message.setStringProperty("_AMQ_LVQ_NAME", "STOCK_NAME");
+         producer.send(message);
+         System.out.format("Sent message: %s%n", message.getText());
+
+         // Step 7. Create and send a third text message with the Last-Value header set
+         message = session.createTextMessage("3rd message with Last-Value property set");
+         message.setStringProperty("_AMQ_LVQ_NAME", "STOCK_NAME");
+         producer.send(message);
+         System.out.format("Sent message: %s%n", message.getText());
+
+         // Step 8. Browse the queue. There is only 1 message in it, the last sent
+         QueueBrowser browser = session.createBrowser(queue);
+         Enumeration enumeration = browser.getEnumeration();
+         while (enumeration.hasMoreElements()) {
+            TextMessage messageInTheQueue = (TextMessage) enumeration.nextElement();
+            System.out.format("Message in the queue: %s%n", messageInTheQueue.getText());
+         }
+         browser.close();
+
+         // Step 9. Create a JMS Message Consumer for the queue
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         // Step 10. Start the Connection
+         connection.start();
+
+         // Step 11. Trying to receive a message. Since the queue is configured to keep only the
+         // last message with the Last-Value header set, the message received is the last sent
+         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
+         System.out.format("Received message: %s%n", messageReceived.getText());
+
+         // Step 12. Trying to receive another message but there will be none.
+         // The 1st message was discarded when the 2nd was sent to the queue.
+         // The 2nd message was in turn discarded when the 3trd was sent to the queue
+         messageReceived = (TextMessage) messageConsumer.receive(5000);
+         System.out.format("Received message: %s%n", messageReceived);
+
+         cf.close();
+      }
+      finally {
+         // Step 13. Be sure to close our JMS resources!
+         if (connection != null) {
+            connection.close();
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/artemis-roles.properties b/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/last-value-queue/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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/artemis-users.properties b/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/features/standard/last-value-queue/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/6b17d966/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..470de98
--- /dev/null
+++ b/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,67 @@
+<?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.dir}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</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-settings>
+
+      <address-settings>
+         <!--override the expiry address for the example-->
+         <address-setting match="jms.queue.lastValueQueue">
+            <last-value-queue>true</last-value-queue>
+         </address-setting>
+      </address-settings>
+
+   </core>
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/last-value-queue/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/features/standard/last-value-queue/src/main/resources/jndi.properties b/examples/features/standard/last-value-queue/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/features/standard/last-value-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/6b17d966/examples/features/standard/management-notifications/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/management-notifications/pom.xml b/examples/features/standard/management-notifications/pom.xml
new file mode 100644
index 0000000..bade921
--- /dev/null
+++ b/examples/features/standard/management-notifications/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>management-notifications</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Management Notifications 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>
+                     <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.ManagementNotificationExample</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>management-notifications</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/features/standard/management-notifications/readme.html
----------------------------------------------------------------------
diff --git a/examples/features/standard/management-notifications/readme.html b/examples/features/standard/management-notifications/readme.html
new file mode 100644
index 0000000..6ac1efa
--- /dev/null
+++ b/examples/features/standard/management-notifications/readme.html
@@ -0,0 +1,215 @@
+<!--
+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 Management Notification 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>Management Notification 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 how to receive management notifications from ActiveMQ Artemis using JMS Messages.</p>
+     <p>ActiveMQ Artemis servers emit management notifications when events of interest occur (consumers are created or closed,
+         destinations are created or deleted, security authentication fails, etc.).<br />
+         These notifications can be received either by using JMX (see <a href="../jmx/readme.html">JMX example</a>) or by receiving JMS Messages
+         from a well-known destination.</p>
+     <p>This example will setup a JMS MessageListener to receive management notifications. We will also perform normal JMS operations to see the kind
+         of notifications they trigger.</p>
+
+     <h2>Example configuration</h2>
+
+     <p>ActiveMQ Artemis can configured to send JMS messages when management notifications are emitted on the server.</p>
+     <p>By default, the management name is called <code>activemq.notifications</code> but this can be configured in <a href="server0/broker.xml">broker.xml</a>.
+        For this example, we will set it to <code>jms.topic.notificationsTopic</code> to be able to receive notifications from a JMS Topic.</p>
+      <pre class="prettyprint">
+         <code>&lt;management-notification-address&gt;jms.topic.notificationsTopic&lt;/management-notification-address&gt;</code>
+     </pre>
+
+     <p>Since we want to lookup the notifications topic using JNDI, we also declare it in  <a href="server0/activemq-jms.xml">activemq-jms.xml</a>
+     <pre class="prettyprint">
+         <code>&lt;topic name="notificationsTopic"&gt;
+            &lt;entry name="/topic/notificationsTopic"/&gt;
+         &lt;/topic&gt;</code>
+     </pre>
+     <p>The notification queue requires permission to create/delete temporary queues and consume messages.
+         This is also configured in <a href="server0/broker.xml">broker.xml</a></p>
+     <pre class="prettyprint">
+         <code><!--security for notification topic-->
+         &lt;security-setting match="jms.topic.notificationsTopic"&gt;
+            &lt;permission type="consume" roles="guest"/&gt;
+            &lt;permission type="createNonDurableQueue" roles="guest"/&gt;
+            &lt;permission type="deleteNonDurableQueue" roles="guest"/&gt;
+         &lt;/security-setting&gt;</code>
+     </pre>
+
+     <h2>Example step-by-step</h2>
+x     <ol>
+        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get its properties from <a href="server0/client-jndi.properties">client-jndi.properties</a></li>
+        <pre class="prettyprint">
+            <code>InitialContext initialContext = getContext(0);</code>
+        </pre>
+
+        <li>We look up the JMS queue object from JNDI</li>
+        <pre class="prettyprint">
+            <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
+        </pre>
+
+        <li>We look up the JMS connection factory object from JNDI</li>
+        <pre class="prettyprint">
+            <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
+        </pre>
+
+        <li>We create a JMS connection, a session and a message producer for the example queue</li>
+        <pre class="prettyprint">
+            <code>connection = cf.createConnection();
+            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+            MessageProducer producer = session.createProducer(queue);</code>
+        </pre>
+
+        <li>We look up the JMS Topic used to receive the notifications from JNDI</li>
+        <pre class="prettyprint">
+            <code>Topic notificationsTopic = (Topic) initialContext.lookup("/topic/notificationsTopic");</code>
+        </pre>
+
+        <li>We create a MessageConsumer for the notification queue and set its MessageListener. When a notification is received, we will simply display all the message properties</li>
+        <pre class="prettyprint">
+           <code>MessageConsumer notificationConsumer = session.createConsumer(notificationsTopic);
+           notificationConsumer.setMessageListener(new MessageListener()
+           {
+              public void onMessage(Message notif)
+              {
+                 System.out.println("------------------------");
+                 System.out.println("Received notification:");
+                 try
+                 {
+                    Enumeration propertyNames = notif.getPropertyNames();
+                    while (propertyNames.hasMoreElements())
+                    {
+                       String propertyName = (String)propertyNames.nextElement();
+                       System.out.format("  %s: %s\n", propertyName, notif.getObjectProperty(propertyName));
+                    }
+                 }
+                 catch (JMSException e)
+                 {
+                 }
+                 System.out.println("------------------------");
+              }
+           });</code>
+        </pre>
+
+        <li>We start the connection to receive messages</li>
+        <pre class="prettyprint">
+            <code>connection.start();</code>
+        </pre>
+
+        <p><em>Now that a message listener is setup to receive management notifications, we will perform regular JMS operations to
+            see what kind of notifications are triggered</em></p>
+
+        <li>We create a JMS message consumer on the example queue</li>
+        <pre class="prettyprint">
+            <code>MessageConsumer consumer = session.createConsumer(queue);</code>
+        </pre>
+
+        <p>This will generate a <code>CONSUMER_CREATED</code> notification:
+        <pre class="prettyprint">
+            <code>------------------------
+            Received notification:
+              _AMQ_RoutingName: jms.queue.exampleQueue
+              _AMQ_Address: jms.queue.exampleQueue
+              ...
+              _AMQ_ConsumerCount: 1
+              ...
+              _AMQ_NotifType: CONSUMER_CREATED
+            ------------------------</code>
+        </pre>
+        <p>The notification tells us that a consumer was created for the JMS queue <code>exampleQueue</code>. When the notification
+            was emitted, this consumer was the only one for the queue</p>
+
+        <li>We close this consumer</li>
+        <pre class="prettyprint">
+            <code>consumer.close();</code>
+        </pre>
+
+        <p>This will generate a <code>CONSUMER_CLOSED</code> notification:
+        <pre class="prettyprint">
+            <code>------------------------
+            Received notification:
+              _AMQ_RoutingName: jms.queue.exampleQueue
+              _AMQ_Address: jms.queue.exampleQueue
+              ...
+              _AMQ_ConsumerCount: 0
+              ...
+              _AMQ_NotifType: CONSUMER_CLOSED
+            ------------------------</code>
+        </pre>
+        <p>The notification tells us that a consumer was closed for the JMS queue <code>exampleQueue</code>. When the notification
+            was emitted, there were no other consumers on the queue</p>
+
+        <li>As a last example, we will create a connection with invalid user credentials</li>
+        <pre class="prettyprint">
+            <code>try
+            {
+               cf.createConnection("not.a.valid.user", "not.a.valid.password");
+            } catch (JMSException e)
+            {
+            }</code>
+        </pre>
+
+        <p>This will generate a <code>SECURITY_AUTHENTICATION_VIOLATION</code> notification:
+        <pre class="prettyprint">
+            <code>------------------------
+            Received notification:
+              _AMQ_User: not.a.valid.user
+              ...
+              _AMQ_NotifType: SECURITY_AUTHENTICATION_VIOLATION
+            ------------------------
+            </code>
+        </pre>
+        <p>The notification tells us that a user named <code>not.a.valid.user</code> failed to authenticate when creating a connection to ActiveMQ Artemis.</p>
+
+        <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>
+
+     <h2>More information</h2>
+
+     <ul>
+         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.notifications">Management Notifications chapter</a></li>
+     </ul>
+
+  </body>
+</html>