Update Code for Spring MQ testing: https://www.isharkfly.com/t/activemq-artemis-spring/14881
This commit is contained in:
parent
29381a633e
commit
228c510918
@ -3,18 +3,14 @@ package com.ossez.artemis.server;
|
|||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.jms.annotation.JmsListener;
|
import org.springframework.jms.annotation.JmsListener;
|
||||||
//import org.springframework.jmsremoting.JmsInvokerServiceExporter;
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JMS Message Consumer Application
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class JmsServer {
|
public class JmsArtemisServerApplication {
|
||||||
|
|
||||||
/*
|
|
||||||
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
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@JmsListener(destination = "remotingQueue")
|
@JmsListener(destination = "remotingQueue")
|
||||||
@ -23,7 +19,7 @@ public class JmsServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(JmsServer.class, args);
|
SpringApplication.run(JmsArtemisServerApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -5,7 +5,7 @@ import org.junit.runner.RunWith;
|
|||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
import com.ossez.artemis.server.JmsServer;
|
import com.ossez.artemis.server.JmsArtemisServerApplication;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This Live Test requires:
|
* 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`)
|
* * 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)
|
@RunWith(SpringRunner.class)
|
||||||
public class SpringContextLiveTest {
|
public class SpringContextLiveTest {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user