You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2015/08/13 06:13:55 UTC
[37/48] activemq-artemis git commit: renaming broker-features ->
features on examples
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 2b2ba2e..0000000
--- a/examples/broker-features/standard/durable-subscription/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version='1.0'?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="urn:activemq"
- xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
- <jms xmlns="urn:activemq:jms">
- <!--the topic used by the example-->
- <topic name="exampleTopic"/>
- </jms>
-
- <core xmlns="urn:activemq:core">
-
- <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
-
- <journal-directory>${data.dir:../data}/journal</journal-directory>
-
- <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
- <paging-directory>${data.dir:../data}/paging</paging-directory>
-
- <!-- Acceptors -->
-
- <acceptors>
- <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
- </acceptors>
-
- <!-- Other config -->
-
- <security-settings>
- <!--security for example topic-->
- <security-setting match="jms.topic.exampleTopic">
- <permission type="createDurableQueue" roles="guest"/>
- <permission type="deleteDurableQueue" roles="guest"/>
- <permission type="createNonDurableQueue" roles="guest"/>
- <permission type="deleteNonDurableQueue" roles="guest"/>
- <permission type="consume" roles="guest"/>
- <permission type="send" roles="guest"/>
- </security-setting>
- </security-settings>
-
- </core>
-</configuration>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/durable-subscription/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/durable-subscription/src/main/resources/jndi.properties b/examples/broker-features/standard/durable-subscription/src/main/resources/jndi.properties
deleted file mode 100644
index 54bed6d..0000000
--- a/examples/broker-features/standard/durable-subscription/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-topic.topic/exampleTopic=exampleTopic
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/embedded-simple/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/embedded-simple/pom.xml b/examples/broker-features/standard/embedded-simple/pom.xml
deleted file mode 100644
index 8ffd616..0000000
--- a/examples/broker-features/standard/embedded-simple/pom.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version='1.0'?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.activemq.examples.broker</groupId>
- <artifactId>jms-examples</artifactId>
- <version>1.0.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>embedded-simple</artifactId>
- <packaging>jar</packaging>
- <name>ActiveMQ Artemis JMS Simple Embedded Example</name>
-
- <properties>
- <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-jms-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-jms-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>runClient</id>
- <goals>
- <goal>runClient</goal>
- </goals>
- <configuration>
- <clientClass>org.apache.activemq.artemis.jms.example.EmbeddedExample</clientClass>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq.examples.broker</groupId>
- <artifactId>embedded-simple</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/embedded-simple/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/embedded-simple/readme.html b/examples/broker-features/standard/embedded-simple/readme.html
deleted file mode 100644
index 1bbd7aa..0000000
--- a/examples/broker-features/standard/embedded-simple/readme.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<html>
- <head>
- <title>ActiveMQ Artemis Embedded JMS Server Example</title>
- <link rel="stylesheet" type="text/css" href="../../../common/common.css" />
- <link rel="stylesheet" type="text/css" href="../../../common/prettify.css" />
- <script type="text/javascript" src="../../../common/prettify.js"></script>
- </head>
- <body onload="prettyPrint()">
- <h1>Embedded JMS Server Example</h1>
-
- <p>This examples shows how to setup and run an embedded JMS server using ActiveMQ Artemis along with ActiveMQ Artemis configuration files.</p>
-
- <h2>Example step-by-step</h2>
- <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
- <ol>
- <li>Create ActiveMQ Artemis core configuration files and make sure they are within your classpath. By default, ActiveMQ
- expects the configuration file name to be "broker.xml".</li>
- <li>Create an embedded ActiveMQ Artemis JMS server</li>
- <pre class="prettyprint">
- <code>EmbeddedJMS jmsServer = new EmbeddedJMS();</code>
- </pre>
-
- <li>Setup security configurations</li>
- <pre class="prettyprint">
- <code>SecurityConfiguration securityConfig = new SecurityConfiguration();
- securityConfig.addUser("guest", "guest");
- securityConfig.addRole("guest", "guest");
- securityConfig.setDefaultUser("guest");
- jmsServer.setSecurityManager(new ActiveMQSecurityManagerImpl(securityConfig));</code>
- </pre>
-
- <li>Start the embedded ActiveMQ Artemis JMS server</li>
- <pre class="prettyprint">
- <code>jmsServer.start()</code>
- </pre>
-
- <li>Create JMS resources (connection factory and queue) for the example</li>
- <pre class="prettyprint">
- <code>JMSServerManager jmsServerManager = jmsServer.getJMSServerManager();
- List<String> connectors = new ArrayList<String>();
- connectors.add("in-vm");
- jmsServerManager.createConnectionFactory("ConnectionFactory", false, JMSFactoryType.CF, connectors, "ConnectionFactory");
- jmsServerManager.createQueue(false, "exampleQueue", null, false, "queue/exampleQueue");</code>
- </pre>
-
- <p>At this point the JMS server is started and any JMS clients can look up JMS resources from the JNDI to send/receive
- messages from the server. To keep the example simple, we will send and receive a JMS message from the same JVM
- used to run the JMS server.</p>
-
- <li>Lookup JMS resources defined in the configuration </li>
- <pre class="prettyprint">
- <code>ConnectionFactory cf = (ConnectionFactory)jmsServer.lookup("ConnectionFactory");
- Queue queue = (Queue)jmsServer.lookup("queue/exampleQueue");</code>
- </pre>
-
- <li>Send and receive a message using JMS API</li>
- <p>See the <a href="../queue/readme.html">Queue Example</a> for detailed steps to send and receive a JMS message</p>
-
- <p>Finally, we stop the JMS server and its associated resources.</p>
-
- <li>Close the connection</li>
- <pre class="prettyprint">
- <code>if (connection != null)
- {
- connection.close();
- }</code>
- </pre>
-
- <li>Stop the JMS server</li>
- <pre class="prettyprint">
- <code>jmsServer.stop();</code>
- </pre>
-
- </ol>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java b/examples/broker-features/standard/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
deleted file mode 100644
index 7d00c7e..0000000
--- a/examples/broker-features/standard/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.jms.example;
-
-import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
-import org.apache.activemq.artemis.jms.server.JMSServerManager;
-import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
-import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-/**
- * This example demonstrates how to run an ActiveMQ Artemis embedded with JMS
- */
-public class EmbeddedExample {
-
- public static void main(final String[] args) throws Exception {
- EmbeddedJMS jmsServer = new EmbeddedJMS();
-
- SecurityConfiguration securityConfig = new SecurityConfiguration();
- securityConfig.addUser("guest", "guest");
- securityConfig.addRole("guest", "guest");
- securityConfig.setDefaultUser("guest");
- jmsServer.setSecurityManager(new ActiveMQSecurityManagerImpl(securityConfig));
-
- jmsServer.start();
- System.out.println("Started Embedded JMS Server");
-
- JMSServerManager jmsServerManager = jmsServer.getJMSServerManager();
- List<String> connectors = new ArrayList<String>();
- connectors.add("in-vm");
- jmsServerManager.createConnectionFactory("ConnectionFactory", false, JMSFactoryType.CF, connectors, "ConnectionFactory");
- jmsServerManager.createQueue(false, "exampleQueue", null, false, "queue/exampleQueue");
-
- ConnectionFactory cf = (ConnectionFactory) jmsServer.lookup("ConnectionFactory");
- Queue queue = (Queue) jmsServer.lookup("queue/exampleQueue");
-
- // Step 10. Send and receive a message using JMS API
- Connection connection = null;
- try {
- connection = cf.createConnection();
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- MessageProducer producer = session.createProducer(queue);
- TextMessage message = session.createTextMessage("Hello sent at " + new Date());
- System.out.println("Sending message: " + message.getText());
- producer.send(message);
- MessageConsumer messageConsumer = session.createConsumer(queue);
- connection.start();
- TextMessage messageReceived = (TextMessage) messageConsumer.receive(1000);
- System.out.println("Received message:" + messageReceived.getText());
- }
- finally {
- if (connection != null) {
- connection.close();
- }
-
- // Step 11. Stop the JMS server
- jmsServer.stop();
- System.out.println("Stopped the JMS Server");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/embedded-simple/src/main/resources/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/embedded-simple/src/main/resources/broker.xml b/examples/broker-features/standard/embedded-simple/src/main/resources/broker.xml
deleted file mode 100644
index 0448e3b..0000000
--- a/examples/broker-features/standard/embedded-simple/src/main/resources/broker.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version='1.0'?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="urn:activemq"
- xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
- <core xmlns="urn:activemq:core">
-
- <persistence-enabled>false</persistence-enabled>
-
- <connectors>
- <connector name="in-vm">vm://0</connector>
- </connectors>
-
- <acceptors>
- <acceptor name="in-vm">vm://0</acceptor>
- </acceptors>
-
- <!-- Other config -->
-
- <security-settings>
- <!--security for example queue-->
- <security-setting match="#">
- <permission type="createDurableQueue" roles="guest"/>
- <permission type="deleteDurableQueue" roles="guest"/>
- <permission type="createNonDurableQueue" roles="guest"/>
- <permission type="deleteNonDurableQueue" roles="guest"/>
- <permission type="consume" roles="guest"/>
- <permission type="send" roles="guest"/>
- </security-setting>
- </security-settings>
-
- </core>
-</configuration>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/embedded/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/embedded/pom.xml b/examples/broker-features/standard/embedded/pom.xml
deleted file mode 100644
index ee576c4..0000000
--- a/examples/broker-features/standard/embedded/pom.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version='1.0'?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.activemq.examples.broker</groupId>
- <artifactId>jms-examples</artifactId>
- <version>1.0.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>embedded</artifactId>
- <packaging>jar</packaging>
- <name>ActiveMQ Artemis JMS Embedded Example</name>
-
- <properties>
- <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-jms-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-jms-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>runClient</id>
- <goals>
- <goal>runClient</goal>
- </goals>
- <configuration>
- <clientClass>org.apache.activemq.artemis.jms.example.EmbeddedExample</clientClass>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq.examples.broker</groupId>
- <artifactId>embedded</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/embedded/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/embedded/readme.html b/examples/broker-features/standard/embedded/readme.html
deleted file mode 100644
index 2da6ef7..0000000
--- a/examples/broker-features/standard/embedded/readme.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<html>
- <head>
- <title>ActiveMQ Artemis Embedded JMS Server Example</title>
- <link rel="stylesheet" type="text/css" href="../../../common/common.css" />
- <link rel="stylesheet" type="text/css" href="../../../common/prettify.css" />
- <script type="text/javascript" src="../../../common/prettify.js"></script>
- </head>
- <body onload="prettyPrint()">
- <h1>Embedded JMS Server Example</h1>
- <pre>To run the example, simply type <b>mvn verify</b> from this directory</pre>
-
- <p>This examples shows how to setup and run an embedded JMS server using ActiveMQ Artemis.</p>
- <p>ActiveMQ Artemis was designed using POJOs (Plain Old Java Objects) which means embedding ActiveMQ Artemis in your own application
- is as simple as instantiating a few objects.</p>
- <p>This example does not use any configuration files. The server is configured using POJOs and can be easily ported to any dependency injection framework.<br />
- We will setup and run a full-fledged JMS server which binds its JMS resources to JNDI and can be accessed by remote clients.</p>
-
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java b/examples/broker-features/standard/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
deleted file mode 100644
index cb39fd0..0000000
--- a/examples/broker-features/standard/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.jms.example;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import java.util.ArrayList;
-import java.util.Date;
-
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
-import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
-import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
-import org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfiguration;
-import org.apache.activemq.artemis.jms.server.config.JMSConfiguration;
-import org.apache.activemq.artemis.jms.server.config.JMSQueueConfiguration;
-import org.apache.activemq.artemis.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
-import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl;
-import org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationImpl;
-import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
-
-/**
- * This example demonstrates how to run an ActiveMQ Artemis embedded with JMS
- */
-public final class EmbeddedExample {
-
- public static void main(final String[] args) throws Exception {
- // Step 1. Create ActiveMQ Artemis core configuration, and set the properties accordingly
- Configuration configuration = new ConfigurationImpl();
- configuration.setPersistenceEnabled(false);
- configuration.setJournalDirectory("target/data/journal");
- configuration.setSecurityEnabled(false);
- configuration.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
-
- TransportConfiguration connectorConfig = new TransportConfiguration(NettyConnectorFactory.class.getName());
-
- configuration.getConnectorConfigurations().put("connector", connectorConfig);
-
- // Step 2. Create the JMS configuration
- JMSConfiguration jmsConfig = new JMSConfigurationImpl();
-
- // Step 3. Configure the JMS ConnectionFactory
- ArrayList<String> connectorNames = new ArrayList<String>();
- connectorNames.add("connector");
- ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl().setName("cf").setConnectorNames(connectorNames).setBindings("cf");
- jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);
-
- // Step 4. Configure the JMS Queue
- JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl().setName("queue1").setDurable(false).setBindings("queue/queue1");
- jmsConfig.getQueueConfigurations().add(queueConfig);
-
- // Step 5. Start the JMS Server using the ActiveMQ Artemis core server and the JMS configuration
- EmbeddedJMS jmsServer = new EmbeddedJMS();
- jmsServer.setConfiguration(configuration);
- jmsServer.setJmsConfiguration(jmsConfig);
- jmsServer.start();
- System.out.println("Started Embedded JMS Server");
-
- // Step 6. Lookup JMS resources defined in the configuration
- ConnectionFactory cf = (ConnectionFactory) jmsServer.lookup("cf");
- Queue queue = (Queue) jmsServer.lookup("queue/queue1");
-
- // Step 7. Send and receive a message using JMS API
- Connection connection = null;
- try {
- connection = cf.createConnection();
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- MessageProducer producer = session.createProducer(queue);
- TextMessage message = session.createTextMessage("Hello sent at " + new Date());
- System.out.println("Sending message: " + message.getText());
- producer.send(message);
- MessageConsumer messageConsumer = session.createConsumer(queue);
- connection.start();
- TextMessage messageReceived = (TextMessage) messageConsumer.receive(1000);
- System.out.println("Received message:" + messageReceived.getText());
- }
- finally {
- if (connection != null) {
- connection.close();
- }
-
- // Step 11. Stop the JMS server
- jmsServer.stop();
- System.out.println("Stopped the JMS Server");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/expiry/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/expiry/pom.xml b/examples/broker-features/standard/expiry/pom.xml
deleted file mode 100644
index 983cc32..0000000
--- a/examples/broker-features/standard/expiry/pom.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version='1.0'?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.activemq.examples.broker</groupId>
- <artifactId>jms-examples</artifactId>
- <version>1.0.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>expiry</artifactId>
- <packaging>jar</packaging>
- <name>ActiveMQ Artemis JMS Expiry Example</name>
-
- <properties>
- <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-jms-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>create</id>
- <goals>
- <goal>create</goal>
- </goals>
- <configuration>
- <ignore>${noServer}</ignore>
- <configuration>${basedir}/target/classes/activemq/server0</configuration>
- </configuration>
- </execution>
- <execution>
- <id>start</id>
- <goals>
- <goal>cli</goal>
- </goals>
- <configuration>
- <ignore>${noServer}</ignore>
- <spawn>true</spawn>
- <testURI>tcp://localhost:61616</testURI>
- <args>
- <param>run</param>
- </args>
- </configuration>
- </execution>
- <execution>
- <id>runClient</id>
- <goals>
- <goal>runClient</goal>
- </goals>
- <configuration>
- <clientClass>org.apache.activemq.artemis.jms.example.ExpiryExample</clientClass>
- </configuration>
- </execution>
- <execution>
- <id>stop</id>
- <goals>
- <goal>cli</goal>
- </goals>
- <configuration>
- <ignore>${noServer}</ignore>
- <args>
- <param>stop</param>
- </args>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq.examples.broker</groupId>
- <artifactId>expiry</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/expiry/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/expiry/readme.html b/examples/broker-features/standard/expiry/readme.html
deleted file mode 100644
index d13cac0..0000000
--- a/examples/broker-features/standard/expiry/readme.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<html>
- <head>
- <title>ActiveMQ Artemis Message Expiration Example</title>
- <link rel="stylesheet" type="text/css" href="../../../common/common.css" />
- <link rel="stylesheet" type="text/css" href="../../../common/prettify.css" />
- <script type="text/javascript" src="../../../common/prettify.js"></script>
- </head>
- <body onload="prettyPrint()">
- <h1>JMS Expiration Example</h1>
- <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
-
- <p>This example shows you how to configure ActiveMQ Artemis so messages are expipired after a certain time.</p>
- <p>Messages can be retained in the messaging system for a limited period of time before being removed.
- JMS specification states that clients should not receive messages that have been expired (but it does not guarantee this will not happen).</p>
- <p>ActiveMQ Artemis can assign a <em>expiry address</em> to a given queue so that when messages are expired, they are removed from the queue and
- routed to this address. These "expired" messages can later be consumed for further inspection.
- <p>
- The example will send 1 message with a short <em>time-to-live</em> to a queue. We will wait for the message to expire and checks that the message
- is no longer in the queue it was sent to.
- We will instead consume it from an <em>expiry queue</em> where it was moved when it expired.
- </p>
- <h2>Example setup</h2>
- <p>Expiry destinations are defined in the configuration file <a href="server0/broker.xml">broker.xml</a>:</p>
- <pre class="prettyprint">
- <code><address-setting match="jms.queue.exampleQueue">
- <expiry-address>jms.queue.expiryQueue</expiry-address>
- </address-setting>
- </code>
- </pre>
- <p>This configuration will moved expired messages from the <code>exampleQueue</code> to the <code>expiryQueue</code></p>
- <p>ActiveMQ Artemis allows to specify either a <code>Queue</code> by prefixing the <code>expiry-address</code> with <code>jms.queue.</code>
- or a <code>Topic</code> by prefixing with <code>jms.topic.</code>.<br />
- In this example, we will use a <code>Queue</code> to hold the expired messages.</p>
- <p>Since we want to consume messages from this expiryQueue, we also need to add a JNDI binding to perform a lookup.
- This is configured in <a href="server0/activemq-jms.xml">activemq-jms.xml</a></p>
- <pre class="prettyprint">
- <code><queue name="expiryQueue">
- <entry name="/queue/expiryQueue"/>
- </queue></code>
- </pre>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java b/examples/broker-features/standard/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java
deleted file mode 100644
index 996da74..0000000
--- a/examples/broker-features/standard/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.jms.example;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-/**
- * An example showing how messages are moved to an expiry queue when they expire.
- */
-public class ExpiryExample {
-
- public static void main(final String[] args) throws Exception {
- Connection connection = null;
- InitialContext initialContext = null;
- try {
- // Step 1. Create an initial context to perform the JNDI lookup.
- initialContext = new InitialContext();
-
- // Step 2. Perfom a lookup on the queue
- Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
-
- // Step 3. Perform a lookup on the Connection Factory
- ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
-
- // Step 4.Create a JMS Connection
- connection = cf.createConnection();
-
- // Step 5. Create a JMS Session
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Step 6. Create a JMS Message Producer
- MessageProducer producer = session.createProducer(queue);
-
- // Step 7. Messages sent by this producer will be retained for 1s (1000ms) before expiration
- producer.setTimeToLive(1000);
-
- // Step 8. Create a Text Message
- TextMessage message = session.createTextMessage("this is a text message");
-
- // Step 9. Send the Message
- producer.send(message);
- System.out.println("Sent message to " + queue.getQueueName() + ": " + message.getText());
-
- // Step 10. Sleep for 5s. Once we wake up, the message will have been expired
- System.out.println("Sleep a little bit to let the message expire...");
- Thread.sleep(5000);
-
- // Step 11. Create a JMS Message Consumer for the queue
- MessageConsumer messageConsumer = session.createConsumer(queue);
-
- // Step 12. Start the Connection
- connection.start();
-
- // Step 13. Trying to receive a message. Since there is none on the queue, the call will timeout after 5000ms
- // and messageReceived will be null
- TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
- System.out.println("Received message from " + queue.getQueueName() + ": " + messageReceived);
-
- // Step 14. Perfom a lookup on the expiry queue
- Queue expiryQueue = (Queue) initialContext.lookup("queue/expiryQueue");
-
- // Step 15. Create a JMS Message Consumer for the expiry queue
- MessageConsumer expiryConsumer = session.createConsumer(expiryQueue);
-
- // Step 16. Receive the message from the expiry queue
- messageReceived = (TextMessage) expiryConsumer.receive(5000);
-
- // Step 17. The message sent to the queue was moved to the expiry queue when it expired.
- System.out.println("Received message from " + expiryQueue.getQueueName() + ": " + messageReceived.getText());
-
- // The message received from the expiry queue has the same content than the expired message but its JMS headers
- // differ
- // (from JMS point of view, it's not the same message).
- // ActiveMQ Artemis defines additional properties to correlate the message received from the expiry queue with the
- // message expired from the queue
-
- System.out.println();
- // Step 18. the messageReceived's destination is now the expiry queue.
- System.out.println("Destination of the expired message: " + ((Queue) messageReceived.getJMSDestination()).getQueueName());
- // Step 19. and its own expiration (the time to live in the *expiry* queue)
- System.out.println("Expiration time of the expired message (relative to the expiry queue): " + messageReceived.getJMSExpiration());
-
- System.out.println();
- // Step 20. the *origin* destination is stored in the _AMQ_ORIG_ADDRESS property
- System.out.println("*Origin destination* of the expired message: " + messageReceived.getStringProperty("_AMQ_ORIG_ADDRESS"));
- // Step 21. the actual expiration time is stored in the _AMQ_ACTUAL_EXPIRY property
- System.out.println("*Actual expiration time* of the expired message: " + messageReceived.getLongProperty("_AMQ_ACTUAL_EXPIRY"));
- }
- finally {
- // Step 22. Be sure to close the resources!
- if (initialContext != null) {
- initialContext.close();
- }
- if (connection != null) {
- connection.close();
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/artemis-roles.properties b/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/artemis-roles.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements. See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License. You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/artemis-users.properties b/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/artemis-users.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements. See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License. You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 4907097..0000000
--- a/examples/broker-features/standard/expiry/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version='1.0'?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="urn:activemq"
- xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
- <jms xmlns="urn:activemq:jms">
- <!--the queue used by the example-->
- <queue name="exampleQueue"/>
-
- <!--the expiry queue where expired messages will be sent-->
- <queue name="expiryQueue"/>
- </jms>
-
- <core xmlns="urn:activemq:core">
-
- <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
-
- <journal-directory>${data.dir:../data}/journal</journal-directory>
-
- <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
- <paging-directory>${data.dir:../data}/paging</paging-directory>
-
- <!-- Acceptors -->
- <acceptors>
- <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
- </acceptors>
-
- <!-- Other config -->
-
- <security-settings>
- <!--security for example queue-->
- <security-setting match="jms.#">
- <permission type="createDurableQueue" roles="guest"/>
- <permission type="deleteDurableQueue" roles="guest"/>
- <permission type="createNonDurableQueue" roles="guest"/>
- <permission type="deleteNonDurableQueue" roles="guest"/>
- <permission type="consume" roles="guest"/>
- <permission type="send" roles="guest"/>
- </security-setting>
- </security-settings>
-
- <address-settings>
- <!--override the expiry address for the example-->
- <address-setting match="jms.queue.exampleQueue">
- <expiry-address>jms.queue.expiryQueue</expiry-address>
- </address-setting>
- </address-settings>
-
- </core>
-</configuration>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/expiry/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/expiry/src/main/resources/jndi.properties b/examples/broker-features/standard/expiry/src/main/resources/jndi.properties
deleted file mode 100644
index 231fa30..0000000
--- a/examples/broker-features/standard/expiry/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-queue.queue/exampleQueue=exampleQueue
-queue.queue/expiryQueue=expiryQueue
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/http-transport/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/http-transport/pom.xml b/examples/broker-features/standard/http-transport/pom.xml
deleted file mode 100644
index cfea5ef..0000000
--- a/examples/broker-features/standard/http-transport/pom.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version='1.0'?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.activemq.examples.broker</groupId>
- <artifactId>jms-examples</artifactId>
- <version>1.0.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>http-transport</artifactId>
- <packaging>jar</packaging>
- <name>ActiveMQ Artemis JMS Http Transport Example</name>
-
- <properties>
- <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-jms-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>create</id>
- <goals>
- <goal>create</goal>
- </goals>
- <configuration>
- <ignore>${noServer}</ignore>
- <configuration>${basedir}/target/classes/activemq/server0</configuration>
- </configuration>
- </execution>
- <execution>
- <id>start</id>
- <goals>
- <goal>cli</goal>
- </goals>
- <configuration>
- <ignore>${noServer}</ignore>
- <spawn>true</spawn>
- <testURI>tcp://localhost:8080?http-enabled=true</testURI>
- <args>
- <param>run</param>
- </args>
- </configuration>
- </execution>
- <execution>
- <id>runClient</id>
- <goals>
- <goal>runClient</goal>
- </goals>
- <configuration>
- <clientClass>org.apache.activemq.artemis.jms.example.HttpTransportExample</clientClass>
- </configuration>
- </execution>
- <execution>
- <id>stop</id>
- <goals>
- <goal>cli</goal>
- </goals>
- <configuration>
- <ignore>${noServer}</ignore>
- <args>
- <param>stop</param>
- </args>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq.examples.broker</groupId>
- <artifactId>http-transport</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/http-transport/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/http-transport/readme.html b/examples/broker-features/standard/http-transport/readme.html
deleted file mode 100644
index 061c939..0000000
--- a/examples/broker-features/standard/http-transport/readme.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<html>
- <head>
- <title>ActiveMQ Artemis JMS HTTP Transport Example</title>
- <link rel="stylesheet" type="text/css" href="../../../common/common.css" />
- <link rel="stylesheet" type="text/css" href="../../../common/prettify.css" />
- <script type="text/javascript" src="../../../common/prettify.js"></script>
- </head>
- <body onload="prettyPrint()">
- <h1>JMS HTTP Example</h1>
-
-
- <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
-
- <p>This example shows you how to configure ActiveMQ Artemis to use the HTTP protocol as its transport layer.</p>
-
- <p>ActiveMQ Artemis supports a variety of network protocols to be its underlying transport without any specific code change.</p>
-
- <p>This example is taken from the queue example without any code change. By changing the configuration file, one can get ActiveMQ Artemis working with HTTP transport.</p>
- <p>All you need to do is open the server0/broker.xml and enable HTTP like the following</p>
-
-
- <pre class="prettyprint">
- <code>
- <connector name="netty-connector">tcp://localhost:8080?httpEnabled=true</connector>
-
- <!-- Acceptors -->
-
- <acceptor name="netty-acceptor">tcp://localhost:8080 </acceptor>
- </code>
- </pre>
-
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java b/examples/broker-features/standard/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java
deleted file mode 100644
index 265f0c6..0000000
--- a/examples/broker-features/standard/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.jms.example;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * A simple JMS Queue example that uses HTTP protocol.
- */
-public class HttpTransportExample {
-
- public static void main(final String[] args) throws Exception {
- Connection connection = null;
- try {
- // Step 2. Perfom a lookup on the queue
- Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
- // Step 3. Perform a lookup on the Connection Factory
- ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:8080?http-enabled=true");
-
- // Step 4.Create a JMS Connection
- connection = cf.createConnection();
-
- System.out.println("connection created: " + connection);
-
- // Step 5. Create a JMS Session
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Step 6. Create a JMS Message Producer
- MessageProducer producer = session.createProducer(queue);
-
- // Step 7. Create a Text Message
- TextMessage message = session.createTextMessage("This is a text message");
-
- System.out.println("Sent message: " + message.getText());
-
- // Step 8. Send the Message
- producer.send(message);
-
- // Step 9. Create a JMS Message Consumer
- MessageConsumer messageConsumer = session.createConsumer(queue);
-
- // Step 10. Start the Connection
- connection.start();
-
- // Step 11. Receive the message
- TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-
- System.out.println("Received message: " + messageReceived.getText());
-
- }
- finally {
- if (connection != null) {
- connection.close();
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/artemis-roles.properties b/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/artemis-roles.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements. See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License. You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/artemis-users.properties b/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/artemis-users.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements. See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License. You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/broker.xml b/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index d1a4d2a..0000000
--- a/examples/broker-features/standard/http-transport/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version='1.0'?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="urn:activemq"
- xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
- <jms xmlns="urn:activemq:jms">
- <!--the queue used by the example-->
- <queue name="exampleQueue"/>
- </jms>
-
- <core xmlns="urn:activemq:core">
-
- <bindings-directory>./data/bindings</bindings-directory>
-
- <journal-directory>./data/journal</journal-directory>
-
- <large-messages-directory>./data/largemessages</large-messages-directory>
-
- <paging-directory>./data/paging</paging-directory>
-
- <!-- Acceptors -->
-
- <acceptors>
- <acceptor name="netty-acceptor">tcp://localhost:8080</acceptor>
- </acceptors>
-
- <!-- Other config -->
-
- <security-settings>
- <!--security for example queue-->
- <security-setting match="jms.queue.exampleQueue">
- <permission type="createDurableQueue" roles="guest"/>
- <permission type="deleteDurableQueue" roles="guest"/>
- <permission type="createNonDurableQueue" roles="guest"/>
- <permission type="deleteNonDurableQueue" roles="guest"/>
- <permission type="consume" roles="guest"/>
- <permission type="send" roles="guest"/>
- </security-setting>
- </security-settings>
-
- </core>
-</configuration>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/instantiate-connection-factory/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/instantiate-connection-factory/pom.xml b/examples/broker-features/standard/instantiate-connection-factory/pom.xml
deleted file mode 100644
index ac6024b..0000000
--- a/examples/broker-features/standard/instantiate-connection-factory/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version='1.0'?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.activemq.examples.broker</groupId>
- <artifactId>jms-examples</artifactId>
- <version>1.0.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>instantiate-connection-factory</artifactId>
- <packaging>jar</packaging>
- <name>ActiveMQ Artemis JMS Instantiate Connection Factory Example</name>
-
- <properties>
- <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
- </properties>
-
-
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-jms-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>create</id>
- <goals>
- <goal>create</goal>
- </goals>
- <configuration>
- <ignore>${noServer}</ignore>
- </configuration>
- </execution>
- <execution>
- <id>start</id>
- <goals>
- <goal>cli</goal>
- </goals>
- <configuration>
- <ignore>${noServer}</ignore>
- <spawn>true</spawn>
- <testURI>tcp://localhost:61616</testURI>
- <args>
- <param>run</param>
- </args>
- </configuration>
- </execution>
- <execution>
- <id>runClient</id>
- <goals>
- <goal>runClient</goal>
- </goals>
- <configuration>
- <clientClass>org.apache.activemq.artemis.jms.example.InstantiateConnectionFactoryExample
- </clientClass>
- </configuration>
- </execution>
- <execution>
- <id>stop</id>
- <goals>
- <goal>cli</goal>
- </goals>
- <configuration>
- <ignore>${noServer}</ignore>
- <args>
- <param>stop</param>
- </args>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq.examples.broker</groupId>
- <artifactId>instantiate-connection-factory</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/instantiate-connection-factory/readme.html
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/instantiate-connection-factory/readme.html b/examples/broker-features/standard/instantiate-connection-factory/readme.html
deleted file mode 100644
index b084471..0000000
--- a/examples/broker-features/standard/instantiate-connection-factory/readme.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<html>
- <head>
- <title>ActiveMQ Artemis JMS Instantiate Connection Factory Example</title>
- <link rel="stylesheet" type="text/css" href="../../../common/common.css" />
- <link rel="stylesheet" type="text/css" href="../../../common/prettify.css" />
- <script type="text/javascript" src="../../../common/prettify.js"></script>
- </head>
- <body onload="prettyPrint()">
- <h1>JMS Instantiate Connection Factory Example</h1>
-
- <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
-
- <p>Usually, JMS Objects such as ConnectionFactories, Queue and Topic instances are looked up from JNDI
- before being used by the client code. This objects are called "administered objects" in JMS specification
- terminology.</p>
- <p>However, in some cases a JNDI server may not be available or desired. To come to the rescue ActiveMQ
- also supports the direct instantiation of these administered objects on the client side.</p>
- <p>This allows the full set of JMS functionality to be available without requiring a JNDI server!</p>
- <p>This example is very simple and based on the simple Queue example, however in this example we
- instantiate the JMS Queue and ConnectionFactory objects directly.</p>
- <p>A wide variety of methods are available for instantiating ConnectionFactory objects. In this example
- we use a simple method which just takes the server connection details so it knows where to make the
- connection to.</p>
- <p>Other methods are available so all the connection factory parameters can be specified
- including specifying UDP discovery so the client does not need hard-wired knowledge of where the servers
- are that it wishes to connect to, or for specifying live-backup pairs of servers for failover.</p>
- <p>For more information on instantiating ConnectionFactories directly please consult the user manual and
- javadoc.</p>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java b/examples/broker-features/standard/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
deleted file mode 100644
index 47bc66c..0000000
--- a/examples/broker-features/standard/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.jms.example;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * This example demonstrates how a JMS client can directly instantiate it's JMS Objects like
- * Queue, ConnectionFactory, etc. without having to use JNDI at all.
- *
- * For more information please see the readme.html file.
- */
-public class InstantiateConnectionFactoryExample {
-
- public static void main(final String[] args) throws Exception {
- Connection connection = null;
- try {
- // Step 1. Directly instantiate the JMS Queue object.
- Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
-
- // Starting with Artemis 1.0.1 you can just use the URI to instantiate the object directly
- ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616");
-
- // Step 4.Create a JMS Connection
- connection = cf.createConnection();
-
- // Step 5. Create a JMS Session
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Step 6. Create a JMS Message Producer
- MessageProducer producer = session.createProducer(queue);
-
- // Step 7. Create a Text Message
- TextMessage message = session.createTextMessage("This is a text message");
-
- System.out.println("Sent message: " + message.getText());
-
- // Step 8. Send the Message
- producer.send(message);
-
- // Step 9. Create a JMS Message Consumer
- MessageConsumer messageConsumer = session.createConsumer(queue);
-
- // Step 10. Start the Connection
- connection.start();
-
- // Step 11. Receive the message
- TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-
- System.out.println("Received message: " + messageReceived.getText());
- }
- finally {
- if (connection != null) {
- connection.close();
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b17d966/examples/broker-features/standard/interceptor/pom.xml
----------------------------------------------------------------------
diff --git a/examples/broker-features/standard/interceptor/pom.xml b/examples/broker-features/standard/interceptor/pom.xml
deleted file mode 100644
index fbf9654..0000000
--- a/examples/broker-features/standard/interceptor/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version='1.0'?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.activemq.examples.broker</groupId>
- <artifactId>jms-examples</artifactId>
- <version>1.0.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>interceptor</artifactId>
- <packaging>jar</packaging>
- <name>ActiveMQ Artemis JMS Interceptor Example</name>
-
- <properties>
- <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-jms-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.activemq</groupId>
- <artifactId>artemis-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>create</id>
- <goals>
- <goal>create</goal>
- </goals>
- <configuration>
- <libList><arg>org.apache.activemq.examples.broker:interceptor:${project.version}</arg></libList>
- <ignore>${noServer}</ignore>
- <configuration>${basedir}/target/classes/activemq/server0</configuration>
- </configuration>
- </execution>
- <execution>
- <id>start</id>
- <goals>
- <goal>cli</goal>
- </goals>
- <configuration>
- <ignore>${noServer}</ignore>
- <spawn>true</spawn>
- <testURI>tcp://localhost:61616</testURI>
- <args>
- <param>run</param>
- </args>
- </configuration>
- </execution>
- <execution>
- <id>runClient</id>
- <goals>
- <goal>runClient</goal>
- </goals>
- <configuration>
- <clientClass>org.apache.activemq.artemis.jms.example.InterceptorExample</clientClass>
- </configuration>
- </execution>
- <execution>
- <id>stop</id>
- <goals>
- <goal>cli</goal>
- </goals>
- <configuration>
- <ignore>${noServer}</ignore>
- <args>
- <param>stop</param>
- </args>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.apache.activemq.examples.broker</groupId>
- <artifactId>interceptor</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
-
-</project>