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

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


The following commit(s) were added to refs/heads/main by this push:
     new 9e15038746 jms_spring_config at least works, but client hangs on 
completion
9e15038746 is described below

commit 9e15038746a2eded8345243e9eaa112bc56da463
Author: Daniel Kulp <[email protected]>
AuthorDate: Tue Dec 13 09:02:55 2022 -0500

    jms_spring_config at least works, but client hangs on completion
---
 .../main/release/samples/jms_spring_config/pom.xml | 19 ++++----
 .../customerservice/broker/EmbeddedBroker.java     | 55 ++++++++++++++++++++++
 .../main/resources/client-applicationContext.xml   |  2 +-
 .../main/resources/server-applicationContext.xml   |  2 +-
 4 files changed, 68 insertions(+), 10 deletions(-)

diff --git a/distribution/src/main/release/samples/jms_spring_config/pom.xml 
b/distribution/src/main/release/samples/jms_spring_config/pom.xml
index e2c63bb3bd..5fd87a2f2c 100644
--- a/distribution/src/main/release/samples/jms_spring_config/pom.xml
+++ b/distribution/src/main/release/samples/jms_spring_config/pom.xml
@@ -137,15 +137,17 @@
                 <defaultGoal>test</defaultGoal>
                 <plugins>
                     <plugin>
-                        <groupId>org.apache.activemq.tooling</groupId>
-                        <artifactId>activemq-maven-plugin</artifactId>
-                        <version>5.8.0</version>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
                         <executions>
                             <execution>
                                 <phase>test</phase>
                                 <goals>
-                                    <goal>run</goal>
+                                    <goal>java</goal>
                                 </goals>
+                                <configuration>
+                                    
<mainClass>com.example.customerservice.broker.EmbeddedBroker</mainClass>
+                                </configuration>
                             </execution>
                         </executions>
                     </plugin>
@@ -168,10 +170,6 @@
             <groupId>org.apache.cxf.xjc-utils</groupId>
             <artifactId>cxf-xjc-runtime</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-jakarta-client</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-context</artifactId>
@@ -181,5 +179,10 @@
             <artifactId>junit</artifactId>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-jakarta-server</artifactId>
+            <version>${cxf.activemq.artemis.version}</version>
+        </dependency>
     </dependencies>
 </project>
diff --git 
a/distribution/src/main/release/samples/jms_spring_config/src/main/java/com/example/customerservice/broker/EmbeddedBroker.java
 
b/distribution/src/main/release/samples/jms_spring_config/src/main/java/com/example/customerservice/broker/EmbeddedBroker.java
new file mode 100644
index 0000000000..d4db3ac371
--- /dev/null
+++ 
b/distribution/src/main/release/samples/jms_spring_config/src/main/java/com/example/customerservice/broker/EmbeddedBroker.java
@@ -0,0 +1,55 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.example.customerservice.broker;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.activemq.artemis.core.config.Configuration;
+import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
+
+public final class EmbeddedBroker {
+    private EmbeddedBroker() {
+    }
+
+    public static void main(String[] args) throws Exception {
+        final Configuration config = new ConfigurationImpl();
+        config.setPersistenceEnabled(false);
+        config.setSecurityEnabled(false);
+        config.addAcceptorConfiguration("tcp", "tcp://localhost:61616");
+        config.setBrokerInstance(new File("target/activemq-data"));
+       
+        final ActiveMQServer server = new ActiveMQServerImpl(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/distribution/src/main/release/samples/jms_spring_config/src/main/resources/client-applicationContext.xml
 
b/distribution/src/main/release/samples/jms_spring_config/src/main/resources/client-applicationContext.xml
index 840854d341..d7c10bf7bc 100644
--- 
a/distribution/src/main/release/samples/jms_spring_config/src/main/resources/client-applicationContext.xml
+++ 
b/distribution/src/main/release/samples/jms_spring_config/src/main/resources/client-applicationContext.xml
@@ -25,7 +25,7 @@
                http://cxf.apache.org/jaxws 
http://cxf.apache.org/schemas/jaxws.xsd";>
 
        <!-- Do not forget the destroy-method as else the JVM will hang on 
shutdown -->
-       <bean id="jmsConnectionFactory" 
class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory" 
destroy-method="stop">
+       <bean id="jmsConnectionFactory" 
class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory" 
destroy-method="close">
                <property name="brokerURL" value="tcp://localhost:61616"/>
        </bean>
     
diff --git 
a/distribution/src/main/release/samples/jms_spring_config/src/main/resources/server-applicationContext.xml
 
b/distribution/src/main/release/samples/jms_spring_config/src/main/resources/server-applicationContext.xml
index 1dbbd44f82..3d856a1978 100644
--- 
a/distribution/src/main/release/samples/jms_spring_config/src/main/resources/server-applicationContext.xml
+++ 
b/distribution/src/main/release/samples/jms_spring_config/src/main/resources/server-applicationContext.xml
@@ -24,7 +24,7 @@
                http://cxf.apache.org/jaxws 
http://cxf.apache.org/schemas/jaxws.xsd";>
 
        <!-- Do not forget the destroy-method as else the JVM will hang on 
shutdown -->
-       <bean id="jmsConnectionFactory" 
class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory" 
destroy-method="stop">
+       <bean id="jmsConnectionFactory" 
class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory" 
destroy-method="close">
                <property name="brokerURL" value="tcp://localhost:61616"/>
        </bean>
 

Reply via email to