Skip to content

Commit b20935a

Browse files
committed
Restore JMS to use ActiveMQ
This commit moves back the JMS-related integration tests to ActiveMQ. They were previously migrated to Artemis, as ActiveMQ did not have support for Jakarta. This is also due to Artemis not working on Java 23, see https://issues.apache.org/jira/browse/ARTEMIS-4975 fore more details. Closes gh-1482
1 parent 6280dad commit b20935a

File tree

8 files changed

+15
-81
lines changed

8 files changed

+15
-81
lines changed

spring-ws-platform/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ javaPlatform {
88

99
dependencies {
1010
api(platform("org.apache.logging.log4j:log4j-bom:2.19.0"))
11+
api(platform("org.apache.activemq:activemq-bom:6.1.5"))
1112
api(platform("org.eclipse.jetty:jetty-bom:12.0.16"))
1213
api(platform("org.eclipse.jetty.ee10:jetty-ee10-bom:12.0.16"))
1314
api(platform("org.junit:junit-bom:5.11.0"))
@@ -32,7 +33,6 @@ dependencies {
3233
api("jaxen:jaxen:1.1.6")
3334
api("net.minidev:json-smart:2.5.2")
3435
api("net.sf.ehcache:ehcache:2.10.9.2")
35-
api("org.apache.activemq:artemis-jakarta-server:2.33.0")
3636
api("org.apache.commons:commons-collections4:4.4")
3737
api("org.apache.httpcomponents.client5:httpclient5:5.2.3")
3838
api("org.apache.httpcomponents:httpclient:4.5.14")

spring-ws-support/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies {
3030
exclude(group: "commons-logging", module: "commons-logging")
3131
}
3232
testImplementation("jakarta.annotation:jakarta.annotation-api")
33-
testImplementation("org.apache.activemq:artemis-jakarta-server") {
33+
testImplementation("org.apache.activemq:activemq-broker") {
3434
exclude(group: "commons-logging", module: "commons-logging")
3535
}
3636
testImplementation("org.apache.logging.log4j:log4j-core")

spring-ws-support/src/test/java/org/springframework/ws/transport/jms/JmsIntegrationTest.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515
*/
1616
package org.springframework.ws.transport.jms;
1717

18-
import org.apache.activemq.artemis.core.config.Configuration;
19-
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
20-
import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ;
21-
import org.junit.jupiter.api.AfterAll;
22-
import org.junit.jupiter.api.BeforeAll;
2318
import org.junit.jupiter.api.Test;
2419
import org.junit.jupiter.api.extension.ExtendWith;
2520

@@ -39,24 +34,6 @@ public class JmsIntegrationTest {
3934
@Autowired
4035
private WebServiceTemplate webServiceTemplate;
4136

42-
private static EmbeddedActiveMQ server;
43-
44-
@BeforeAll
45-
static void setUp() throws Exception {
46-
Configuration config = new ConfigurationImpl();
47-
config.addAcceptorConfiguration("vm", "vm://0");
48-
config.addAcceptorConfiguration("tcp", "tcp://127.0.0.1:61616");
49-
config.setSecurityEnabled(false);
50-
server = new EmbeddedActiveMQ();
51-
server.setConfiguration(config);
52-
server.start();
53-
}
54-
55-
@AfterAll
56-
static void tearDown() throws Exception {
57-
server.stop();
58-
}
59-
6037
@Test
6138
public void testTemporaryQueue() {
6239
String content = "<root xmlns='http://springframework.org/spring-ws'><child/></root>";

spring-ws-support/src/test/java/org/springframework/ws/transport/jms/JmsMessageSenderIntegrationTest.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
import jakarta.jms.TextMessage;
2525
import jakarta.xml.soap.MessageFactory;
2626
import jakarta.xml.soap.SOAPConstants;
27-
import org.apache.activemq.artemis.core.config.Configuration;
28-
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
29-
import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ;
30-
import org.junit.jupiter.api.AfterEach;
3127
import org.junit.jupiter.api.BeforeEach;
3228
import org.junit.jupiter.api.Test;
3329
import org.junit.jupiter.api.extension.ExtendWith;
@@ -59,24 +55,9 @@ public class JmsMessageSenderIntegrationTest {
5955

6056
private static final String SOAP_ACTION = "\"http://springframework.org/DoIt\"";
6157

62-
private EmbeddedActiveMQ server;
63-
6458
@BeforeEach
6559
public void createMessageFactory() throws Exception {
6660
messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
67-
68-
Configuration config = new ConfigurationImpl();
69-
config.addAcceptorConfiguration("vm", "vm://0");
70-
config.addAcceptorConfiguration("tcp", "tcp://127.0.0.1:61616");
71-
config.setSecurityEnabled(false);
72-
server = new EmbeddedActiveMQ();
73-
server.setConfiguration(config);
74-
server.start();
75-
}
76-
77-
@AfterEach
78-
void tearDown() throws Exception {
79-
server.stop();
8061
}
8162

8263
@Test

spring-ws-support/src/test/java/org/springframework/ws/transport/jms/WebServiceMessageListenerIntegrationTest.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
import jakarta.jms.Queue;
2424
import jakarta.jms.TextMessage;
2525
import jakarta.jms.Topic;
26-
import org.apache.activemq.artemis.core.config.Configuration;
27-
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
28-
import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ;
29-
import org.junit.jupiter.api.AfterEach;
30-
import org.junit.jupiter.api.BeforeEach;
3126
import org.junit.jupiter.api.Test;
3227
import org.junit.jupiter.api.extension.ExtendWith;
3328

@@ -62,25 +57,6 @@ public class WebServiceMessageListenerIntegrationTest {
6257
@Autowired
6358
private Topic requestTopic;
6459

65-
private EmbeddedActiveMQ server;
66-
67-
@BeforeEach
68-
void setUp() throws Exception {
69-
70-
Configuration config = new ConfigurationImpl();
71-
config.addAcceptorConfiguration("vm", "vm://0");
72-
config.addAcceptorConfiguration("tcp", "tcp://127.0.0.1:61616");
73-
config.setSecurityEnabled(false);
74-
server = new EmbeddedActiveMQ();
75-
server.setConfiguration(config);
76-
server.start();
77-
}
78-
79-
@AfterEach
80-
void tearDown() throws Exception {
81-
server.stop();
82-
}
83-
8460
@Test
8561
public void testReceiveQueueBytesMessage() {
8662

spring-ws-support/src/test/resources/org/springframework/ws/transport/jms/jms-applicationContext.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
44

5-
<bean id="connectionFactory" class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">
5+
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
66
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
77
</bean>
88

spring-ws-support/src/test/resources/org/springframework/ws/transport/jms/jms-receiver-applicationContext.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
44

5-
<bean id="connectionFactory" class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">
5+
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
66
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
77
</bean>
88

9-
<bean id="requestQueue" class="org.apache.activemq.artemis.jms.client.ActiveMQQueue">
10-
<property name="address" value="RequestQueue"/>
9+
<bean id="requestQueue" class="org.apache.activemq.command.ActiveMQQueue">
10+
<property name="physicalName" value="RequestQueue"/>
1111
</bean>
1212

13-
<bean id="requestTopic" class="org.apache.activemq.artemis.jms.client.ActiveMQTopic">
14-
<property name="address" value="RequestTopic"/>
13+
<bean id="requestTopic" class="org.apache.activemq.command.ActiveMQTopic">
14+
<property name="physicalName" value="RequestTopic"/>
1515
</bean>
1616

17-
<bean id="responseQueue" class="org.apache.activemq.artemis.jms.client.ActiveMQQueue">
18-
<property name="address" value="ResponseQueue"/>
17+
<bean id="responseQueue" class="org.apache.activemq.command.ActiveMQQueue">
18+
<property name="physicalName" value="ResponseQueue"/>
1919
</bean>
2020

2121
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">

spring-ws-support/src/test/resources/org/springframework/ws/transport/jms/jms-sender-applicationContext.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
44

5-
<bean id="connectionFactory" class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">
5+
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
66
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
77
</bean>
88

9-
<bean id="requestQueue" class="org.apache.activemq.artemis.jms.client.ActiveMQQueue">
10-
<property name="address" value="SenderRequestQueue"/>
9+
<bean id="requestQueue" class="org.apache.activemq.command.ActiveMQQueue">
10+
<property name="physicalName" value="SenderRequestQueue"/>
1111
</bean>
1212

13-
<bean id="responseQueue" class="org.apache.activemq.artemis.jms.client.ActiveMQQueue">
14-
<property name="address" value="SenderResponseQueue"/>
13+
<bean id="responseQueue" class="org.apache.activemq.command.ActiveMQQueue">
14+
<property name="physicalName" value="SenderResponseQueue"/>
1515
</bean>
1616

1717
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">

0 commit comments

Comments
 (0)