You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2017/11/08 17:09:17 UTC

[cxf] branch master updated: Flip one of the JMS demos over to use ActiveMQ Artemis to start testing with it

This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new 0744884  Flip one of the JMS demos over to use ActiveMQ Artemis to start testing with it
0744884 is described below

commit 0744884e42b18ca70aef096bc124b3a981d491fd
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Wed Nov 8 12:08:41 2017 -0500

    Flip one of the JMS demos over to use ActiveMQ Artemis to start testing with it
---
 .../src/main/release/samples/jms_pubsub/README.txt |  2 +-
 .../src/main/release/samples/jms_pubsub/pom.xml    |  6 ++--
 .../jms_pubsub/src/main/config/jms_greeter.wsdl    |  2 +-
 .../demo/jms_greeter/broker/EmbeddedBroker.java    | 41 ++++++++++++++++------
 parent/pom.xml                                     | 11 ++++++
 5 files changed, 47 insertions(+), 15 deletions(-)

diff --git a/distribution/src/main/release/samples/jms_pubsub/README.txt b/distribution/src/main/release/samples/jms_pubsub/README.txt
index 70d1fb1..5773e7c 100644
--- a/distribution/src/main/release/samples/jms_pubsub/README.txt
+++ b/distribution/src/main/release/samples/jms_pubsub/README.txt
@@ -12,7 +12,7 @@ have a single response for a request that has multiple subscribers.
 Please review the README in the samples directory before
 continuing.
 
-This demo uses ActiveMQ as the JMS implementation for 
+This demo uses ActiveMQ Artemis as the JMS implementation for
 illustration purposes only.
   
   
diff --git a/distribution/src/main/release/samples/jms_pubsub/pom.xml b/distribution/src/main/release/samples/jms_pubsub/pom.xml
index 6c1c2c0..35a256a 100644
--- a/distribution/src/main/release/samples/jms_pubsub/pom.xml
+++ b/distribution/src/main/release/samples/jms_pubsub/pom.xml
@@ -144,13 +144,15 @@
             <artifactId>cxf-rt-transports-jms</artifactId>
             <version>3.2.2-SNAPSHOT</version>
         </dependency>
+        
         <dependency>
             <groupId>org.apache.activemq</groupId>
-            <artifactId>activemq-broker</artifactId>
+            <artifactId>artemis-cli</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.activemq</groupId>
-            <artifactId>activemq-kahadb-store</artifactId>
+            <artifactId>artemis-openwire-protocol</artifactId>
         </dependency>
+
     </dependencies>
 </project>
diff --git a/distribution/src/main/release/samples/jms_pubsub/src/main/config/jms_greeter.wsdl b/distribution/src/main/release/samples/jms_pubsub/src/main/config/jms_greeter.wsdl
index 9551e40..925e9cb 100644
--- a/distribution/src/main/release/samples/jms_pubsub/src/main/config/jms_greeter.wsdl
+++ b/distribution/src/main/release/samples/jms_pubsub/src/main/config/jms_greeter.wsdl
@@ -61,7 +61,7 @@
         <wsdl:port binding="tns:JMSGreeterPortBinding" name="GreeterPort">
         	<soap:address location="jms:topic:test.cxf.jmstransport.topic"/>
         	<soapjms:jndiConnectionFactoryName>ConnectionFactory</soapjms:jndiConnectionFactoryName>
-            <soapjms:jndiInitialContextFactory>org.apache.activemq.jndi.ActiveMQInitialContextFactory</soapjms:jndiInitialContextFactory>
+            <soapjms:jndiInitialContextFactory>org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory</soapjms:jndiInitialContextFactory>
  			<soapjms:jndiURL>tcp://localhost:61616</soapjms:jndiURL>
         </wsdl:port>
     </wsdl:service>
diff --git a/distribution/src/main/release/samples/jms_pubsub/src/main/java/demo/jms_greeter/broker/EmbeddedBroker.java b/distribution/src/main/release/samples/jms_pubsub/src/main/java/demo/jms_greeter/broker/EmbeddedBroker.java
index 1dab76a..ec095e5 100644
--- a/distribution/src/main/release/samples/jms_pubsub/src/main/java/demo/jms_greeter/broker/EmbeddedBroker.java
+++ b/distribution/src/main/release/samples/jms_pubsub/src/main/java/demo/jms_greeter/broker/EmbeddedBroker.java
@@ -18,23 +18,42 @@
  */
 
 package demo.jms_greeter.broker;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.store.memory.MemoryPersistenceAdapter;
+
+import java.io.File;
+import java.util.HashSet;
+
+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.invm.InVMAcceptorFactory;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
+import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ;
 
 public final class EmbeddedBroker {
     private EmbeddedBroker() {
     }
 
     public static void main(String[] args) throws Exception {
-        BrokerService broker = new BrokerService();
-        broker.setPersistenceAdapter(new MemoryPersistenceAdapter());
-        broker.setDataDirectory("target/activemq_data");
-        broker.addConnector("tcp://localhost:61616");
-        broker.start();
-        System.out.println("JMS broker ready ...");
-        Thread.sleep(125 * 60 * 1000);
-        System.out.println("JMS broker exiting");
-        broker.stop();
+        Configuration config = new ConfigurationImpl();
+        HashSet<TransportConfiguration> transports = new HashSet<TransportConfiguration>();
+        transports.add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
+        transports.add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
+        config.setAcceptorConfigurations(transports); 
+        config.setBrokerInstance(new File("target/artemis"));
+        config.setPersistenceEnabled(false);
+        config.setSecurityEnabled(false);
+        config.setJMXManagementEnabled(false);
+        
+        EmbeddedActiveMQ server = new EmbeddedActiveMQ();
+        server.setConfiguration(config);
+        server.start();
+        try {
+            System.out.println("JMS broker ready ...");
+            Thread.sleep(125 * 60 * 1000);
+        } finally {
+            System.out.println("JMS broker exiting");
+            server.stop();
+        }
         System.exit(0);
     }
 }
diff --git a/parent/pom.xml b/parent/pom.xml
index dbb6b7d..c1745d7 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -69,6 +69,7 @@
         <cxf.abdera.version>1.1.3</cxf.abdera.version>
         <cxf.abdera.osgi.version>1.1.3_2</cxf.abdera.osgi.version>
         <cxf.activemq.version>5.14.5</cxf.activemq.version>
+        <cxf.artemis.version>2.4.0</cxf.artemis.version>
         <cxf.ahc.version>1.9.40</cxf.ahc.version>
         <cxf.apacheds.version>2.0.0-M24</cxf.apacheds.version>
         <cxf.atmosphere.version>2.4.14</cxf.atmosphere.version>
@@ -1703,6 +1704,16 @@
                 <version>${cxf.activemq.version}</version>
             </dependency>
             <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>artemis-cli</artifactId>
+                <version>${cxf.artemis.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>artemis-openwire-protocol</artifactId>
+                <version>${cxf.artemis.version}</version>
+            </dependency>
+            <dependency>
                 <groupId>rhino</groupId>
                 <artifactId>js</artifactId>
                 <version>${cxf.rhino.version}</version>

-- 
To stop receiving notification emails like this one, please contact
['"commits@cxf.apache.org" <co...@cxf.apache.org>'].