Skip to content

Commit d12bf15

Browse files
committed
Create spring-boot-jms module
1 parent ff0570e commit d12bf15

File tree

49 files changed

+258
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+258
-106
lines changed

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ include "spring-boot-project:spring-boot-docker-compose"
5151
include "spring-boot-project:spring-boot-docs"
5252
include "spring-boot-project:spring-boot-jackson"
5353
include "spring-boot-project:spring-boot-jetty"
54+
include "spring-boot-project:spring-boot-jms"
5455
include "spring-boot-project:spring-boot-jsonb"
5556
include "spring-boot-project:spring-boot-mail"
5657
include "spring-boot-project:spring-boot-parent"

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies {
2020
optional(project(":spring-boot-project:spring-boot-amqp"))
2121
optional(project(":spring-boot-project:spring-boot-jackson"))
2222
optional(project(":spring-boot-project:spring-boot-jetty"))
23+
optional(project(":spring-boot-project:spring-boot-jms"))
2324
optional(project(":spring-boot-project:spring-boot-jsonb"))
2425
optional(project(":spring-boot-project:spring-boot-mail"))
2526
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
@@ -74,7 +75,6 @@ dependencies {
7475
optional("io.r2dbc:r2dbc-proxy")
7576
optional("io.r2dbc:r2dbc-spi")
7677
optional("io.undertow:undertow-servlet")
77-
optional("jakarta.jms:jakarta.jms-api")
7878
optional("jakarta.persistence:jakarta.persistence-api")
7979
optional("jakarta.servlet:jakarta.servlet-api")
8080
optional("javax.cache:cache-api")
@@ -116,7 +116,6 @@ dependencies {
116116
optional("org.neo4j.driver:neo4j-java-driver")
117117
optional("org.quartz-scheduler:quartz")
118118
optional("org.springframework:spring-jdbc")
119-
optional("org.springframework:spring-jms")
120119
optional("org.springframework:spring-messaging")
121120
optional("org.springframework:spring-webflux")
122121
optional("org.springframework:spring-webmvc")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dependencies {
2424
dockerTestImplementation("org.testcontainers:testcontainers")
2525

2626
optional(project(":spring-boot-project:spring-boot-jetty"))
27+
optional(project(":spring-boot-project:spring-boot-jms"))
2728
optional(project(":spring-boot-project:spring-boot-jsonb"))
2829
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
2930
optional(project(":spring-boot-project:spring-boot-tomcat"))
@@ -49,7 +50,6 @@ dependencies {
4950
optional("io.r2dbc:r2dbc-spi")
5051
optional("io.undertow:undertow-servlet")
5152
optional("javax.cache:cache-api")
52-
optional("jakarta.jms:jakarta.jms-api")
5353
optional("org.apache.tomcat.embed:tomcat-embed-core")
5454
optional("org.aspectj:aspectjweaver")
5555
optional("org.cache2k:cache2k-micrometer")

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ dependencies {
2929
optional("io.rsocket:rsocket-core")
3030
optional("io.rsocket:rsocket-transport-netty")
3131
optional("io.undertow:undertow-servlet")
32-
optional("jakarta.jms:jakarta.jms-api")
3332
optional("jakarta.persistence:jakarta.persistence-api")
3433
optional("jakarta.servlet:jakarta.servlet-api")
3534
optional("jakarta.transaction:jakarta.transaction-api")
@@ -58,15 +57,11 @@ dependencies {
5857
optional("org.liquibase:liquibase-core") {
5958
exclude(group: "javax.xml.bind", module: "jaxb-api")
6059
}
61-
optional("org.messaginghub:pooled-jms") {
62-
exclude group: "org.apache.geronimo.specs", module: "geronimo-jms_2.0_spec"
63-
}
6460
optional("org.postgresql:postgresql")
6561
optional("org.slf4j:jul-to-slf4j")
6662
optional("org.slf4j:slf4j-api")
6763
optional("org.springframework:spring-messaging")
6864
optional("org.springframework:spring-orm")
69-
optional("org.springframework:spring-jms")
7065
optional("org.springframework:spring-oxm")
7166
optional("org.springframework:spring-r2dbc")
7267
optional("org.springframework:spring-test")

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

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

4545
optional(project(":spring-boot-project:spring-boot-jackson"))
4646
optional(project(":spring-boot-project:spring-boot-jsonb"))
47+
optional(project(":spring-boot-project:spring-boot-jms"))
4748
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
4849
optional(project(":spring-boot-project:spring-boot-tomcat"))
4950
optional("co.elastic.clients:elasticsearch-java") {

spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfiguration.java

Lines changed: 4 additions & 4 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.
@@ -23,10 +23,10 @@
2323
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2424
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2525
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
26-
import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration;
27-
import org.springframework.boot.autoconfigure.jms.JmsProperties;
28-
import org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguration;
2926
import org.springframework.boot.context.properties.EnableConfigurationProperties;
27+
import org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration;
28+
import org.springframework.boot.jms.autoconfigure.JmsProperties;
29+
import org.springframework.boot.jms.autoconfigure.JndiConnectionFactoryAutoConfiguration;
3030
import org.springframework.context.annotation.Bean;
3131
import org.springframework.context.annotation.Import;
3232

spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
28-
import org.springframework.boot.autoconfigure.jms.JmsPoolConnectionFactoryFactory;
29-
import org.springframework.boot.autoconfigure.jms.JmsProperties;
28+
import org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryFactory;
29+
import org.springframework.boot.jms.autoconfigure.JmsProperties;
3030
import org.springframework.context.annotation.Bean;
3131
import org.springframework.context.annotation.Configuration;
3232
import org.springframework.jms.connection.CachingConnectionFactory;

spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
import java.util.ArrayList;
2121
import java.util.List;
2222

23-
import org.springframework.boot.autoconfigure.jms.JmsPoolConnectionFactoryProperties;
2423
import org.springframework.boot.context.properties.ConfigurationProperties;
2524
import org.springframework.boot.context.properties.NestedConfigurationProperty;
25+
import org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties;
2626

2727
/**
2828
* Configuration properties for ActiveMQ.

spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfiguration.java

Lines changed: 4 additions & 4 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.
@@ -23,10 +23,10 @@
2323
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2424
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2525
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
26-
import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration;
27-
import org.springframework.boot.autoconfigure.jms.JmsProperties;
28-
import org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguration;
2926
import org.springframework.boot.context.properties.EnableConfigurationProperties;
27+
import org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration;
28+
import org.springframework.boot.jms.autoconfigure.JmsProperties;
29+
import org.springframework.boot.jms.autoconfigure.JndiConnectionFactoryAutoConfiguration;
3030
import org.springframework.context.annotation.Bean;
3131
import org.springframework.context.annotation.Import;
3232

spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisConnectionFactoryConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
28-
import org.springframework.boot.autoconfigure.jms.JmsPoolConnectionFactoryFactory;
29-
import org.springframework.boot.autoconfigure.jms.JmsProperties;
28+
import org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryFactory;
29+
import org.springframework.boot.jms.autoconfigure.JmsProperties;
3030
import org.springframework.context.annotation.Bean;
3131
import org.springframework.context.annotation.Configuration;
3232
import org.springframework.jms.connection.CachingConnectionFactory;

spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323

2424
import org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants;
2525

26-
import org.springframework.boot.autoconfigure.jms.JmsPoolConnectionFactoryProperties;
2726
import org.springframework.boot.context.properties.ConfigurationProperties;
2827
import org.springframework.boot.context.properties.NestedConfigurationProperty;
28+
import org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties;
2929

3030
/**
3131
* Configuration properties for Artemis.

spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json

Lines changed: 112 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
{
22
"groups": [],
33
"properties": [
4+
{
5+
"name": "spring.activemq.pool.block-if-full",
6+
"type": "java.lang.Boolean",
7+
"description": "Whether to block when a connection is requested and the pool is full. Set it to false to throw a \"JMSException\" instead.",
8+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
9+
"defaultValue": true
10+
},
11+
{
12+
"name": "spring.activemq.pool.block-if-full-timeout",
13+
"type": "java.time.Duration",
14+
"description": "Blocking period before throwing an exception if the pool is still full.",
15+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
16+
"defaultValue": "-1ms"
17+
},
418
{
519
"name": "spring.activemq.pool.create-connection-on-startup",
620
"type": "java.lang.Boolean",
@@ -10,6 +24,13 @@
1024
"level": "error"
1125
}
1226
},
27+
{
28+
"name": "spring.activemq.pool.enabled",
29+
"type": "java.lang.Boolean",
30+
"description": "Whether a JmsPoolConnectionFactory should be created, instead of a regular ConnectionFactory.",
31+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
32+
"defaultValue": false
33+
},
1334
{
1435
"name": "spring.activemq.pool.expiry-timeout",
1536
"type": "java.time.Duration",
@@ -19,6 +40,27 @@
1940
"level": "error"
2041
}
2142
},
43+
{
44+
"name": "spring.activemq.pool.idle-timeout",
45+
"type": "java.time.Duration",
46+
"description": "Connection idle timeout.",
47+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
48+
"defaultValue": "30s"
49+
},
50+
{
51+
"name": "spring.activemq.pool.max-connections",
52+
"type": "java.lang.Integer",
53+
"description": "Maximum number of pooled connections.",
54+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
55+
"defaultValue": 1
56+
},
57+
{
58+
"name": "spring.activemq.pool.max-sessions-per-connection",
59+
"type": "java.lang.Integer",
60+
"description": "Maximum number of pooled sessions per connection in the pool.",
61+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
62+
"defaultValue": 500
63+
},
2264
{
2365
"name": "spring.activemq.pool.maximum-active-session-per-connection",
2466
"deprecation": {
@@ -34,6 +76,20 @@
3476
"level": "error"
3577
}
3678
},
79+
{
80+
"name": "spring.activemq.pool.time-between-expiration-check",
81+
"type": "java.time.Duration",
82+
"description": "Time to sleep between runs of the idle connection eviction thread. When negative, no idle connection eviction thread runs.",
83+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
84+
"defaultValue": "-1ms"
85+
},
86+
{
87+
"name": "spring.activemq.pool.use-anonymous-producers",
88+
"type": "java.lang.Boolean",
89+
"description": "Whether to use only one anonymous \"MessageProducer\" instance. Set it to false to create one \"MessageProducer\" every time one is required.",
90+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
91+
"defaultValue": true
92+
},
3793
{
3894
"name": "spring.aop.auto",
3995
"type": "java.lang.Boolean",
@@ -58,12 +114,68 @@
58114
"level": "error"
59115
}
60116
},
117+
{
118+
"name": "spring.artemis.pool.block-if-full",
119+
"type": "java.lang.Boolean",
120+
"description": "Whether to block when a connection is requested and the pool is full. Set it to false to throw a \"JMSException\" instead.",
121+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
122+
"defaultValue": true
123+
},
124+
{
125+
"name": "spring.artemis.pool.block-if-full-timeout",
126+
"type": "java.time.Duration",
127+
"description": "Blocking period before throwing an exception if the pool is still full.",
128+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
129+
"defaultValue": "-1ms"
130+
},
131+
{
132+
"name": "spring.artemis.pool.enabled",
133+
"type": "java.lang.Boolean",
134+
"description": "Whether a JmsPoolConnectionFactory should be created, instead of a regular ConnectionFactory.",
135+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
136+
"defaultValue": false
137+
},
138+
{
139+
"name": "spring.artemis.pool.idle-timeout",
140+
"type": "java.time.Duration",
141+
"description": "Connection idle timeout.",
142+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
143+
"defaultValue": "30s"
144+
},
145+
{
146+
"name": "spring.artemis.pool.max-connections",
147+
"type": "java.lang.Integer",
148+
"description": "Maximum number of pooled connections.",
149+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
150+
"defaultValue": 1
151+
},
152+
{
153+
"name": "spring.artemis.pool.max-sessions-per-connection",
154+
"type": "java.lang.Integer",
155+
"description": "Maximum number of pooled sessions per connection in the pool.",
156+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
157+
"defaultValue": 500
158+
},
61159
{
62160
"name": "spring.artemis.pool.maximum-active-session-per-connection",
63161
"deprecation": {
64162
"replacement": "spring.artemis.pool.max-sessions-per-connection"
65163
}
66164
},
165+
{
166+
"name": "spring.artemis.pool.time-between-expiration-check",
167+
"type": "java.time.Duration",
168+
"description": "Time to sleep between runs of the idle connection eviction thread. When negative, no idle connection eviction thread runs.",
169+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
170+
"defaultValue": "-1ms"
171+
},
172+
{
173+
"name": "spring.artemis.pool.use-anonymous-producers",
174+
"type": "java.lang.Boolean",
175+
"description": "Whether to use only one anonymous \"MessageProducer\" instance. Set it to false to create one \"MessageProducer\" every time one is required.",
176+
"sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties",
177+
"defaultValue": true
178+
},
67179
{
68180
"name": "spring.artemis.port",
69181
"type": "java.lang.Integer",
@@ -2593,40 +2705,6 @@
25932705
}
25942706
]
25952707
},
2596-
{
2597-
"name": "spring.jms.listener.session.acknowledge-mode",
2598-
"values": [
2599-
{
2600-
"value": "auto",
2601-
"description": "Messages sent or received from the session are automatically acknowledged. This is the simplest mode and enables once-only message delivery guarantee."
2602-
},
2603-
{
2604-
"value": "client",
2605-
"description": "Messages are acknowledged once the message listener implementation has called \"jakarta.jms.Message#acknowledge()\". This mode gives the application (rather than the JMS provider) complete control over message acknowledgement."
2606-
},
2607-
{
2608-
"value": "dups_ok",
2609-
"description": "Similar to auto acknowledgment except that said acknowledgment is lazy. As a consequence, the messages might be delivered more than once. This mode enables at-least-once message delivery guarantee."
2610-
}
2611-
]
2612-
},
2613-
{
2614-
"name": "spring.jms.template.session.acknowledge-mode",
2615-
"values": [
2616-
{
2617-
"value": "auto",
2618-
"description": "Messages sent or received from the session are automatically acknowledged. This is the simplest mode and enables once-only message delivery guarantee."
2619-
},
2620-
{
2621-
"value": "client",
2622-
"description": "Messages are acknowledged once the message listener implementation has called \"jakarta.jms.Message#acknowledge()\". This mode gives the application (rather than the JMS provider) complete control over message acknowledgement."
2623-
},
2624-
{
2625-
"value": "dups_ok",
2626-
"description": "Similar to auto acknowledgment except that said acknowledgment is lazy. As a consequence, the messages might be delivered more than once. This mode enables at-least-once message delivery guarantee."
2627-
}
2628-
]
2629-
},
26302708
{
26312709
"name": "spring.jpa.hibernate.ddl-auto",
26322710
"values": [

spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ org.springframework.boot.autoconfigure.jdbc.JndiDataSourceAutoConfiguration
6767
org.springframework.boot.autoconfigure.jdbc.XADataSourceAutoConfiguration
6868
org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
6969
org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration
70-
org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration
71-
org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguration
7270
org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration
7371
org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration
7472
org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration

spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java

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.
@@ -22,7 +22,7 @@
2222
import org.messaginghub.pooled.jms.JmsPoolConnectionFactory;
2323

2424
import org.springframework.boot.autoconfigure.AutoConfigurations;
25-
import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration;
25+
import org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration;
2626
import org.springframework.boot.test.context.FilteredClassLoader;
2727
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
2828
import org.springframework.context.annotation.Bean;

0 commit comments

Comments
 (0)