Skip to content

Commit ffffa3d

Browse files
committed
Create spring-boot-artemis module
1 parent f7b6899 commit ffffa3d

File tree

35 files changed

+175
-142
lines changed

35 files changed

+175
-142
lines changed

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ include "spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"
5959
include "spring-boot-project:spring-boot"
6060
include "spring-boot-project:spring-boot-activemq"
6161
include "spring-boot-project:spring-boot-amqp"
62+
include "spring-boot-project:spring-boot-artemis"
6263
include "spring-boot-project:spring-boot-autoconfigure"
6364
include "spring-boot-project:spring-boot-autoconfigure-all"
6465
include "spring-boot-project:spring-boot-actuator"

spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dependencies {
1919

2020
optional(project(":spring-boot-project:spring-boot-activemq"))
2121
optional(project(":spring-boot-project:spring-boot-amqp"))
22+
optional(project(":spring-boot-project:spring-boot-artemis"))
2223
optional(project(":spring-boot-project:spring-boot-jackson"))
2324
optional(project(":spring-boot-project:spring-boot-jetty"))
2425
optional(project(":spring-boot-project:spring-boot-jsonb"))

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jms/JmsHealthContributorAutoConfiguration.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
2929
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
3030
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
31-
import org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration;
3231
import org.springframework.context.annotation.Bean;
3332

3433
/**
@@ -37,8 +36,8 @@
3736
* @author Stephane Nicoll
3837
* @since 2.0.0
3938
*/
40-
@AutoConfiguration(after = ArtemisAutoConfiguration.class,
41-
afterName = "org.springframework.boot.activemq.autoconfigure.ActiveMQAutoConfiguration")
39+
@AutoConfiguration(afterName = { "org.springframework.boot.activemq.autoconfigure.ActiveMQAutoConfiguration",
40+
"org.springframework.boot.artemis.autoconfigure.ArtemisAutoConfiguration" })
4241
@ConditionalOnClass(ConnectionFactory.class)
4342
@ConditionalOnBean(ConnectionFactory.class)
4443
@ConditionalOnEnabledHealthIndicator("jms")

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/jms/JmsHealthContributorAutoConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@
2121
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
2222
import org.springframework.boot.actuate.jms.JmsHealthIndicator;
2323
import org.springframework.boot.actuate.ldap.LdapHealthIndicator;
24+
import org.springframework.boot.artemis.autoconfigure.ArtemisAutoConfiguration;
2425
import org.springframework.boot.autoconfigure.AutoConfigurations;
25-
import org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration;
2626
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
2727

2828
import static org.assertj.core.api.Assertions.assertThat;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
plugins {
2+
id "java-library"
3+
id "org.springframework.boot.auto-configuration"
4+
id "org.springframework.boot.configuration-properties"
5+
id "org.springframework.boot.deployed"
6+
id "org.springframework.boot.optional-dependencies"
7+
}
8+
9+
description = "Spring Boot Artemis"
10+
11+
dependencies {
12+
api(project(":spring-boot-project:spring-boot-jms"))
13+
api("org.apache.activemq:artemis-jakarta-client") {
14+
exclude group: "commons-logging", module: "commons-logging"
15+
}
16+
17+
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
18+
optional("org.apache.activemq:artemis-jakarta-server") {
19+
exclude group: "commons-logging", module: "commons-logging"
20+
}
21+
optional("org.messaginghub:pooled-jms") {
22+
exclude group: "org.apache.geronimo.specs", module: "geronimo-jms_2.0_spec"
23+
}
24+
25+
testImplementation(project(":spring-boot-project:spring-boot-test"))
26+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
27+
testImplementation("org.assertj:assertj-core")
28+
testImplementation("org.awaitility:awaitility")
29+
testImplementation("org.junit.jupiter:junit-jupiter")
30+
testImplementation("org.mockito:mockito-core")
31+
testImplementation("org.mockito:mockito-junit-jupiter")
32+
33+
testRuntimeOnly("ch.qos.logback:logback-classic")
34+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.jms.artemis;
17+
package org.springframework.boot.artemis.autoconfigure;
1818

1919
import jakarta.jms.ConnectionFactory;
2020
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.jms.artemis;
17+
package org.springframework.boot.artemis.autoconfigure;
1818

1919
import org.apache.activemq.artemis.core.config.Configuration;
2020
import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.jms.artemis;
17+
package org.springframework.boot.artemis.autoconfigure;
1818

1919
import org.springframework.boot.autoconfigure.service.connection.ConnectionDetails;
2020

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.jms.artemis;
17+
package org.springframework.boot.artemis.autoconfigure;
1818

1919
import jakarta.jms.ConnectionFactory;
2020
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.jms.artemis;
17+
package org.springframework.boot.artemis.autoconfigure;
1818

1919
import java.util.function.Function;
2020

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.jms.artemis;
17+
package org.springframework.boot.artemis.autoconfigure;
1818

1919
import java.io.File;
2020

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.jms.artemis;
17+
package org.springframework.boot.artemis.autoconfigure;
1818

1919
import org.apache.activemq.artemis.api.core.QueueConfiguration;
2020
import org.apache.activemq.artemis.api.core.RoutingType;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.jms.artemis;
17+
package org.springframework.boot.artemis.autoconfigure;
1818

1919
/**
2020
* Define the mode in which Artemis can operate.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.jms.artemis;
17+
package org.springframework.boot.artemis.autoconfigure;
1818

1919
import org.apache.activemq.artemis.spi.core.naming.BindingRegistry;
2020

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.jms.artemis;
17+
package org.springframework.boot.artemis.autoconfigure;
1818

1919
import java.util.HashMap;
2020
import java.util.Map;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.jms.artemis;
17+
package org.springframework.boot.artemis.autoconfigure;
1818

1919
import jakarta.jms.ConnectionFactory;
2020
import jakarta.transaction.TransactionManager;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
*
2020
* @author Eddú Meléndez
2121
*/
22-
package org.springframework.boot.autoconfigure.jms.artemis;
22+
package org.springframework.boot.artemis.autoconfigure;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"groups": [],
3+
"properties": [
4+
{
5+
"name": "spring.artemis.broker-url",
6+
"defaultValue": "tcp://localhost:61616"
7+
},
8+
{
9+
"name": "spring.artemis.host",
10+
"type": "java.lang.String",
11+
"deprecation": {
12+
"replacement": "spring.artemis.broker-url",
13+
"level": "error"
14+
}
15+
},
16+
{
17+
"name": "spring.artemis.pool.block-if-full",
18+
"type": "java.lang.Boolean",
19+
"description": "Whether to block when a connection is requested and the pool is full. Set it to false to throw a \"JMSException\" instead.",
20+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
21+
"defaultValue": true
22+
},
23+
{
24+
"name": "spring.artemis.pool.block-if-full-timeout",
25+
"type": "java.time.Duration",
26+
"description": "Blocking period before throwing an exception if the pool is still full.",
27+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
28+
"defaultValue": "-1ms"
29+
},
30+
{
31+
"name": "spring.artemis.pool.enabled",
32+
"type": "java.lang.Boolean",
33+
"description": "Whether a JmsPoolConnectionFactory should be created, instead of a regular ConnectionFactory.",
34+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
35+
"defaultValue": false
36+
},
37+
{
38+
"name": "spring.artemis.pool.idle-timeout",
39+
"type": "java.time.Duration",
40+
"description": "Connection idle timeout.",
41+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
42+
"defaultValue": "30s"
43+
},
44+
{
45+
"name": "spring.artemis.pool.max-connections",
46+
"type": "java.lang.Integer",
47+
"description": "Maximum number of pooled connections.",
48+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
49+
"defaultValue": 1
50+
},
51+
{
52+
"name": "spring.artemis.pool.max-sessions-per-connection",
53+
"type": "java.lang.Integer",
54+
"description": "Maximum number of pooled sessions per connection in the pool.",
55+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
56+
"defaultValue": 500
57+
},
58+
{
59+
"name": "spring.artemis.pool.maximum-active-session-per-connection",
60+
"deprecation": {
61+
"replacement": "spring.artemis.pool.max-sessions-per-connection"
62+
}
63+
},
64+
{
65+
"name": "spring.artemis.pool.time-between-expiration-check",
66+
"type": "java.time.Duration",
67+
"description": "Time to sleep between runs of the idle connection eviction thread. When negative, no idle connection eviction thread runs.",
68+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
69+
"defaultValue": "-1ms"
70+
},
71+
{
72+
"name": "spring.artemis.pool.use-anonymous-producers",
73+
"type": "java.lang.Boolean",
74+
"description": "Whether to use only one anonymous \"MessageProducer\" instance. Set it to false to create one \"MessageProducer\" every time one is required.",
75+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
76+
"defaultValue": true
77+
},
78+
{
79+
"name": "spring.artemis.port",
80+
"type": "java.lang.Integer",
81+
"deprecation": {
82+
"replacement": "spring.artemis.broker-url",
83+
"level": "error"
84+
}
85+
}
86+
]
87+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.springframework.boot.artemis.autoconfigure.ArtemisAutoConfiguration
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.jms.artemis;
17+
package org.springframework.boot.artemis.autoconfigure;
1818

1919
import java.io.File;
2020
import java.io.IOException;
@@ -46,8 +46,8 @@
4646
import org.junit.jupiter.api.io.TempDir;
4747
import org.messaginghub.pooled.jms.JmsPoolConnectionFactory;
4848

49+
import org.springframework.boot.artemis.autoconfigure.ArtemisAutoConfiguration.PropertiesArtemisConnectionDetails;
4950
import org.springframework.boot.autoconfigure.AutoConfigurations;
50-
import org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration.PropertiesArtemisConnectionDetails;
5151
import org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration;
5252
import org.springframework.boot.test.context.FilteredClassLoader;
5353
import org.springframework.boot.test.context.assertj.AssertableApplicationContext;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.jms.artemis;
17+
package org.springframework.boot.artemis.autoconfigure;
1818

1919
import java.util.List;
2020
import java.util.Map;

spring-boot-project/spring-boot-autoconfigure-all/build.gradle

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ dependencies {
4343
dockerTestImplementation("org.testcontainers:testcontainers")
4444

4545
optional(project(":spring-boot-project:spring-boot-activemq"))
46+
optional(project(":spring-boot-project:spring-boot-artemis"))
4647
optional(project(":spring-boot-project:spring-boot-jackson"))
4748
optional(project(":spring-boot-project:spring-boot-jsonb"))
4849
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
@@ -84,12 +85,7 @@ dependencies {
8485
optional("jakarta.ws.rs:jakarta.ws.rs-api")
8586
optional("javax.cache:cache-api")
8687
optional("javax.money:money-api")
87-
optional("org.apache.activemq:artemis-jakarta-client") {
88-
exclude group: "commons-logging", module: "commons-logging"
89-
}
90-
optional("org.apache.activemq:artemis-jakarta-server") {
91-
exclude group: "commons-logging", module: "commons-logging"
92-
}
88+
9389
optional("org.apache.commons:commons-dbcp2") {
9490
exclude group: "commons-logging", module: "commons-logging"
9591
}

spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/http/MessageConverterBackgroundPreinitializer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616

1717
package org.springframework.boot.autoconfigure.http;
1818

19-
import org.apache.activemq.artemis.spi.core.protocol.MessageConverter;
20-
2119
import org.springframework.boot.autoconfigure.preinitialize.BackgroundPreinitializer;
20+
import org.springframework.http.converter.HttpMessageConverter;
2221
import org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter;
2322

2423
/**
25-
* {@link BackgroundPreinitializer} Spring's {@link MessageConverter} implementations.
24+
* {@link BackgroundPreinitializer} Spring's {@link HttpMessageConverter} implementations.
2625
*
2726
* @author Phillip Webb
2827
*/

0 commit comments

Comments
 (0)