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/09/26 00:10:03 UTC

[1/4] activemq-artemis git commit: This closes #177

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 616f68372 -> 8bb3d1cea


This closes #177


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

Branch: refs/heads/master
Commit: 6496be50c783e23a5815507d049af8f940f31bc7
Parents: 616f683 26e191a
Author: Clebert Suconic <cl...@apache.org>
Authored: Fri Sep 25 14:56:26 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Sep 25 14:56:26 2015 -0400

----------------------------------------------------------------------
 .../core/remoting/server/RemotingService.java   |   9 +-
 .../server/impl/RemotingServiceImpl.java        |   9 +-
 .../artemis/core/server/ServiceRegistry.java    |   5 +-
 .../core/server/impl/ServiceRegistryImpl.java   |   5 +-
 .../stomp/stomp-embedded-interceptor/pom.xml    |  92 ++++++++++++++
 .../stomp-embedded-interceptor/readme.html      |  37 ++++++
 .../StompEmbeddedWithInterceptorExample.java    | 126 +++++++++++++++++++
 .../src/main/resources/broker.xml               |  48 +++++++
 8 files changed, 315 insertions(+), 16 deletions(-)
----------------------------------------------------------------------



[2/4] activemq-artemis git commit: Add stom-embedded-interceptor example

Posted by cl...@apache.org.
Add stom-embedded-interceptor example


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

Branch: refs/heads/master
Commit: 26e191a07d3b784078b9bb38e8797786ced81d09
Parents: fe16ffe
Author: Julian Scheid <ju...@gmail.com>
Authored: Fri Sep 25 17:53:20 2015 +0200
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Sep 25 14:56:26 2015 -0400

----------------------------------------------------------------------
 .../stomp/stomp-embedded-interceptor/pom.xml    |  92 ++++++++++++++
 .../stomp-embedded-interceptor/readme.html      |  37 ++++++
 .../StompEmbeddedWithInterceptorExample.java    | 126 +++++++++++++++++++
 .../src/main/resources/broker.xml               |  48 +++++++
 4 files changed, 303 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/26e191a0/examples/protocols/stomp/stomp-embedded-interceptor/pom.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-embedded-interceptor/pom.xml b/examples/protocols/stomp/stomp-embedded-interceptor/pom.xml
