activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbert...@apache.org
Subject [29/37] activemq-6 git commit: ACTIVEMQ6-51 Example server bootstrapping
Date Wed, 10 Dec 2014 16:11:55 GMT
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-configuration.xml
deleted file mode 100644
index 2c19b91..0000000
--- a/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-configuration.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
-   
-
-
-   <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">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
-         <param key="port" value="5446"/>
-      </connector>
-   </connectors>
-   
-   <!-- Acceptors -->
-   <acceptors>
-      <acceptor name="netty-acceptor">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
-         <param key="port" value="5446"/>
-      </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>
-         <forward-when-no-consumers>true</forward-when-no-consumers>
-         <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/>
-            <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>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-jms.xml
deleted file mode 100644
index 0a77a3f..0000000
--- a/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-jms.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
-   <!--the queue used by the example-->
-   <queue name="exampleQueue"/>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-users.xml
deleted file mode 100644
index ae30546..0000000
--- a/examples/jms/colocated-failover/src/main/resources/hornetq/server1/activemq-users.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
-   <!-- the default user.  this is used where username is null-->
-   <defaultuser name="guest" password="guest">
-      <role name="guest"/>
-   </defaultuser>
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/consumer-rate-limit/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/pom.xml b/examples/jms/consumer-rate-limit/pom.xml
index 2b95571..5d62a14 100644
--- a/examples/jms/consumer-rate-limit/pom.xml
+++ b/examples/jms/consumer-rate-limit/pom.xml
@@ -102,7 +102,7 @@
             </dependencies>
             <configuration>
                <waitOnStart>false</waitOnStart>
-               <hornetqConfigurationDir>${basedir}/target/classes/activemq/server0</hornetqConfigurationDir>
+               <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
             </configuration>
          </plugin>
       </plugins>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/consumer-rate-limit/src/main/java/org/apache/activemq/jms/example/ConsumerRateLimitExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/src/main/java/org/apache/activemq/jms/example/ConsumerRateLimitExample.java b/examples/jms/consumer-rate-limit/src/main/java/org/apache/activemq/jms/example/ConsumerRateLimitExample.java
