From 228c510918513cc2224bf60b9de0eb231b85dfbb Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Wed, 13 Sep 2023 09:23:20 -0400 Subject: [PATCH] Update Code for Spring MQ testing: https://www.isharkfly.com/t/activemq-artemis-spring/14881 --- ...r.java => JmsArtemisServerApplication.java} | 18 +++++++----------- .../ossez/artemis/SpringContextLiveTest.java | 4 ++-- 2 files changed, 9 insertions(+), 13 deletions(-) rename spring-remoting-modules-3/remoting-jms-artemis/remoting-jms-artemis-server/src/main/java/com/ossez/artemis/server/{JmsServer.java => JmsArtemisServerApplication.java} (55%) diff --git a/spring-remoting-modules-3/remoting-jms-artemis/remoting-jms-artemis-server/src/main/java/com/ossez/artemis/server/JmsServer.java b/spring-remoting-modules-3/remoting-jms-artemis/remoting-jms-artemis-server/src/main/java/com/ossez/artemis/server/JmsArtemisServerApplication.java similarity index 55% rename from spring-remoting-modules-3/remoting-jms-artemis/remoting-jms-artemis-server/src/main/java/com/ossez/artemis/server/JmsServer.java rename to spring-remoting-modules-3/remoting-jms-artemis/remoting-jms-artemis-server/src/main/java/com/ossez/artemis/server/JmsArtemisServerApplication.java index 581ea2eeb1..9a8ba8a857 100644 --- a/spring-remoting-modules-3/remoting-jms-artemis/remoting-jms-artemis-server/src/main/java/com/ossez/artemis/server/JmsServer.java +++ b/spring-remoting-modules-3/remoting-jms-artemis/remoting-jms-artemis-server/src/main/java/com/ossez/artemis/server/JmsArtemisServerApplication.java @@ -3,18 +3,14 @@ package com.ossez.artemis.server; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.jms.annotation.JmsListener; -//import org.springframework.jmsremoting.JmsInvokerServiceExporter; +/** + * JMS Message Consumer Application + * + * @author YuCheng Hu + */ @SpringBootApplication -public class JmsServer { - - /* - This server needs to be connected to an ActiveMQ server. - To quickly spin up an ActiveMQ server, you can use Docker. - - docker run -p 61616:61616 -p 8161:8161 rmohr/activemq:5.14.3 - */ - +public class JmsArtemisServerApplication { @JmsListener(destination = "remotingQueue") @@ -23,7 +19,7 @@ public class JmsServer { } public static void main(String[] args) { - SpringApplication.run(JmsServer.class, args); + SpringApplication.run(JmsArtemisServerApplication.class, args); } } diff --git a/spring-remoting-modules-3/remoting-jms-artemis/remoting-jms-artemis-server/src/test/java/com/ossez/artemis/SpringContextLiveTest.java b/spring-remoting-modules-3/remoting-jms-artemis/remoting-jms-artemis-server/src/test/java/com/ossez/artemis/SpringContextLiveTest.java index 21553872ed..c87c582465 100644 --- a/spring-remoting-modules-3/remoting-jms-artemis/remoting-jms-artemis-server/src/test/java/com/ossez/artemis/SpringContextLiveTest.java +++ b/spring-remoting-modules-3/remoting-jms-artemis/remoting-jms-artemis-server/src/test/java/com/ossez/artemis/SpringContextLiveTest.java @@ -5,7 +5,7 @@ import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; -import com.ossez.artemis.server.JmsServer; +import com.ossez.artemis.server.JmsArtemisServerApplication; /** * This Live Test requires: @@ -13,7 +13,7 @@ import com.ossez.artemis.server.JmsServer; * * an ActiveMQ instance running (e.g. `docker run -p 61616:61616 -p 8161:8161 --name bael-activemq rmohr/activemq`) * */ -@SpringBootTest(classes = JmsServer.class) +@SpringBootTest(classes = JmsArtemisServerApplication.class) @RunWith(SpringRunner.class) public class SpringContextLiveTest {