new file mode 100644
index 0000000..22c726c
--- /dev/null
+++ b/examples/protocols/stomp/stomp-embedded-interceptor/pom.xml
@@ -0,0 +1,92 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT 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.stomp</groupId>
+      <artifactId>stomp-examples</artifactId>
+      <version>1.1.1-SNAPSHOT</version>
+   </parent>
+
+   <artifactId>stomp-embedded-interceptor</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ Artemis JMS Stomp Embedded Interceptor 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-stomp-protocol</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-hornetq-protocol</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>io.netty</groupId>
+         <artifactId>netty-all</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.StompEmbeddedWithInterceptorExample</clientClass>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.stomp</groupId>
+                  <artifactId>stomp-embedded-interceptor</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/26e191a0/examples/protocols/stomp/stomp-embedded-interceptor/readme.html
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-embedded-interceptor/readme.html b/examples/protocols/stomp/stomp-embedded-interceptor/readme.html
new file mode 100644
index 0000000..46cd264
--- /dev/null
+++ b/examples/protocols/stomp/stomp-embedded-interceptor/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 Stomp 1.1 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>Stomp 1.2 Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify -Pexample</b> from this directory.</pre>
+
+     <p>This example shows you how to configure ActiveMQ Artemis to intercept received Stomp messages.</p>
+     <p>The example will start a ActiveMQ Artemis server configured with Stomp and JMS.</p>
+     <p>The client will open a socket to initiate a Stomp 1.2 connection and then send one Stomp message (using TCP directly).
+       The interceptor will print each message received.</p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/26e191a0/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/StompEmbeddedWithInterceptorExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/StompEmbeddedWithInterceptorExample.java b/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/StompEmbeddedWithInterceptorExample.java
new file mode 100644
index 0000000..e9a9156
--- /dev/null
+++ b/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/StompEmbeddedWithInterceptorExample.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 org.apache.activemq.artemis.api.core.ActiveMQException;
+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.config.impl.SecurityConfiguration;
+import org.apache.activemq.artemis.core.protocol.stomp.StompConnection;
+import org.apache.activemq.artemis.core.protocol.stomp.StompFrame;
+import org.apache.activemq.artemis.core.protocol.stomp.StompFrameInterceptor;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
+import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
+import org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfiguration;
+import org.apache.activemq.artemis.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
+import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
+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.io.OutputStream;
+import java.net.Socket;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.HashSet;
+
+/**
+ * This example demonstrates how to run an ActiveMQ Artemis embedded with JMS
+ */
+public class StompEmbeddedWithInterceptorExample {
+
+   public static class MyStompInterceptor
+      implements StompFrameInterceptor {
+
+      public boolean intercept(StompFrame frame, RemotingConnection remotingConnection)
+         throws ActiveMQException {
+
+         StompConnection connection = (StompConnection) remotingConnection;
+
+         System.out.println("Intercepted frame " + frame + " on connection " + connection);
+
+         return false;
+      }
+   }
+
+   private static final String END_OF_FRAME = "\u0000";
+
+   public static void main(final String[] args) throws Exception {
+      EmbeddedJMS jmsServer = new EmbeddedJMS(); 
+      String brokerConfigPath = StompEmbeddedWithInterceptorExample.class.getResource("/broker.xml").toString();
+      jmsServer.setConfigResourcePath(brokerConfigPath);
+
+      jmsServer.start();
+      jmsServer.getActiveMQServer().getRemotingService().addIncomingInterceptor(new MyStompInterceptor());
+
+      System.out.println("Started Embedded JMS Server");
+
+      // Step 1. Create a TCP socket to connect to the Stomp port
+      Socket socket = new Socket("localhost", 61616);
+
+      // Step 2. Send a CONNECT frame to connect to the server
+      String connectFrame = "CONNECT\n" +
+         "accept-version:1.2\n" +
+         "host:localhost\n" +
+         "login:guest\n" +
+         "passcode:guest\n" +
+         "request-id:1\n" +
+         "\n" +
+         END_OF_FRAME;
+      sendFrame(socket, connectFrame);
+
+      // Step 3. Send a SEND frame (a Stomp message) to the
+      // jms.queue.exampleQueue address with a text body
+      String text = "Hello World from Stomp 1.2 !";
+      String message = "SEND\n" +
+         "destination:jms.queue.exampleQueue\n" +
+         "\n" +
+         text +
+         END_OF_FRAME;
+      sendFrame(socket, message);
+      System.out.println("Sent Stomp message: " + text);
+
+      // Step 4. Send a DISCONNECT frame to disconnect from the server
+      String disconnectFrame = "DISCONNECT\n" +
+         "\n" +
+         END_OF_FRAME;
+      sendFrame(socket, disconnectFrame);
+
+      // Step 5. Slose the TCP socket
+      socket.close();
+
+      Thread.sleep(1000);
+      jmsServer.stop();
+   }
+
+   private static void sendFrame(Socket socket, String data) throws Exception {
+      byte[] bytes = data.getBytes(StandardCharsets.UTF_8);
+      OutputStream outputStream = socket.getOutputStream();
+      for (int i = 0; i < bytes.length; i++) {
+         outputStream.write(bytes[i]);
+      }
+      outputStream.flush();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/26e191a0/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/broker.xml b/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/broker.xml
new file mode 100644
index 0000000..474a897
--- /dev/null
+++ b/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/broker.xml
@@ -0,0 +1,48 @@
+<?xml version='1.0'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT 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>
+
+      <acceptors>
+        <acceptor name="artemis">tcp://127.0.0.1:61616?protocols=STOMP</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>


[3/4] activemq-artemis git commit: ARTEMIS-227 allow adding STOMP interceptor instances

Posted by cl...@apache.org.
ARTEMIS-227 allow adding STOMP interceptor instances


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

Branch: refs/heads/master
Commit: fe16ffe0682e94a60cf665df685930ce6ecd815d
Parents: 616f683
Author: Julian Scheid <ju...@gmail.com>
Authored: Fri Sep 25 14:09:28 2015 +0200
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Sep 25 14:56:26 2015 -0400

----------------------------------------------------------------------
 .../artemis/core/remoting/server/RemotingService.java       | 9 ++++-----
 .../core/remoting/server/impl/RemotingServiceImpl.java      | 9 ++++-----
 .../activemq/artemis/core/server/ServiceRegistry.java       | 5 ++---
 .../artemis/core/server/impl/ServiceRegistryImpl.java       | 5 ++---
 4 files changed, 12 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fe16ffe0/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/RemotingService.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/RemotingService.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/RemotingService.java
index e940c02..6079be4 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/RemotingService.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/RemotingService.java
@@ -20,7 +20,6 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.activemq.artemis.api.core.BaseInterceptor;
-import org.apache.activemq.artemis.api.core.Interceptor;
 import org.apache.activemq.artemis.core.protocol.core.CoreRemotingConnection;
 import org.apache.activemq.artemis.core.security.ActiveMQPrincipal;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
@@ -43,17 +42,17 @@ public interface RemotingService {
 
    ReusableLatch getConnectionCountLatch();
 
-   void addIncomingInterceptor(Interceptor interceptor);
+   void addIncomingInterceptor(BaseInterceptor interceptor);
 
    List<BaseInterceptor> getIncomingInterceptors();
 
-   void addOutgoingInterceptor(Interceptor interceptor);
+   void addOutgoingInterceptor(BaseInterceptor interceptor);
 
    List<BaseInterceptor> getOutgoinInterceptors();
 
-   boolean removeIncomingInterceptor(Interceptor interceptor);
+   boolean removeIncomingInterceptor(BaseInterceptor interceptor);
 
-   boolean removeOutgoingInterceptor(Interceptor interceptor);
+   boolean removeOutgoingInterceptor(BaseInterceptor interceptor);
 
    void stop(boolean criticalError) throws Exception;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fe16ffe0/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
index 5b273c3..ab9de61 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
@@ -40,7 +40,6 @@ import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQInterruptedException;
 import org.apache.activemq.artemis.api.core.BaseInterceptor;
-import org.apache.activemq.artemis.api.core.Interceptor;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.protocol.core.CoreRemotingConnection;
@@ -525,7 +524,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
    }
 
    @Override
-   public void addIncomingInterceptor(final Interceptor interceptor) {
+   public void addIncomingInterceptor(final BaseInterceptor interceptor) {
       incomingInterceptors.add(interceptor);
 
       updateProtocols();
@@ -537,7 +536,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
    }
 
    @Override
-   public boolean removeIncomingInterceptor(final Interceptor interceptor) {
+   public boolean removeIncomingInterceptor(final BaseInterceptor interceptor) {
       if (incomingInterceptors.remove(interceptor)) {
          updateProtocols();
          return true;
@@ -548,7 +547,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
    }
 
    @Override
-   public void addOutgoingInterceptor(final Interceptor interceptor) {
+   public void addOutgoingInterceptor(final BaseInterceptor interceptor) {
       outgoingInterceptors.add(interceptor);
       updateProtocols();
    }
@@ -559,7 +558,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
    }
 
    @Override
-   public boolean removeOutgoingInterceptor(final Interceptor interceptor) {
+   public boolean removeOutgoingInterceptor(final BaseInterceptor interceptor) {
       if (outgoingInterceptors.remove(interceptor)) {
          updateProtocols();
          return true;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fe16ffe0/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServiceRegistry.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServiceRegistry.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServiceRegistry.java
index 9cb1df1..dfa86b7 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServiceRegistry.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServiceRegistry.java
@@ -17,7 +17,6 @@
 package org.apache.activemq.artemis.core.server;
 
 import org.apache.activemq.artemis.api.core.BaseInterceptor;
-import org.apache.activemq.artemis.api.core.Interceptor;
 import org.apache.activemq.artemis.api.core.Pair;
 import org.apache.activemq.artemis.core.config.ConnectorServiceConfiguration;
 import org.apache.activemq.artemis.core.server.cluster.Transformer;
@@ -55,7 +54,7 @@ public interface ServiceRegistry {
     */
    Collection<Pair<ConnectorServiceFactory, ConnectorServiceConfiguration>> getConnectorServices(List<ConnectorServiceConfiguration> configs);
 
-   void addIncomingInterceptor(Interceptor interceptor);
+   void addIncomingInterceptor(BaseInterceptor interceptor);
 
    /**
     * Get a list of org.apache.activemq.artemis.api.core.BaseInterceptor instances
@@ -65,7 +64,7 @@ public interface ServiceRegistry {
     */
    List<BaseInterceptor> getIncomingInterceptors(List<String> classNames);
 
-   void addOutgoingInterceptor(Interceptor interceptor);
+   void addOutgoingInterceptor(BaseInterceptor interceptor);
 
    /**
     * Get a list of org.apache.activemq.artemis.api.core.BaseInterceptor instances

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fe16ffe0/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServiceRegistryImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServiceRegistryImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServiceRegistryImpl.java
index 715d92f..d00e15e 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServiceRegistryImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServiceRegistryImpl.java
@@ -17,7 +17,6 @@
 package org.apache.activemq.artemis.core.server.impl;
 
 import org.apache.activemq.artemis.api.core.BaseInterceptor;
-import org.apache.activemq.artemis.api.core.Interceptor;
 import org.apache.activemq.artemis.api.core.Pair;
 import org.apache.activemq.artemis.core.config.ConnectorServiceConfiguration;
 import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
@@ -118,7 +117,7 @@ public class ServiceRegistryImpl implements ServiceRegistry {
    }
 
    @Override
-   public void addIncomingInterceptor(Interceptor interceptor) {
+   public void addIncomingInterceptor(BaseInterceptor interceptor) {
       incomingInterceptors.add(interceptor);
    }
 
@@ -132,7 +131,7 @@ public class ServiceRegistryImpl implements ServiceRegistry {
    }
 
    @Override
-   public void addOutgoingInterceptor(Interceptor interceptor) {
+   public void addOutgoingInterceptor(BaseInterceptor interceptor) {
       outgoingInterceptors.add(interceptor);
    }
 


[4/4] activemq-artemis git commit: Improving into Stomp Embedded Interceptor example Using the regular maven plugin framework, and adding the interceptors to the regular broker.xml configuration

Posted by cl...@apache.org.
Improving into Stomp Embedded Interceptor example
Using the regular maven plugin framework, and adding the interceptors to the regular broker.xml configuration


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

Branch: refs/heads/master
Commit: 8bb3d1ceaa5bd1b3138286c1777805535428d9f2
Parents: 6496be5
Author: Clebert Suconic <cl...@apache.org>
Authored: Fri Sep 25 18:09:08 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Sep 25 18:09:12 2015 -0400

----------------------------------------------------------------------
 examples/protocols/stomp/pom.xml                |  2 +
 .../stomp/stomp-embedded-interceptor/pom.xml    | 38 ++++++++++
 .../artemis/jms/example/MyStompInterceptor.java | 39 ++++++++++
 .../artemis/jms/example/RegularInterceptor.java | 37 ++++++++++
 .../StompEmbeddedWithInterceptorExample.java    | 75 +++++++------------
 .../activemq/server0/artemis-roles.properties   | 17 +++++
 .../activemq/server0/artemis-users.properties   | 17 +++++
 .../main/resources/activemq/server0/broker.xml  | 76 ++++++++++++++++++++
 .../src/main/resources/broker.xml               | 48 -------------
 9 files changed, 252 insertions(+), 97 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8bb3d1ce/examples/protocols/stomp/pom.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/pom.xml b/examples/protocols/stomp/pom.xml
index 179b082..a4ccd18 100644
--- a/examples/protocols/stomp/pom.xml
+++ b/examples/protocols/stomp/pom.xml
@@ -45,6 +45,7 @@ under the License.
          <modules>
             <module>stomp</module>
             <module>stomp-websockets</module>
+            <module>stomp-embedded-interceptor</module>
             <module>stomp1.1</module>
             <module>stomp1.2</module>
          </modules>
@@ -53,6 +54,7 @@ under the License.
          <id>examples</id>
          <modules>
             <module>stomp</module>
+            <module>stomp-embedded-interceptor</module>
 
             <!-- has to be executed manually
             <module>stomp-websockets</module> -->

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8bb3d1ce/examples/protocols/stomp/stomp-embedded-interceptor/pom.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-embedded-interceptor/pom.xml b/examples/protocols/stomp/stomp-embedded-interceptor/pom.xml
index 22c726c..c8fd1d8 100644
--- a/examples/protocols/stomp/stomp-embedded-interceptor/pom.xml
+++ b/examples/protocols/stomp/stomp-embedded-interceptor/pom.xml
@@ -69,6 +69,32 @@ under the License.
             <artifactId>artemis-maven-plugin</artifactId>
             <executions>
                <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <!-- need to install the jar for interceptors on the server -->
+                     <libList><arg>org.apache.activemq.examples.stomp:stomp-embedded-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>
@@ -77,6 +103,18 @@ under the License.
                      <clientClass>org.apache.activemq.artemis.jms.example.StompEmbeddedWithInterceptorExample</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>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8bb3d1ce/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/MyStompInterceptor.java
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/MyStompInterceptor.java b/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/MyStompInterceptor.java
new file mode 100644
index 0000000..43b6633
--- /dev/null
+++ b/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/MyStompInterceptor.java
@@ -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.
+ */
+
+package org.apache.activemq.artemis.jms.example;
+
+import org.apache.activemq.artemis.api.core.ActiveMQException;
+import org.apache.activemq.artemis.core.protocol.stomp.StompConnection;
+import org.apache.activemq.artemis.core.protocol.stomp.StompFrame;
+import org.apache.activemq.artemis.core.protocol.stomp.StompFrameInterceptor;
+import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
+
+public class MyStompInterceptor implements StompFrameInterceptor {
+
+   public boolean intercept(StompFrame frame, RemotingConnection remotingConnection)
+      throws ActiveMQException {
+
+      StompConnection connection = (StompConnection) remotingConnection;
+
+      frame.addHeader("stompIntercepted", "Hello");
+
+      System.out.println("MyStompInterceptor Intercepted frame " + frame + " on connection " + connection);
+
+      return true;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8bb3d1ce/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/RegularInterceptor.java
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/RegularInterceptor.java b/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/RegularInterceptor.java
new file mode 100644
index 0000000..8457d68
--- /dev/null
+++ b/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/RegularInterceptor.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 org.apache.activemq.artemis.api.core.ActiveMQException;
+import org.apache.activemq.artemis.api.core.Interceptor;
+import org.apache.activemq.artemis.core.protocol.core.Packet;
+import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.MessagePacket;
+import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
+
+public class RegularInterceptor implements Interceptor {
+
+   @Override
+   public boolean intercept(Packet packet, RemotingConnection connection) throws ActiveMQException {
+      System.out.println("Regular Intercept on " + packet);
+      if (packet instanceof MessagePacket) {
+         MessagePacket messagePacket = (MessagePacket)packet;
+         messagePacket.getMessage().putStringProperty("regularIntercepted", "HelloAgain");
+      }
+      return true;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8bb3d1ce/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/StompEmbeddedWithInterceptorExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/StompEmbeddedWithInterceptorExample.java b/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/StompEmbeddedWithInterceptorExample.java
index e9a9156..420e66e 100644
--- a/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/StompEmbeddedWithInterceptorExample.java
+++ b/examples/protocols/stomp/stomp-embedded-interceptor/src/main/java/org/apache/activemq/artemis/jms/example/StompEmbeddedWithInterceptorExample.java
@@ -16,67 +16,24 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import org.apache.activemq.artemis.api.core.ActiveMQException;
-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.config.impl.SecurityConfiguration;
-import org.apache.activemq.artemis.core.protocol.stomp.StompConnection;
-import org.apache.activemq.artemis.core.protocol.stomp.StompFrame;
-import org.apache.activemq.artemis.core.protocol.stomp.StompFrameInterceptor;
-import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
-import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
-import org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfiguration;
-import org.apache.activemq.artemis.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
-import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
-import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;
-
 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 java.io.OutputStream;
 import java.net.Socket;
 import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.HashSet;
+
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
 /**
  * This example demonstrates how to run an ActiveMQ Artemis embedded with JMS
  */
 public class StompEmbeddedWithInterceptorExample {
 
-   public static class MyStompInterceptor
-      implements StompFrameInterceptor {
-
-      public boolean intercept(StompFrame frame, RemotingConnection remotingConnection)
-         throws ActiveMQException {
-
-         StompConnection connection = (StompConnection) remotingConnection;
-
-         System.out.println("Intercepted frame " + frame + " on connection " + connection);
-
-         return false;
-      }
-   }
-
    private static final String END_OF_FRAME = "\u0000";
 
    public static void main(final String[] args) throws Exception {
-      EmbeddedJMS jmsServer = new EmbeddedJMS(); 
-      String brokerConfigPath = StompEmbeddedWithInterceptorExample.class.getResource("/broker.xml").toString();
-      jmsServer.setConfigResourcePath(brokerConfigPath);
-
-      jmsServer.start();
-      jmsServer.getActiveMQServer().getRemotingService().addIncomingInterceptor(new MyStompInterceptor());
-
-      System.out.println("Started Embedded JMS Server");
-
       // Step 1. Create a TCP socket to connect to the Stomp port
       Socket socket = new Socket("localhost", 61616);
 
@@ -95,7 +52,7 @@ public class StompEmbeddedWithInterceptorExample {
       // jms.queue.exampleQueue address with a text body
       String text = "Hello World from Stomp 1.2 !";
       String message = "SEND\n" +
-         "destination:jms.queue.exampleQueue\n" +
+         "destination:jms.queue.exampleQueue" +
          "\n" +
          text +
          END_OF_FRAME;
@@ -111,8 +68,28 @@ public class StompEmbeddedWithInterceptorExample {
       // Step 5. Slose the TCP socket
       socket.close();
 
-      Thread.sleep(1000);
-      jmsServer.stop();
+
+      // It will use a regular JMS connection to show how the injected data will appear at the final message
+
+      ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
+      Connection connection = factory.createConnection();
+      Session session = connection.createSession();
+      connection.start();
+
+      MessageConsumer consumer = session.createConsumer(session.createQueue("exampleQueue"));
+      Message messageReceived = consumer.receive(5000);
+
+      String propStomp = messageReceived.getStringProperty("stompIntercepted");
+
+      String propRegular = messageReceived.getStringProperty("regularIntercepted");
+
+      System.out.println("propStomp is Hello!! - " + propStomp.equals("Hello"));
+      System.out.println("propRegular is HelloAgain!! - " + propRegular.equals("HelloAgain"));
+
+      session.close();
+      connection.close();
+
+      factory.close();
    }
 
    private static void sendFrame(Socket socket, String data) throws Exception {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8bb3d1ce/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/activemq/server0/artemis-roles.properties b/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/activemq/server0/artemis-roles.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/protocols/stomp/stomp-embedded-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/8bb3d1ce/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/activemq/server0/artemis-users.properties b/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/activemq/server0/artemis-users.properties
new file mode 100644
index 0000000..4e2d44c
--- /dev/null
+++ b/examples/protocols/stomp/stomp-embedded-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/8bb3d1ce/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/activemq/server0/broker.xml b/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..132bcec
--- /dev/null
+++ b/examples/protocols/stomp/stomp-embedded-interceptor/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/bindings</bindings-directory>
+
+      <journal-directory>./data/journal</journal-directory>
+
+      <large-messages-directory>./data/largemessages</large-messages-directory>
+
+      <paging-directory>./data/paging</paging-directory>
+
+      <queues>
+         <queue name="jms">
+            <address></address>
+         </queue>
+      </queues>
+
+
+      <remoting-incoming-interceptors>
+         <class-name>org.apache.activemq.artemis.jms.example.MyStompInterceptor</class-name>
+         <class-name>org.apache.activemq.artemis.jms.example.RegularInterceptor</class-name>
+      </remoting-incoming-interceptors>
+
+      <remoting-outgoing-interceptors>
+         <class-name>org.apache.activemq.artemis.jms.example.RegularInterceptor</class-name>
+      </remoting-outgoing-interceptors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</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/8bb3d1ce/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/broker.xml b/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/broker.xml
deleted file mode 100644
index 474a897..0000000
--- a/examples/protocols/stomp/stomp-embedded-interceptor/src/main/resources/broker.xml
+++ /dev/null
@@ -1,48 +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>
-
-      <acceptors>
-        <acceptor name="artemis">tcp://127.0.0.1:61616?protocols=STOMP</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>