index 5bb9da8..4121685 100644
--- a/examples/jms/consumer-rate-limit/src/main/java/org/apache/activemq/jms/example/ConsumerRateLimitExample.java
+++ b/examples/jms/consumer-rate-limit/src/main/java/org/apache/activemq/jms/example/ConsumerRateLimitExample.java
@@ -48,7 +48,7 @@ public class ConsumerRateLimitExample extends ActiveMQExample
       try
       {
          // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = getContext(0);
+         initialContext = new InitialContext();
 
          // Step 2. Perfom a lookup on the queue
          Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-configuration.xml
new file mode 100644
index 0000000..52d9570
--- /dev/null
+++ b/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-configuration.xml
@@ -0,0 +1,34 @@
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
+
+   <bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
+
+   <journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
+
+   <large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
+
+   <paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
+   
+   <!-- Acceptors -->
+   <acceptors>
+      <acceptor name="netty-acceptor">
+         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
+      </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>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-jms.xml b/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-jms.xml
new file mode 100644
index 0000000..0d5c953
--- /dev/null
+++ b/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-jms.xml
@@ -0,0 +1,8 @@
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
+
+   <!--the queue used by the example-->
+   <queue name="exampleQueue"/>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-users.xml b/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-users.xml
new file mode 100644
index 0000000..ae30546
--- /dev/null
+++ b/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/activemq-users.xml
@@ -0,0 +1,7 @@
+<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
+   <!-- the default user.  this is used where username is null-->
+   <defaultuser name="guest" password="guest">
+      <role name="guest"/>
+   </defaultuser>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-configuration.xml
deleted file mode 100644
index daab0a3..0000000
--- a/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-configuration.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
-
-   <bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
-
-   <journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
-
-   <large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
-
-   <paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
-
-   <!-- Connectors -->
-
-   <connectors>
-      <connector name="netty-connector">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
-      </connector>
-   </connectors>
-   
-   <!-- Acceptors -->
-   <acceptors>
-      <acceptor name="netty-acceptor">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
-      </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>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-jms.xml
deleted file mode 100644
index 0d5c953..0000000
--- a/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-jms.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
-
-   <!--the queue used by the example-->
-   <queue name="exampleQueue"/>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-users.xml
deleted file mode 100644
index ae30546..0000000
--- a/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/activemq-users.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
-   <!-- the default user.  this is used where username is null-->
-   <defaultuser name="guest" password="guest">
-      <role name="guest"/>
-   </defaultuser>
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/client-jndi.properties
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/client-jndi.properties b/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/client-jndi.properties
deleted file mode 100644
index 6940f75..0000000
--- a/examples/jms/consumer-rate-limit/src/main/resources/hornetq/server0/client-jndi.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
-java.naming.provider.url=tcp://localhost:5445
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/consumer-rate-limit/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/src/main/resources/jndi.properties b/examples/jms/consumer-rate-limit/src/main/resources/jndi.properties
new file mode 100644
index 0000000..21f36b2
--- /dev/null
+++ b/examples/jms/consumer-rate-limit/src/main/resources/jndi.properties
@@ -0,0 +1,4 @@
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
+java.naming.provider.url=tcp://localhost:5445
+connection.ConnectionFactory.consumerMaxRate=10
+queue.queue/exampleQueue=exampleQueue
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/dead-letter/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/pom.xml b/examples/jms/dead-letter/pom.xml
index 6f7ebc8..5035c89 100644
--- a/examples/jms/dead-letter/pom.xml
+++ b/examples/jms/dead-letter/pom.xml
@@ -102,7 +102,7 @@
             </dependencies>
             <configuration>
                <waitOnStart>false</waitOnStart>
-               <hornetqConfigurationDir>${basedir}/target/classes/activemq/server0</hornetqConfigurationDir>
+               <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
             </configuration>
          </plugin>
       </plugins>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/dead-letter/src/main/java/org/apache/activemq/jms/example/DeadLetterExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/src/main/java/org/apache/activemq/jms/example/DeadLetterExample.java b/examples/jms/dead-letter/src/main/java/org/apache/activemq/jms/example/DeadLetterExample.java
index 1768955..d38cebe 100644
--- a/examples/jms/dead-letter/src/main/java/org/apache/activemq/jms/example/DeadLetterExample.java
+++ b/examples/jms/dead-letter/src/main/java/org/apache/activemq/jms/example/DeadLetterExample.java
@@ -49,7 +49,7 @@ public class DeadLetterExample extends ActiveMQExample
       try
       {
          // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = getContext(0);
+         initialContext = new InitialContext();
 
          // Step 2. Perfom a lookup on the queue
          Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-configuration.xml
new file mode 100644
index 0000000..19c89b5
--- /dev/null
+++ b/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-configuration.xml
@@ -0,0 +1,42 @@
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
+
+   <bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
+
+   <journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
+
+   <large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
+
+   <paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
+   
+   <!-- Acceptors -->
+   <acceptors>
+      <acceptor name="netty-acceptor">
+         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
+      </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>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-jms.xml b/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-jms.xml
new file mode 100644
index 0000000..8fa2fbb
--- /dev/null
+++ b/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-jms.xml
@@ -0,0 +1,11 @@
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
+
+   <!--the queue used by the example-->
+   <queue name="exampleQueue"/>
+
+   <!-- the dead letter queue where dead messages will be sent-->
+   <queue name="deadLetterQueue"/>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-users.xml b/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-users.xml
new file mode 100644
index 0000000..ae30546
--- /dev/null
+++ b/examples/jms/dead-letter/src/main/resources/activemq/server0/activemq-users.xml
@@ -0,0 +1,7 @@
+<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
+   <!-- the default user.  this is used where username is null-->
+   <defaultuser name="guest" password="guest">
+      <role name="guest"/>
+   </defaultuser>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-configuration.xml
deleted file mode 100644
index a2fd289..0000000
--- a/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-configuration.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
-
-   <bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
-
-   <journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
-
-   <large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
-
-   <paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
-
-   <!-- Connectors -->
-
-   <connectors>
-      <connector name="netty-connector">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
-      </connector>
-   </connectors>
-   
-   <!-- Acceptors -->
-   <acceptors>
-      <acceptor name="netty-acceptor">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
-      </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>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-jms.xml
deleted file mode 100644
index 8fa2fbb..0000000
--- a/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-jms.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
-
-   <!--the queue used by the example-->
-   <queue name="exampleQueue"/>
-
-   <!-- the dead letter queue where dead messages will be sent-->
-   <queue name="deadLetterQueue"/>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-users.xml
deleted file mode 100644
index ae30546..0000000
--- a/examples/jms/dead-letter/src/main/resources/hornetq/server0/activemq-users.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
-   <!-- the default user.  this is used where username is null-->
-   <defaultuser name="guest" password="guest">
-      <role name="guest"/>
-   </defaultuser>
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/dead-letter/src/main/resources/hornetq/server0/client-jndi.properties
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/src/main/resources/hornetq/server0/client-jndi.properties b/examples/jms/dead-letter/src/main/resources/hornetq/server0/client-jndi.properties
deleted file mode 100644
index 6940f75..0000000
--- a/examples/jms/dead-letter/src/main/resources/hornetq/server0/client-jndi.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
-java.naming.provider.url=tcp://localhost:5445
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/dead-letter/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/src/main/resources/jndi.properties b/examples/jms/dead-letter/src/main/resources/jndi.properties
new file mode 100644
index 0000000..d83e731
--- /dev/null
+++ b/examples/jms/dead-letter/src/main/resources/jndi.properties
@@ -0,0 +1,4 @@
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
+java.naming.provider.url=tcp://localhost:5445
+queue.queue/exampleQueue=exampleQueue
+queue.queue/deadLetterQueue=deadLetterQueue
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/delayed-redelivery/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/pom.xml b/examples/jms/delayed-redelivery/pom.xml
index db25002..ba28d9f 100644
--- a/examples/jms/delayed-redelivery/pom.xml
+++ b/examples/jms/delayed-redelivery/pom.xml
@@ -94,7 +94,7 @@
             </dependencies>
             <configuration>
                <waitOnStart>false</waitOnStart>
-               <hornetqConfigurationDir>${basedir}/target/classes/activemq/server0</hornetqConfigurationDir>
+               <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
                <systemProperties>
                   <property>
                      <name>build.directory</name>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/delayed-redelivery/src/main/java/org/apache/activemq/jms/example/DelayedRedeliveryExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/src/main/java/org/apache/activemq/jms/example/DelayedRedeliveryExample.java b/examples/jms/delayed-redelivery/src/main/java/org/apache/activemq/jms/example/DelayedRedeliveryExample.java
index 4bfc1ca..886dcff 100644
--- a/examples/jms/delayed-redelivery/src/main/java/org/apache/activemq/jms/example/DelayedRedeliveryExample.java
+++ b/examples/jms/delayed-redelivery/src/main/java/org/apache/activemq/jms/example/DelayedRedeliveryExample.java
@@ -52,7 +52,7 @@ public class DelayedRedeliveryExample extends ActiveMQExample
       try
       {
          // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = getContext(0);
+         initialContext = new InitialContext();
 
          // Step 2. Perform a lookup on the queue
          Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-configuration.xml
new file mode 100644
index 0000000..1b1e55c
--- /dev/null
+++ b/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-configuration.xml
@@ -0,0 +1,41 @@
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
+
+   <bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
+
+   <journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
+
+   <large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
+
+   <paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
+   
+   <!-- Acceptors -->
+   <acceptors>
+      <acceptor name="netty-acceptor">
+         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
+      </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>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-jms.xml b/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-jms.xml
new file mode 100644
index 0000000..8fa2fbb
--- /dev/null
+++ b/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-jms.xml
@@ -0,0 +1,11 @@
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
+
+   <!--the queue used by the example-->
+   <queue name="exampleQueue"/>
+
+   <!-- the dead letter queue where dead messages will be sent-->
+   <queue name="deadLetterQueue"/>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-users.xml b/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-users.xml
new file mode 100644
index 0000000..ae30546
--- /dev/null
+++ b/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/activemq-users.xml
@@ -0,0 +1,7 @@
+<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
+   <!-- the default user.  this is used where username is null-->
+   <defaultuser name="guest" password="guest">
+      <role name="guest"/>
+   </defaultuser>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-configuration.xml
deleted file mode 100644
index 5998306..0000000
--- a/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-configuration.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
-
-   <bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
-
-   <journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
-
-   <large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
-
-   <paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
-
-   <!-- Connectors -->
-
-   <connectors>
-      <connector name="netty-connector">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
-      </connector>
-   </connectors>
-   
-   <!-- Acceptors -->
-   <acceptors>
-      <acceptor name="netty-acceptor">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
-      </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>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-jms.xml
deleted file mode 100644
index 8fa2fbb..0000000
--- a/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-jms.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
-
-   <!--the queue used by the example-->
-   <queue name="exampleQueue"/>
-
-   <!-- the dead letter queue where dead messages will be sent-->
-   <queue name="deadLetterQueue"/>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-users.xml
deleted file mode 100644
index ae30546..0000000
--- a/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/activemq-users.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
-   <!-- the default user.  this is used where username is null-->
-   <defaultuser name="guest" password="guest">
-      <role name="guest"/>
-   </defaultuser>
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/client-jndi.properties
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/client-jndi.properties b/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/client-jndi.properties
deleted file mode 100644
index 6940f75..0000000
--- a/examples/jms/delayed-redelivery/src/main/resources/hornetq/server0/client-jndi.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
-java.naming.provider.url=tcp://localhost:5445
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/delayed-redelivery/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/src/main/resources/jndi.properties b/examples/jms/delayed-redelivery/src/main/resources/jndi.properties
new file mode 100644
index 0000000..d9b5c6a
--- /dev/null
+++ b/examples/jms/delayed-redelivery/src/main/resources/jndi.properties
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
+java.naming.provider.url=tcp://localhost:5445
+queue.queue/exampleQueue=exampleQueue
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/divert/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/pom.xml b/examples/jms/divert/pom.xml
index d987365..8f12f9f 100644
--- a/examples/jms/divert/pom.xml
+++ b/examples/jms/divert/pom.xml
@@ -41,7 +41,7 @@
                      <goal>start</goal>
                   </goals>
                   <configuration>
-                     <hornetqConfigurationDir>${basedir}/target/classes/activemq/server0</hornetqConfigurationDir>
+                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
                   </configuration>
                </execution>
                <execution>
@@ -50,9 +50,7 @@
                      <goal>start</goal>
                   </goals>
                   <configuration>
-                     <jndiPort>1199</jndiPort>
-                     <jndiRmiPort>1198</jndiRmiPort>
-                     <hornetqConfigurationDir>${basedir}/target/classes/activemq/server1</hornetqConfigurationDir>
+                     <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
                      <fork>true</fork>
                   </configuration>
                </execution>
@@ -81,7 +79,7 @@
                      <goal>stop</goal>
                   </goals>
                   <configuration>
-                     <hornetqConfigurationDir>${basedir}/target/classes/activemq/server0</hornetqConfigurationDir>
+                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
                   </configuration>
                </execution>
                <execution>
@@ -90,7 +88,7 @@
                      <goal>stop</goal>
                   </goals>
                   <configuration>
-                     <hornetqConfigurationDir>${basedir}/target/classes/activemq/server1</hornetqConfigurationDir>
+                     <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
                   </configuration>
                </execution>
             </executions>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/divert/src/main/java/org/apache/activemq/jms/example/DivertExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/java/org/apache/activemq/jms/example/DivertExample.java b/examples/jms/divert/src/main/java/org/apache/activemq/jms/example/DivertExample.java
index 94d69ef..57e4327 100644
--- a/examples/jms/divert/src/main/java/org/apache/activemq/jms/example/DivertExample.java
+++ b/examples/jms/divert/src/main/java/org/apache/activemq/jms/example/DivertExample.java
@@ -16,6 +16,8 @@
  */
 package org.apache.activemq.jms.example;
 
+import java.util.Hashtable;
+
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.Message;
@@ -57,7 +59,13 @@ public class DivertExample extends ActiveMQExample
       try
       {
          // Step 1. Create an initial context to perform the JNDI lookup on the London server
-         initialContextLondon = getContext(0);
+         Hashtable<String, Object> properties = new Hashtable<String, Object>();
+         properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+         properties.put("java.naming.provider.url", args[0]);
+         properties.put("queue.queue/orders", "orders");
+         properties.put("topic.topic/priceUpdates", "priceUpdates");
+         properties.put("topic.topic/spyTopic", "spyTopic");
+         initialContextLondon = new InitialContext(properties);
 
          // Step 2. Look-up the queue orderQueue on the London server - this is the queue any orders are sent to
          Queue orderQueue = (Queue)initialContextLondon.lookup("queue/orders");
@@ -70,7 +78,11 @@ public class DivertExample extends ActiveMQExample
          Topic spyTopic = (Topic)initialContextLondon.lookup("topic/spyTopic");
 
          // Step 6. Create an initial context to perform the JNDI lookup on the New York server
-         initialContextNewYork = getContext(1);
+         properties = new Hashtable<String, Object>();
+         properties.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+         properties.put("java.naming.provider.url", args[1]);
+         properties.put("topic.topic/newYorkPriceUpdates", "newYorkPriceUpdates");
+         initialContextNewYork = new InitialContext(properties);
 
          // Step 7. Look-up the topic newYorkPriceUpdates on the New York server - any price updates sent to
          // priceUpdates on the London server will

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/divert/src/main/resources/activemq/server0/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/divert/src/main/resources/activemq/server0/activemq-configuration.xml
new file mode 100644
index 0000000..3d7b7b1
--- /dev/null
+++ b/examples/jms/divert/src/main/resources/activemq/server0/activemq-configuration.xml
@@ -0,0 +1,90 @@
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
+
+   <!-- We need to make it clustered otherwise the bridge won't deploy -->
+   
+
+   <bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
+
+   <journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
+
+   <large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
+
+   <paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
+
+   <!-- Connectors -->
+
+   <connectors>
+      <!-- This connector corresponds to the New York server -->
+      <connector name="newyork-connector">
+         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
+         <param key="port" value="5446"/>
+      </connector>
+   </connectors>
+
+   <!-- Acceptors -->
+
+   <acceptors>
+      <acceptor name="netty-acceptor">
+         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
+         <param key="port" value="5445"/>
+      </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.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>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/divert/src/main/resources/activemq/server0/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/resources/activemq/server0/activemq-jms.xml b/examples/jms/divert/src/main/resources/activemq/server0/activemq-jms.xml
new file mode 100644
index 0000000..d82f40c
--- /dev/null
+++ b/examples/jms/divert/src/main/resources/activemq/server0/activemq-jms.xml
@@ -0,0 +1,18 @@
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
+   <!-- 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"/>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/divert/src/main/resources/activemq/server0/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/resources/activemq/server0/activemq-users.xml b/examples/jms/divert/src/main/resources/activemq/server0/activemq-users.xml
new file mode 100644
index 0000000..ae30546
--- /dev/null
+++ b/examples/jms/divert/src/main/resources/activemq/server0/activemq-users.xml
@@ -0,0 +1,7 @@
+<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
+   <!-- the default user.  this is used where username is null-->
+   <defaultuser name="guest" password="guest">
+      <role name="guest"/>
+   </defaultuser>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/divert/src/main/resources/activemq/server1/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/resources/activemq/server1/activemq-configuration.xml b/examples/jms/divert/src/main/resources/activemq/server1/activemq-configuration.xml
new file mode 100644
index 0000000..1ea7a50
--- /dev/null
+++ b/examples/jms/divert/src/main/resources/activemq/server1/activemq-configuration.xml
@@ -0,0 +1,36 @@
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
+
+   <bindings-directory>${build.directory}/server1/data/messaging/bindings</bindings-directory>
+
+   <journal-directory>${build.directory}/server1/data/messaging/journal</journal-directory>
+
+   <large-messages-directory>${build.directory}/server1/data/messaging/largemessages</large-messages-directory>
+
+   <paging-directory>${build.directory}/server1/data/messaging/paging</paging-directory>
+
+   <!-- Acceptors -->
+
+   <acceptors>
+      <acceptor name="netty-acceptor">
+         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
+         <param key="port" value="5446"/>
+      </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>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/divert/src/main/resources/activemq/server1/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/resources/activemq/server1/activemq-jms.xml b/examples/jms/divert/src/main/resources/activemq/server1/activemq-jms.xml
new file mode 100644
index 0000000..8cb753a
--- /dev/null
+++ b/examples/jms/divert/src/main/resources/activemq/server1/activemq-jms.xml
@@ -0,0 +1,11 @@
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
+
+   <!-- Destinations used by the example -->
+
+   <!-- The topic for New York price updates -->
+   
+   <topic name="newYorkPriceUpdates"/>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/divert/src/main/resources/activemq/server1/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/resources/activemq/server1/activemq-users.xml b/examples/jms/divert/src/main/resources/activemq/server1/activemq-users.xml
new file mode 100644
index 0000000..ae30546
--- /dev/null
+++ b/examples/jms/divert/src/main/resources/activemq/server1/activemq-users.xml
@@ -0,0 +1,7 @@
+<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
+   <!-- the default user.  this is used where username is null-->
+   <defaultuser name="guest" password="guest">
+      <role name="guest"/>
+   </defaultuser>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/divert/src/main/resources/hornetq/server0/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/divert/src/main/resources/hornetq/server0/activemq-configuration.xml
deleted file mode 100644
index da10d0e..0000000
--- a/examples/jms/divert/src/main/resources/hornetq/server0/activemq-configuration.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
-
-   <!-- We need to make it clustered otherwise the bridge won't deploy -->
-   
-
-   <bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
-
-   <journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
-
-   <large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
-
-   <paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
-
-   <!-- Connectors -->
-
-   <connectors>
-      <connector name="netty-connector">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
-         <param key="port" value="5445"/>
-      </connector>
-   
-      <!-- This connector corresponds to the New York server -->
-      
-      <connector name="newyork-connector">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
-         <param key="port" value="5446"/>
-      </connector>
-   </connectors>
-
-   <!-- Acceptors -->
-
-   <acceptors>
-      <acceptor name="netty-acceptor">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
-         <param key="port" value="5445"/>
-      </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.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>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/divert/src/main/resources/hornetq/server0/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/divert/src/main/resources/hornetq/server0/activemq-jms.xml
deleted file mode 100644
index d82f40c..0000000
--- a/examples/jms/divert/src/main/resources/hornetq/server0/activemq-jms.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
-   <!-- 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"/>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/divert/src/main/resources/hornetq/server0/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/divert/src/main/resources/hornetq/server0/activemq-users.xml
deleted file mode 100644
index ae30546..0000000
--- a/examples/jms/divert/src/main/resources/hornetq/server0/activemq-users.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
-   <!-- the default user.  this is used where username is null-->
-   <defaultuser name="guest" password="guest">
-      <role name="guest"/>
-   </defaultuser>
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/divert/src/main/resources/hornetq/server1/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/resources/hornetq/server1/activemq-configuration.xml b/examples/jms/divert/src/main/resources/hornetq/server1/activemq-configuration.xml
deleted file mode 100644
index 661288f..0000000
--- a/examples/jms/divert/src/main/resources/hornetq/server1/activemq-configuration.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
-
-   <bindings-directory>${build.directory}/server1/data/messaging/bindings</bindings-directory>
-
-   <journal-directory>${build.directory}/server1/data/messaging/journal</journal-directory>
-
-   <large-messages-directory>${build.directory}/server1/data/messaging/largemessages</large-messages-directory>
-
-   <paging-directory>${build.directory}/server1/data/messaging/paging</paging-directory>
-
-   <!-- Connectors -->
-
-   <connectors>
-      <connector name="netty-connector">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
-         <param key="port" value="5446"/>
-      </connector>
-   </connectors>
-
-   <!-- Acceptors -->
-
-   <acceptors>
-      <acceptor name="netty-acceptor">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
-         <param key="port" value="5446"/>
-      </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>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/divert/src/main/resources/hornetq/server1/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/divert/src/main/resources/hornetq/server1/activemq-jms.xml
deleted file mode 100644
index 8cb753a..0000000
--- a/examples/jms/divert/src/main/resources/hornetq/server1/activemq-jms.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
-
-   <!-- Destinations used by the example -->
-
-   <!-- The topic for New York price updates -->
-   
-   <topic name="newYorkPriceUpdates"/>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/divert/src/main/resources/hornetq/server1/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/resources/hornetq/server1/activemq-users.xml b/examples/jms/divert/src/main/resources/hornetq/server1/activemq-users.xml
deleted file mode 100644
index ae30546..0000000
--- a/examples/jms/divert/src/main/resources/hornetq/server1/activemq-users.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
-   <!-- the default user.  this is used where username is null-->
-   <defaultuser name="guest" password="guest">
-      <role name="guest"/>
-   </defaultuser>
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/durable-subscription/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/pom.xml b/examples/jms/durable-subscription/pom.xml
index 2149c87..542a799 100644
--- a/examples/jms/durable-subscription/pom.xml
+++ b/examples/jms/durable-subscription/pom.xml
@@ -102,7 +102,7 @@
             </dependencies>
             <configuration>
                <waitOnStart>false</waitOnStart>
-               <hornetqConfigurationDir>${basedir}/target/classes/activemq/server0</hornetqConfigurationDir>
+               <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
             </configuration>
          </plugin>
       </plugins>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/durable-subscription/src/main/java/org/apache/activemq/jms/example/DurableSubscriptionExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/src/main/java/org/apache/activemq/jms/example/DurableSubscriptionExample.java b/examples/jms/durable-subscription/src/main/java/org/apache/activemq/jms/example/DurableSubscriptionExample.java
index 792e82e..5c88b01 100644
--- a/examples/jms/durable-subscription/src/main/java/org/apache/activemq/jms/example/DurableSubscriptionExample.java
+++ b/examples/jms/durable-subscription/src/main/java/org/apache/activemq/jms/example/DurableSubscriptionExample.java
@@ -47,7 +47,7 @@ public class DurableSubscriptionExample extends ActiveMQExample
       try
       {
          // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = getContext(0);
+         initialContext = new InitialContext();
 
          // Step 2. Look-up the JMS topic
          Topic topic = (Topic)initialContext.lookup("topic/exampleTopic");

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-configuration.xml
new file mode 100644
index 0000000..b00c317
--- /dev/null
+++ b/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-configuration.xml
@@ -0,0 +1,36 @@
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
+
+   <bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
+
+   <journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
+
+   <large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
+
+   <paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
+   
+   <!-- Acceptors -->
+
+   <acceptors>
+      <acceptor name="netty-acceptor">
+         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
+         <param key="port" value="5445"/>
+      </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>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-jms.xml b/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-jms.xml
new file mode 100644
index 0000000..ab4841d
--- /dev/null
+++ b/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-jms.xml
@@ -0,0 +1,8 @@
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
+
+   <!--the topic used by the example-->
+   <topic name="exampleTopic"/>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-users.xml b/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-users.xml
new file mode 100644
index 0000000..ae30546
--- /dev/null
+++ b/examples/jms/durable-subscription/src/main/resources/activemq/server0/activemq-users.xml
@@ -0,0 +1,7 @@
+<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
+   <!-- the default user.  this is used where username is null-->
+   <defaultuser name="guest" password="guest">
+      <role name="guest"/>
+   </defaultuser>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-configuration.xml b/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-configuration.xml
deleted file mode 100644
index 017fcc0..0000000
--- a/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-configuration.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
-
-   <bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
-
-   <journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
-
-   <large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
-
-   <paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
-
-
-   <!-- Connectors -->
-   <connectors>
-      <connector name="netty-connector">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
-      </connector>
-   </connectors>
-   
-   <!-- Acceptors -->
-
-   <acceptors>
-      <acceptor name="netty-acceptor">
-         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
-         <param key="port" value="5445"/>
-      </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>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-jms.xml
deleted file mode 100644
index ab4841d..0000000
--- a/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-jms.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
-
-   <!--the topic used by the example-->
-   <topic name="exampleTopic"/>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-users.xml b/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-users.xml
deleted file mode 100644
index ae30546..0000000
--- a/examples/jms/durable-subscription/src/main/resources/hornetq/server0/activemq-users.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
-   <!-- the default user.  this is used where username is null-->
-   <defaultuser name="guest" password="guest">
-      <role name="guest"/>
-   </defaultuser>
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/durable-subscription/src/main/resources/hornetq/server0/client-jndi.properties
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/src/main/resources/hornetq/server0/client-jndi.properties b/examples/jms/durable-subscription/src/main/resources/hornetq/server0/client-jndi.properties
deleted file mode 100644
index f68e7f7..0000000
--- a/examples/jms/durable-subscription/src/main/resources/hornetq/server0/client-jndi.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
-java.naming.provider.url=tcp://localhost:5445

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/durable-subscription/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/src/main/resources/jndi.properties b/examples/jms/durable-subscription/src/main/resources/jndi.properties
new file mode 100644
index 0000000..0468620
--- /dev/null
+++ b/examples/jms/durable-subscription/src/main/resources/jndi.properties
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
+java.naming.provider.url=tcp://localhost:5445
+topic.topic/exampleTopic=exampleTopic

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/embedded-simple/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/embedded-simple/pom.xml b/examples/jms/embedded-simple/pom.xml
index 1b01307..df7be67 100644
--- a/examples/jms/embedded-simple/pom.xml
+++ b/examples/jms/embedded-simple/pom.xml
@@ -99,7 +99,7 @@
             </dependencies>
             <configuration>
                <waitOnStart>false</waitOnStart>
-               <hornetqConfigurationDir>${basedir}/target/classes/activemq/server0</hornetqConfigurationDir>
+               <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
             </configuration>
          </plugin>
       </plugins>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/embedded-simple/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/embedded-simple/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java b/examples/jms/embedded-simple/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java
index e41a025..05f227c 100644
--- a/examples/jms/embedded-simple/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java
+++ b/examples/jms/embedded-simple/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java
@@ -16,7 +16,9 @@
  */
 package org.apache.activemq.jms.example;
 
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
@@ -28,6 +30,8 @@ import javax.jms.TextMessage;
 
 import org.apache.activemq.common.example.ActiveMQExample;
 import org.apache.activemq.jms.server.embedded.EmbeddedJMS;
+import org.apache.activemq.jms.server.JMSServerManager;
+import org.apache.activemq.api.jms.JMSFactoryType;
 
 /**
  * This example demonstrates how to run a ActiveMQ embedded with JMS
@@ -52,6 +56,11 @@ public class EmbeddedExample extends ActiveMQExample
          jmsServer.start();
          System.out.println("Started Embedded JMS Server");
 
+         JMSServerManager jmsServerManager = jmsServer.getJMSServerManager();
+         jmsServerManager.addQueueToJndi("exampleQueue", "queue/exampleQueue");
+         List<String> connectors = new ArrayList<String>();
+         connectors.add("in-vm");
+         jmsServerManager.createConnectionFactory("ConnectionFactory", false, JMSFactoryType.CF, connectors, "ConnectionFactory");
          ConnectionFactory cf = (ConnectionFactory)jmsServer.lookup("ConnectionFactory");
          Queue queue = (Queue)jmsServer.lookup("queue/exampleQueue");
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/embedded-simple/src/main/resources/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/embedded-simple/src/main/resources/activemq-configuration.xml b/examples/jms/embedded-simple/src/main/resources/activemq-configuration.xml
index 7e86c38..2db2db3 100644
--- a/examples/jms/embedded-simple/src/main/resources/activemq-configuration.xml
+++ b/examples/jms/embedded-simple/src/main/resources/activemq-configuration.xml
@@ -3,13 +3,6 @@
                xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
 
     <persistence-enabled>false</persistence-enabled>
-    <!-- Connectors -->
-
-    <connectors>
-        <connector name="in-vm">
-            <factory-class>org.apache.activemq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
-        </connector>
-    </connectors>
 
     <acceptors>
         <acceptor name="in-vm">

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/embedded/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/embedded/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java b/examples/jms/embedded/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java
index 06fdb14..a89c7b4 100644
--- a/examples/jms/embedded/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java
+++ b/examples/jms/embedded/src/main/java/org/apache/activemq/jms/example/EmbeddedExample.java
@@ -81,11 +81,17 @@ public final class EmbeddedExample extends ActiveMQExample
          // Step 3. Configure the JMS ConnectionFactory
          ArrayList<String> connectorNames = new ArrayList<String>();
          connectorNames.add("connector");
-         ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl("cf", false,  connectorNames, "/cf");
+         ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl()
+            .setName("cf")
+            .setConnectorNames(connectorNames)
+            .setBindings("cf");
          jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);
 
          // Step 4. Configure the JMS Queue
-         JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl("queue1", null, false, "queue/queue1");
+         JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl()
+            .setName("queue1")
+            .setDurable(false)
+            .setBindings("queue/queue1");
          jmsConfig.getQueueConfigurations().add(queueConfig);
 
          // Step 5. Start the JMS Server using the ActiveMQ core server and the JMS configuration
@@ -96,7 +102,7 @@ public final class EmbeddedExample extends ActiveMQExample
          System.out.println("Started Embedded JMS Server");
 
          // Step 6. Lookup JMS resources defined in the configuration
-         ConnectionFactory cf = (ConnectionFactory)jmsServer.lookup("/cf");
+         ConnectionFactory cf = (ConnectionFactory)jmsServer.lookup("cf");
          Queue queue = (Queue)jmsServer.lookup("queue/queue1");
 
          // Step 7. Send and receive a message using JMS API

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/expiry/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/expiry/pom.xml b/examples/jms/expiry/pom.xml
index 70fc1ad..a437a31 100644
--- a/examples/jms/expiry/pom.xml
+++ b/examples/jms/expiry/pom.xml
@@ -102,7 +102,7 @@
             </dependencies>
             <configuration>
                <waitOnStart>false</waitOnStart>
-               <hornetqConfigurationDir>${basedir}/target/classes/activemq/server0</hornetqConfigurationDir>
+               <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
             </configuration>
          </plugin>
       </plugins>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/expiry/src/main/java/org/apache/activemq/jms/example/ExpiryExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/expiry/src/main/java/org/apache/activemq/jms/example/ExpiryExample.java b/examples/jms/expiry/src/main/java/org/apache/activemq/jms/example/ExpiryExample.java
index a74467c..02e3963 100644
--- a/examples/jms/expiry/src/main/java/org/apache/activemq/jms/example/ExpiryExample.java
+++ b/examples/jms/expiry/src/main/java/org/apache/activemq/jms/example/ExpiryExample.java
@@ -48,7 +48,7 @@ public class ExpiryExample extends ActiveMQExample
       try
       {
          // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = getContext(0);
+         initialContext = new InitialContext();
 
          // Step 2. Perfom a lookup on the queue
          Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/expiry/src/main/resources/activemq/server0/activemq-configuration.xml
----------------------------------------------------------------------
diff --git a/examples/jms/expiry/src/main/resources/activemq/server0/activemq-configuration.xml b/examples/jms/expiry/src/main/resources/activemq/server0/activemq-configuration.xml
new file mode 100644
index 0000000..7c2c527
--- /dev/null
+++ b/examples/jms/expiry/src/main/resources/activemq/server0/activemq-configuration.xml
@@ -0,0 +1,41 @@
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
+
+   <bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
+
+   <journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
+
+   <large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
+
+   <paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
+   
+   <!-- Acceptors -->
+   <acceptors>
+      <acceptor name="netty-acceptor">
+         <factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
+      </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>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/expiry/src/main/resources/activemq/server0/activemq-jms.xml
----------------------------------------------------------------------
diff --git a/examples/jms/expiry/src/main/resources/activemq/server0/activemq-jms.xml b/examples/jms/expiry/src/main/resources/activemq/server0/activemq-jms.xml
new file mode 100644
index 0000000..d41da70
--- /dev/null
+++ b/examples/jms/expiry/src/main/resources/activemq/server0/activemq-jms.xml
@@ -0,0 +1,11 @@
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
+
+   <!--the queue used by the example-->
+   <queue name="exampleQueue"/>
+
+   <!--the expiry queue where expired messages will be sent-->
+   <queue name="expiryQueue"/>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/a102983d/examples/jms/expiry/src/main/resources/activemq/server0/activemq-users.xml
----------------------------------------------------------------------
diff --git a/examples/jms/expiry/src/main/resources/activemq/server0/activemq-users.xml b/examples/jms/expiry/src/main/resources/activemq/server0/activemq-users.xml
new file mode 100644
index 0000000..ae30546
--- /dev/null
+++ b/examples/jms/expiry/src/main/resources/activemq/server0/activemq-users.xml
@@ -0,0 +1,7 @@
+<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
+   <!-- the default user.  this is used where username is null-->
+   <defaultuser name="guest" password="guest">
+      <role name="guest"/>
+   </defaultuser>
+</configuration>
\ No newline at end of file


Mime
View raw message