From f78a6fa37a0d8996f7d2f9a2277726bc1911cd2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Tue, 18 Mar 2025 11:37:00 +0100 Subject: [PATCH] Create spring-boot-jms module --- settings.gradle | 1 + .../build.gradle | 3 +- .../spring-boot-actuator/build.gradle | 2 +- .../spring-boot-all/build.gradle | 5 - .../build.gradle | 1 + .../activemq/ActiveMQAutoConfiguration.java | 8 +- ...ctiveMQConnectionFactoryConfiguration.java | 4 +- .../jms/activemq/ActiveMQProperties.java | 2 +- .../jms/artemis/ArtemisAutoConfiguration.java | 8 +- ...ArtemisConnectionFactoryConfiguration.java | 4 +- .../jms/artemis/ArtemisProperties.java | 2 +- ...itional-spring-configuration-metadata.json | 146 ++++++++++++++---- ...ot.autoconfigure.AutoConfiguration.imports | 2 - .../ActiveMQAutoConfigurationTests.java | 4 +- .../ArtemisAutoConfigurationTests.java | 4 +- .../spring-boot-dependencies/build.gradle | 1 + .../spring-boot-docs/build.gradle | 3 + .../modules/how-to/pages/messaging.adoc | 2 +- .../reference/pages/messaging/jms.adoc | 2 +- .../MyJmsConfiguration.java | 4 +- .../receiving/custom/MyJmsConfiguration.java | 4 +- .../MyJmsConfiguration.kt | 2 +- .../receiving/custom/MyJmsConfiguration.kt | 2 +- .../spring-boot-jms/build.gradle | 28 ++++ .../boot/jms/ConnectionFactoryUnwrapper.java | 2 +- .../boot/jms/XAConnectionFactoryWrapper.java | 2 +- .../jms/autoconfigure}/AcknowledgeMode.java | 4 +- ...JmsListenerContainerFactoryConfigurer.java | 4 +- .../JmsAnnotationDrivenConfiguration.java | 2 +- .../autoconfigure}/JmsAutoConfiguration.java | 10 +- .../JmsPoolConnectionFactoryFactory.java | 4 +- .../JmsPoolConnectionFactoryProperties.java | 4 +- .../jms/autoconfigure}/JmsProperties.java | 2 +- ...ndiConnectionFactoryAutoConfiguration.java | 4 +- .../boot/jms/autoconfigure}/package-info.java | 2 +- .../boot/jms/package-info.java | 0 ...itional-spring-configuration-metadata.json | 40 +++++ ...ot.autoconfigure.AutoConfiguration.imports | 2 + .../jms/ConnectionFactoryUnwrapperTests.java | 2 +- .../autoconfigure}/AcknowledgeModeTests.java | 2 +- .../JmsAutoConfigurationTests.java | 2 +- .../autoconfigure}/JmsPropertiesTests.java | 4 +- ...nnectionFactoryAutoConfigurationTests.java | 4 +- .../spring-boot-starter-activemq/build.gradle | 2 +- .../spring-boot-starter-artemis/build.gradle | 2 +- .../spring-boot-testcontainers/build.gradle | 1 + ...nectionDetailsFactoryIntegrationTests.java | 4 +- ...nectionDetailsFactoryIntegrationTests.java | 4 +- ...nectionDetailsFactoryIntegrationTests.java | 4 +- 49 files changed, 252 insertions(+), 105 deletions(-) create mode 100644 spring-boot-project/spring-boot-jms/build.gradle rename spring-boot-project/{spring-boot-all => spring-boot-jms}/src/main/java/org/springframework/boot/jms/ConnectionFactoryUnwrapper.java (98%) rename spring-boot-project/{spring-boot-all => spring-boot-jms}/src/main/java/org/springframework/boot/jms/XAConnectionFactoryWrapper.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms => spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure}/AcknowledgeMode.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms => spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure}/DefaultJmsListenerContainerFactoryConfigurer.java (98%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms => spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure}/JmsAnnotationDrivenConfiguration.java (98%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms => spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure}/JmsAutoConfiguration.java (95%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms => spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure}/JmsPoolConnectionFactoryFactory.java (95%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms => spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure}/JmsPoolConnectionFactoryProperties.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms => spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure}/JmsProperties.java (99%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms => spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure}/JndiConnectionFactoryAutoConfiguration.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms => spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure}/package-info.java (92%) rename spring-boot-project/{spring-boot-all => spring-boot-jms}/src/main/java/org/springframework/boot/jms/package-info.java (100%) create mode 100644 spring-boot-project/spring-boot-jms/src/main/resources/META-INF/additional-spring-configuration-metadata.json create mode 100644 spring-boot-project/spring-boot-jms/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename spring-boot-project/{spring-boot-all => spring-boot-jms}/src/test/java/org/springframework/boot/jms/ConnectionFactoryUnwrapperTests.java (99%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms => spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure}/AcknowledgeModeTests.java (98%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms => spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure}/JmsAutoConfigurationTests.java (99%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms => spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure}/JmsPropertiesTests.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms => spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure}/JndiConnectionFactoryAutoConfigurationTests.java (97%) diff --git a/settings.gradle b/settings.gradle index 61136f099a..ddb3258e2d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -51,6 +51,7 @@ include "spring-boot-project:spring-boot-docker-compose" include "spring-boot-project:spring-boot-docs" include "spring-boot-project:spring-boot-jackson" include "spring-boot-project:spring-boot-jetty" +include "spring-boot-project:spring-boot-jms" include "spring-boot-project:spring-boot-jsonb" include "spring-boot-project:spring-boot-mail" include "spring-boot-project:spring-boot-parent" diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle index efeeebf430..3aa7c73c81 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -20,6 +20,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-amqp")) optional(project(":spring-boot-project:spring-boot-jackson")) optional(project(":spring-boot-project:spring-boot-jetty")) + optional(project(":spring-boot-project:spring-boot-jms")) optional(project(":spring-boot-project:spring-boot-jsonb")) optional(project(":spring-boot-project:spring-boot-mail")) optional(project(":spring-boot-project:spring-boot-reactor-netty")) @@ -71,7 +72,6 @@ dependencies { optional("io.r2dbc:r2dbc-proxy") optional("io.r2dbc:r2dbc-spi") optional("io.undertow:undertow-servlet") - optional("jakarta.jms:jakarta.jms-api") optional("jakarta.persistence:jakarta.persistence-api") optional("jakarta.servlet:jakarta.servlet-api") optional("javax.cache:cache-api") @@ -109,7 +109,6 @@ dependencies { optional("org.neo4j.driver:neo4j-java-driver") optional("org.quartz-scheduler:quartz") optional("org.springframework:spring-jdbc") - optional("org.springframework:spring-jms") optional("org.springframework:spring-messaging") optional("org.springframework:spring-webflux") optional("org.springframework:spring-webmvc") diff --git a/spring-boot-project/spring-boot-actuator/build.gradle b/spring-boot-project/spring-boot-actuator/build.gradle index 135ad0372a..c65a61ee71 100644 --- a/spring-boot-project/spring-boot-actuator/build.gradle +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -24,6 +24,7 @@ dependencies { dockerTestImplementation("org.testcontainers:testcontainers") optional(project(":spring-boot-project:spring-boot-jetty")) + optional(project(":spring-boot-project:spring-boot-jms")) optional(project(":spring-boot-project:spring-boot-jsonb")) optional(project(":spring-boot-project:spring-boot-reactor-netty")) optional(project(":spring-boot-project:spring-boot-tomcat")) @@ -49,7 +50,6 @@ dependencies { optional("io.r2dbc:r2dbc-spi") optional("io.undertow:undertow-servlet") optional("javax.cache:cache-api") - optional("jakarta.jms:jakarta.jms-api") optional("org.apache.tomcat.embed:tomcat-embed-core") optional("org.aspectj:aspectjweaver") optional("org.cache2k:cache2k-micrometer") diff --git a/spring-boot-project/spring-boot-all/build.gradle b/spring-boot-project/spring-boot-all/build.gradle index 4428572d46..a709a447a9 100644 --- a/spring-boot-project/spring-boot-all/build.gradle +++ b/spring-boot-project/spring-boot-all/build.gradle @@ -29,7 +29,6 @@ dependencies { optional("io.rsocket:rsocket-core") optional("io.rsocket:rsocket-transport-netty") optional("io.undertow:undertow-servlet") - optional("jakarta.jms:jakarta.jms-api") optional("jakarta.persistence:jakarta.persistence-api") optional("jakarta.servlet:jakarta.servlet-api") optional("jakarta.transaction:jakarta.transaction-api") @@ -57,15 +56,11 @@ dependencies { optional("org.liquibase:liquibase-core") { exclude(group: "javax.xml.bind", module: "jaxb-api") } - optional("org.messaginghub:pooled-jms") { - exclude group: "org.apache.geronimo.specs", module: "geronimo-jms_2.0_spec" - } optional("org.postgresql:postgresql") optional("org.slf4j:jul-to-slf4j") optional("org.slf4j:slf4j-api") optional("org.springframework:spring-messaging") optional("org.springframework:spring-orm") - optional("org.springframework:spring-jms") optional("org.springframework:spring-oxm") optional("org.springframework:spring-r2dbc") optional("org.springframework:spring-test") diff --git a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle index 4cf0c3b9ce..7557142ac1 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle @@ -44,6 +44,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-jackson")) optional(project(":spring-boot-project:spring-boot-jsonb")) + optional(project(":spring-boot-project:spring-boot-jms")) optional(project(":spring-boot-project:spring-boot-reactor-netty")) optional(project(":spring-boot-project:spring-boot-tomcat")) optional("co.elastic.clients:elasticsearch-java") diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfiguration.java index 7f68e8acf6..938168e741 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,10 +23,10 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration; -import org.springframework.boot.autoconfigure.jms.JmsProperties; -import org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration; +import org.springframework.boot.jms.autoconfigure.JmsProperties; +import org.springframework.boot.jms.autoconfigure.JndiConnectionFactoryAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryConfiguration.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryConfiguration.java index 01a3c82825..629ba92acd 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryConfiguration.java @@ -25,8 +25,8 @@ import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.jms.JmsPoolConnectionFactoryFactory; -import org.springframework.boot.autoconfigure.jms.JmsProperties; +import org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryFactory; +import org.springframework.boot.jms.autoconfigure.JmsProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jms.connection.CachingConnectionFactory; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java index b1cb52cc27..cb1156c495 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java @@ -20,9 +20,9 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; -import org.springframework.boot.autoconfigure.jms.JmsPoolConnectionFactoryProperties; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.NestedConfigurationProperty; +import org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties; /** * Configuration properties for ActiveMQ. diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfiguration.java index 8545a70f90..260e0d553a 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,10 +23,10 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration; -import org.springframework.boot.autoconfigure.jms.JmsProperties; -import org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration; +import org.springframework.boot.jms.autoconfigure.JmsProperties; +import org.springframework.boot.jms.autoconfigure.JndiConnectionFactoryAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisConnectionFactoryConfiguration.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisConnectionFactoryConfiguration.java index 5ffa5ae225..e5dc50868b 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisConnectionFactoryConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisConnectionFactoryConfiguration.java @@ -25,8 +25,8 @@ import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.jms.JmsPoolConnectionFactoryFactory; -import org.springframework.boot.autoconfigure.jms.JmsProperties; +import org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryFactory; +import org.springframework.boot.jms.autoconfigure.JmsProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jms.connection.CachingConnectionFactory; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisProperties.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisProperties.java index 5447ededf2..77c97dcfc2 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisProperties.java @@ -23,9 +23,9 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants; -import org.springframework.boot.autoconfigure.jms.JmsPoolConnectionFactoryProperties; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.NestedConfigurationProperty; +import org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties; /** * Configuration properties for Artemis. diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 6f85ed7a71..58eaacbd71 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -1,6 +1,20 @@ { "groups": [], "properties": [ + { + "name": "spring.activemq.pool.block-if-full", + "type": "java.lang.Boolean", + "description": "Whether to block when a connection is requested and the pool is full. Set it to false to throw a \"JMSException\" instead.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": true + }, + { + "name": "spring.activemq.pool.block-if-full-timeout", + "type": "java.time.Duration", + "description": "Blocking period before throwing an exception if the pool is still full.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": "-1ms" + }, { "name": "spring.activemq.pool.create-connection-on-startup", "type": "java.lang.Boolean", @@ -10,6 +24,13 @@ "level": "error" } }, + { + "name": "spring.activemq.pool.enabled", + "type": "java.lang.Boolean", + "description": "Whether a JmsPoolConnectionFactory should be created, instead of a regular ConnectionFactory.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": false + }, { "name": "spring.activemq.pool.expiry-timeout", "type": "java.time.Duration", @@ -19,6 +40,27 @@ "level": "error" } }, + { + "name": "spring.activemq.pool.idle-timeout", + "type": "java.time.Duration", + "description": "Connection idle timeout.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": "30s" + }, + { + "name": "spring.activemq.pool.max-connections", + "type": "java.lang.Integer", + "description": "Maximum number of pooled connections.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": 1 + }, + { + "name": "spring.activemq.pool.max-sessions-per-connection", + "type": "java.lang.Integer", + "description": "Maximum number of pooled sessions per connection in the pool.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": 500 + }, { "name": "spring.activemq.pool.maximum-active-session-per-connection", "deprecation": { @@ -34,6 +76,20 @@ "level": "error" } }, + { + "name": "spring.activemq.pool.time-between-expiration-check", + "type": "java.time.Duration", + "description": "Time to sleep between runs of the idle connection eviction thread. When negative, no idle connection eviction thread runs.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": "-1ms" + }, + { + "name": "spring.activemq.pool.use-anonymous-producers", + "type": "java.lang.Boolean", + "description": "Whether to use only one anonymous \"MessageProducer\" instance. Set it to false to create one \"MessageProducer\" every time one is required.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": true + }, { "name": "spring.aop.auto", "type": "java.lang.Boolean", @@ -58,12 +114,68 @@ "level": "error" } }, + { + "name": "spring.artemis.pool.block-if-full", + "type": "java.lang.Boolean", + "description": "Whether to block when a connection is requested and the pool is full. Set it to false to throw a \"JMSException\" instead.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": true + }, + { + "name": "spring.artemis.pool.block-if-full-timeout", + "type": "java.time.Duration", + "description": "Blocking period before throwing an exception if the pool is still full.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": "-1ms" + }, + { + "name": "spring.artemis.pool.enabled", + "type": "java.lang.Boolean", + "description": "Whether a JmsPoolConnectionFactory should be created, instead of a regular ConnectionFactory.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": false + }, + { + "name": "spring.artemis.pool.idle-timeout", + "type": "java.time.Duration", + "description": "Connection idle timeout.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": "30s" + }, + { + "name": "spring.artemis.pool.max-connections", + "type": "java.lang.Integer", + "description": "Maximum number of pooled connections.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": 1 + }, + { + "name": "spring.artemis.pool.max-sessions-per-connection", + "type": "java.lang.Integer", + "description": "Maximum number of pooled sessions per connection in the pool.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": 500 + }, { "name": "spring.artemis.pool.maximum-active-session-per-connection", "deprecation": { "replacement": "spring.artemis.pool.max-sessions-per-connection" } }, + { + "name": "spring.artemis.pool.time-between-expiration-check", + "type": "java.time.Duration", + "description": "Time to sleep between runs of the idle connection eviction thread. When negative, no idle connection eviction thread runs.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": "-1ms" + }, + { + "name": "spring.artemis.pool.use-anonymous-producers", + "type": "java.lang.Boolean", + "description": "Whether to use only one anonymous \"MessageProducer\" instance. Set it to false to create one \"MessageProducer\" every time one is required.", + "sourceType": "org.springframework.boot.jms.autoconfigure.JmsPoolConnectionFactoryProperties", + "defaultValue": true + }, { "name": "spring.artemis.port", "type": "java.lang.Integer", @@ -2606,40 +2718,6 @@ } ] }, - { - "name": "spring.jms.listener.session.acknowledge-mode", - "values": [ - { - "value": "auto", - "description": "Messages sent or received from the session are automatically acknowledged. This is the simplest mode and enables once-only message delivery guarantee." - }, - { - "value": "client", - "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." - }, - { - "value": "dups_ok", - "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." - } - ] - }, - { - "name": "spring.jms.template.session.acknowledge-mode", - "values": [ - { - "value": "auto", - "description": "Messages sent or received from the session are automatically acknowledged. This is the simplest mode and enables once-only message delivery guarantee." - }, - { - "value": "client", - "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." - }, - { - "value": "dups_ok", - "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." - } - ] - }, { "name": "spring.jpa.hibernate.ddl-auto", "values": [ diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 3ee1f9d80a..373376404a 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -70,8 +70,6 @@ org.springframework.boot.autoconfigure.jdbc.JndiDataSourceAutoConfiguration org.springframework.boot.autoconfigure.jdbc.XADataSourceAutoConfiguration org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration -org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration -org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguration org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java index b6f31fbf77..c53407b6ed 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test; import org.messaginghub.pooled.jms.JmsPoolConnectionFactory; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration; +import org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration; import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java index cbf31a98aa..e69a5ac51d 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,8 +47,8 @@ import org.junit.jupiter.api.io.TempDir; import org.messaginghub.pooled.jms.JmsPoolConnectionFactory; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration; import org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration.PropertiesArtemisConnectionDetails; +import org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration; import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.assertj.AssertableApplicationContext; import org.springframework.boot.test.context.runner.ApplicationContextRunner; diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 0c133abd09..9fbecb5833 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -1987,6 +1987,7 @@ bom { "spring-boot-jackson", "spring-boot-jarmode-tools", "spring-boot-jetty", + "spring-boot-jms", "spring-boot-jsonb", "spring-boot-loader", "spring-boot-loader-classic", diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle index 13ede03df1..5ed469c7d5 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -66,6 +66,7 @@ dependencies { autoConfiguration(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-jackson", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-jetty", configuration: "autoConfigurationMetadata")) + autoConfiguration(project(path: ":spring-boot-project:spring-boot-jms", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-jsonb", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-mail", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "autoConfigurationMetadata")) @@ -83,6 +84,7 @@ dependencies { configurationProperties(project(path: ":spring-boot-project:spring-boot-docker-compose", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-jackson", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-jetty", configuration: "configurationPropertiesMetadata")) + configurationProperties(project(path: ":spring-boot-project:spring-boot-jms", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-mail", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-test-autoconfigure", configuration: "configurationPropertiesMetadata")) @@ -100,6 +102,7 @@ dependencies { implementation(project(path: ":spring-boot-project:spring-boot-devtools")) implementation(project(path: ":spring-boot-project:spring-boot-docker-compose")) implementation(project(path: ":spring-boot-project:spring-boot-jackson")) + implementation(project(path: ":spring-boot-project:spring-boot-jms")) implementation(project(path: ":spring-boot-project:spring-boot-jsonb")) implementation(project(path: ":spring-boot-project:spring-boot-reactor-netty")) implementation(project(path: ":spring-boot-project:spring-boot-test")) diff --git a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/messaging.adoc b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/messaging.adoc index 1edd9a2e3c..b3b7d9cb3b 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/messaging.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/messaging.adoc @@ -11,7 +11,7 @@ This section answers questions that arise from using messaging with Spring Boot. If your JMS broker does not support transacted sessions, you have to disable the support of transactions altogether. If you create your own javadoc:org.springframework.jms.config.JmsListenerContainerFactory[], there is nothing to do, since, by default it cannot be transacted. -If you want to use the javadoc:org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer[] to reuse Spring Boot's default, you can disable transacted sessions, as follows: +If you want to use the javadoc:org.springframework.boot.jms.autoconfigure.DefaultJmsListenerContainerFactoryConfigurer[] to reuse Spring Boot's default, you can disable transacted sessions, as follows: include-code::MyJmsConfiguration[] diff --git a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/messaging/jms.adoc b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/messaging/jms.adoc index f90e049028..7076811b57 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/messaging/jms.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/messaging/jms.adoc @@ -180,7 +180,7 @@ include-code::MyBean[] TIP: See the javadoc:org.springframework.jms.annotation.EnableJms[format=annotation] API documentation for more details. -If you need to create more javadoc:org.springframework.jms.config.JmsListenerContainerFactory[] instances or if you want to override the default, Spring Boot provides a javadoc:org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer[] that you can use to initialize a javadoc:org.springframework.jms.config.DefaultJmsListenerContainerFactory[] with the same settings as the one that is auto-configured. +If you need to create more javadoc:org.springframework.jms.config.JmsListenerContainerFactory[] instances or if you want to override the default, Spring Boot provides a javadoc:org.springframework.boot.jms.autoconfigure.DefaultJmsListenerContainerFactoryConfigurer[] that you can use to initialize a javadoc:org.springframework.jms.config.DefaultJmsListenerContainerFactory[] with the same settings as the one that is auto-configured. For instance, the following example exposes another factory that uses a specific javadoc:org.springframework.jms.support.converter.MessageConverter[]: diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/messaging/disabletransactedjmssession/MyJmsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/messaging/disabletransactedjmssession/MyJmsConfiguration.java index c033190a73..7df431d67c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/messaging/disabletransactedjmssession/MyJmsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/messaging/disabletransactedjmssession/MyJmsConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ package org.springframework.boot.docs.howto.messaging.disabletransactedjmssessio import jakarta.jms.ConnectionFactory; -import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer; import org.springframework.boot.jms.ConnectionFactoryUnwrapper; +import org.springframework.boot.jms.autoconfigure.DefaultJmsListenerContainerFactoryConfigurer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jms.config.DefaultJmsListenerContainerFactory; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/jms/receiving/custom/MyJmsConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/jms/receiving/custom/MyJmsConfiguration.java index 7261056cb2..216e5d5bce 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/jms/receiving/custom/MyJmsConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/messaging/jms/receiving/custom/MyJmsConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ package org.springframework.boot.docs.messaging.jms.receiving.custom; import jakarta.jms.ConnectionFactory; -import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer; import org.springframework.boot.jms.ConnectionFactoryUnwrapper; +import org.springframework.boot.jms.autoconfigure.DefaultJmsListenerContainerFactoryConfigurer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jms.config.DefaultJmsListenerContainerFactory; diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/messaging/disabletransactedjmssession/MyJmsConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/messaging/disabletransactedjmssession/MyJmsConfiguration.kt index 413b2356c7..d8f537b499 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/messaging/disabletransactedjmssession/MyJmsConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/messaging/disabletransactedjmssession/MyJmsConfiguration.kt @@ -18,7 +18,7 @@ package org.springframework.boot.docs.howto.messaging.disabletransactedjmssessio import jakarta.jms.ConnectionFactory import org.springframework.boot.jms.ConnectionFactoryUnwrapper -import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer +import org.springframework.boot.jms.autoconfigure.DefaultJmsListenerContainerFactoryConfigurer import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.jms.config.DefaultJmsListenerContainerFactory diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/messaging/jms/receiving/custom/MyJmsConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/messaging/jms/receiving/custom/MyJmsConfiguration.kt index 6add105e04..157b775502 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/messaging/jms/receiving/custom/MyJmsConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/messaging/jms/receiving/custom/MyJmsConfiguration.kt @@ -17,8 +17,8 @@ package org.springframework.boot.docs.messaging.jms.receiving.custom import jakarta.jms.ConnectionFactory -import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer import org.springframework.boot.jms.ConnectionFactoryUnwrapper +import org.springframework.boot.jms.autoconfigure.DefaultJmsListenerContainerFactoryConfigurer import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.jms.config.DefaultJmsListenerContainerFactory diff --git a/spring-boot-project/spring-boot-jms/build.gradle b/spring-boot-project/spring-boot-jms/build.gradle new file mode 100644 index 0000000000..e476981adc --- /dev/null +++ b/spring-boot-project/spring-boot-jms/build.gradle @@ -0,0 +1,28 @@ +plugins { + id "java-library" + id "org.springframework.boot.auto-configuration" + id "org.springframework.boot.configuration-properties" + id "org.springframework.boot.deployed" + id "org.springframework.boot.optional-dependencies" +} + +description = "Spring Boot JMS" + +dependencies { + api(project(":spring-boot-project:spring-boot")) + api("jakarta.jms:jakarta.jms-api") + api("org.springframework:spring-jms") + + optional(project(":spring-boot-project:spring-boot-autoconfigure")) + optional("jakarta.transaction:jakarta.transaction-api") + optional("org.messaginghub:pooled-jms") { + exclude group: "org.apache.geronimo.specs", module: "geronimo-jms_2.0_spec" + } + optional("org.springframework:spring-jdbc") + + testImplementation(project(":spring-boot-project:spring-boot-test")) + testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure"))) + + testRuntimeOnly("ch.qos.logback:logback-classic") +} diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/jms/ConnectionFactoryUnwrapper.java b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/ConnectionFactoryUnwrapper.java similarity index 98% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/jms/ConnectionFactoryUnwrapper.java rename to spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/ConnectionFactoryUnwrapper.java index 79945ec9d8..1c4f196d02 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/jms/ConnectionFactoryUnwrapper.java +++ b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/ConnectionFactoryUnwrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/jms/XAConnectionFactoryWrapper.java b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/XAConnectionFactoryWrapper.java similarity index 96% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/jms/XAConnectionFactoryWrapper.java rename to spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/XAConnectionFactoryWrapper.java index d93dfa62c8..45d9382d15 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/jms/XAConnectionFactoryWrapper.java +++ b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/XAConnectionFactoryWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/AcknowledgeMode.java b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/AcknowledgeMode.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/AcknowledgeMode.java rename to spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/AcknowledgeMode.java index f3c3240d7e..89dbd97e09 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/AcknowledgeMode.java +++ b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/AcknowledgeMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.jms; +package org.springframework.boot.jms.autoconfigure; import java.util.HashMap; import java.util.Map; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/DefaultJmsListenerContainerFactoryConfigurer.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java rename to spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/DefaultJmsListenerContainerFactoryConfigurer.java index 6a9f6dd7e7..fee743bd4c 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java +++ b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/DefaultJmsListenerContainerFactoryConfigurer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.jms; +package org.springframework.boot.jms.autoconfigure; import java.time.Duration; @@ -22,8 +22,8 @@ import io.micrometer.observation.ObservationRegistry; import jakarta.jms.ConnectionFactory; import jakarta.jms.ExceptionListener; -import org.springframework.boot.autoconfigure.jms.JmsProperties.Listener.Session; import org.springframework.boot.context.properties.PropertyMapper; +import org.springframework.boot.jms.autoconfigure.JmsProperties.Listener.Session; import org.springframework.jms.config.DefaultJmsListenerContainerFactory; import org.springframework.jms.support.converter.MessageConverter; import org.springframework.jms.support.destination.DestinationResolver; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsAnnotationDrivenConfiguration.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java rename to spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsAnnotationDrivenConfiguration.java index ef7bf0f48d..4ef50011a8 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java +++ b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsAnnotationDrivenConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.jms; +package org.springframework.boot.jms.autoconfigure; import io.micrometer.observation.ObservationRegistry; import jakarta.jms.ConnectionFactory; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfiguration.java b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsAutoConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfiguration.java rename to spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsAutoConfiguration.java index 44b049a657..4f72881be1 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.jms; +package org.springframework.boot.jms.autoconfigure; import java.time.Duration; import java.util.List; @@ -34,11 +34,11 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate; -import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration.JmsRuntimeHints; -import org.springframework.boot.autoconfigure.jms.JmsProperties.DeliveryMode; -import org.springframework.boot.autoconfigure.jms.JmsProperties.Template; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.PropertyMapper; +import org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration.JmsRuntimeHints; +import org.springframework.boot.jms.autoconfigure.JmsProperties.DeliveryMode; +import org.springframework.boot.jms.autoconfigure.JmsProperties.Template; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsPoolConnectionFactoryFactory.java b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsPoolConnectionFactoryFactory.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsPoolConnectionFactoryFactory.java rename to spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsPoolConnectionFactoryFactory.java index 40bff93c3e..3aa695f4fc 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsPoolConnectionFactoryFactory.java +++ b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsPoolConnectionFactoryFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.jms; +package org.springframework.boot.jms.autoconfigure; import jakarta.jms.ConnectionFactory; import org.messaginghub.pooled.jms.JmsPoolConnectionFactory; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsPoolConnectionFactoryProperties.java b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsPoolConnectionFactoryProperties.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsPoolConnectionFactoryProperties.java rename to spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsPoolConnectionFactoryProperties.java index 6eed0f5268..38cacb1fe1 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsPoolConnectionFactoryProperties.java +++ b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsPoolConnectionFactoryProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.jms; +package org.springframework.boot.jms.autoconfigure; import java.time.Duration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsProperties.java similarity index 99% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java rename to spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsProperties.java index b64b2a258a..8e9723780a 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java +++ b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsProperties.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.jms; +package org.springframework.boot.jms.autoconfigure; import java.time.Duration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JndiConnectionFactoryAutoConfiguration.java b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JndiConnectionFactoryAutoConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JndiConnectionFactoryAutoConfiguration.java rename to spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JndiConnectionFactoryAutoConfiguration.java index 0475a4fe3b..fc432377e1 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/JndiConnectionFactoryAutoConfiguration.java +++ b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JndiConnectionFactoryAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.jms; +package org.springframework.boot.jms.autoconfigure; import java.util.Arrays; @@ -29,8 +29,8 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnJndi; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguration.JndiOrPropertyCondition; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.jms.autoconfigure.JndiConnectionFactoryAutoConfiguration.JndiOrPropertyCondition; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; import org.springframework.jms.core.JmsTemplate; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/package-info.java b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/package-info.java similarity index 92% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/package-info.java rename to spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/package-info.java index 46e6fad126..4977af6894 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/jms/package-info.java +++ b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/package-info.java @@ -17,4 +17,4 @@ /** * Auto-configuration for JMS. */ -package org.springframework.boot.autoconfigure.jms; +package org.springframework.boot.jms.autoconfigure; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/jms/package-info.java b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/package-info.java similarity index 100% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/jms/package-info.java rename to spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/package-info.java diff --git a/spring-boot-project/spring-boot-jms/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-jms/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 0000000000..b5640fe38b --- /dev/null +++ b/spring-boot-project/spring-boot-jms/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,40 @@ +{ + "groups": [], + "properties": [], + "hints": [ + { + "name": "spring.jms.listener.session.acknowledge-mode", + "values": [ + { + "value": "auto", + "description": "Messages sent or received from the session are automatically acknowledged. This is the simplest mode and enables once-only message delivery guarantee." + }, + { + "value": "client", + "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." + }, + { + "value": "dups_ok", + "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." + } + ] + }, + { + "name": "spring.jms.template.session.acknowledge-mode", + "values": [ + { + "value": "auto", + "description": "Messages sent or received from the session are automatically acknowledged. This is the simplest mode and enables once-only message delivery guarantee." + }, + { + "value": "client", + "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." + }, + { + "value": "dups_ok", + "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." + } + ] + } + ] +} diff --git a/spring-boot-project/spring-boot-jms/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-jms/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000000..0070f989ad --- /dev/null +++ b/spring-boot-project/spring-boot-jms/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,2 @@ +org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration +org.springframework.boot.jms.autoconfigure.JndiConnectionFactoryAutoConfiguration diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/jms/ConnectionFactoryUnwrapperTests.java b/spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/ConnectionFactoryUnwrapperTests.java similarity index 99% rename from spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/jms/ConnectionFactoryUnwrapperTests.java rename to spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/ConnectionFactoryUnwrapperTests.java index 5a65cfde8f..4c8ed999cf 100644 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/jms/ConnectionFactoryUnwrapperTests.java +++ b/spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/ConnectionFactoryUnwrapperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/AcknowledgeModeTests.java b/spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure/AcknowledgeModeTests.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/AcknowledgeModeTests.java rename to spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure/AcknowledgeModeTests.java index bdfba2ef24..545861d546 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/AcknowledgeModeTests.java +++ b/spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure/AcknowledgeModeTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.jms; +package org.springframework.boot.jms.autoconfigure; import jakarta.jms.Session; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java b/spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure/JmsAutoConfigurationTests.java similarity index 99% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java rename to spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure/JmsAutoConfigurationTests.java index f401349871..680e4694b7 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure/JmsAutoConfigurationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.jms; +package org.springframework.boot.jms.autoconfigure; import io.micrometer.observation.ObservationRegistry; import jakarta.jms.ConnectionFactory; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/JmsPropertiesTests.java b/spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure/JmsPropertiesTests.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/JmsPropertiesTests.java rename to spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure/JmsPropertiesTests.java index 32b93708dc..9db23962af 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/JmsPropertiesTests.java +++ b/spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure/JmsPropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.jms; +package org.springframework.boot.jms.autoconfigure; import java.time.Duration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/JndiConnectionFactoryAutoConfigurationTests.java b/spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure/JndiConnectionFactoryAutoConfigurationTests.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/JndiConnectionFactoryAutoConfigurationTests.java rename to spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure/JndiConnectionFactoryAutoConfigurationTests.java index f6f8d9351a..299459ea5f 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/jms/JndiConnectionFactoryAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/autoconfigure/JndiConnectionFactoryAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.jms; +package org.springframework.boot.jms.autoconfigure; import javax.naming.Context; diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-activemq/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-activemq/build.gradle index 72f13cd35d..a915397f64 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-activemq/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-activemq/build.gradle @@ -6,6 +6,6 @@ description = "Starter for JMS messaging using Apache ActiveMQ" dependencies { api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter")) - api("org.springframework:spring-jms") + api(project(":spring-boot-project:spring-boot-jms")) api("org.apache.activemq:activemq-client") } diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/build.gradle index 60905defcf..6c27e66867 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/build.gradle @@ -6,6 +6,6 @@ description = "Starter for JMS messaging using Apache Artemis" dependencies { api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter")) - api("org.springframework:spring-jms") + api(project(":spring-boot-project:spring-boot-jms")) api("org.apache.activemq:artemis-jakarta-client") } diff --git a/spring-boot-project/spring-boot-testcontainers/build.gradle b/spring-boot-project/spring-boot-testcontainers/build.gradle index 7af3e16e12..243eac3fe7 100644 --- a/spring-boot-project/spring-boot-testcontainers/build.gradle +++ b/spring-boot-project/spring-boot-testcontainers/build.gradle @@ -13,6 +13,7 @@ dependencies { api(project(":spring-boot-project:spring-boot-autoconfigure-all")) api("org.testcontainers:testcontainers") + dockerTestImplementation(project(":spring-boot-project:spring-boot-jms")) dockerTestImplementation(project(":spring-boot-project:spring-boot-test")) dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker")) dockerTestImplementation("ch.qos.logback:logback-classic") diff --git a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/activemq/ActiveMQClassicContainerConnectionDetailsFactoryIntegrationTests.java b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/activemq/ActiveMQClassicContainerConnectionDetailsFactoryIntegrationTests.java index daa37e14f1..6b0d1b94e2 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/activemq/ActiveMQClassicContainerConnectionDetailsFactoryIntegrationTests.java +++ b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/activemq/ActiveMQClassicContainerConnectionDetailsFactoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration; import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration; +import org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration; import org.springframework.boot.testcontainers.service.connection.ServiceConnection; import org.springframework.boot.testsupport.container.TestImage; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/activemq/ActiveMQContainerConnectionDetailsFactoryIntegrationTests.java b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/activemq/ActiveMQContainerConnectionDetailsFactoryIntegrationTests.java index c53c3e3ad9..d54a25c152 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/activemq/ActiveMQContainerConnectionDetailsFactoryIntegrationTests.java +++ b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/activemq/ActiveMQContainerConnectionDetailsFactoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,8 +27,8 @@ import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration; import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration; +import org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration; import org.springframework.boot.testcontainers.service.connection.ServiceConnection; import org.springframework.boot.testsupport.container.SymptomaActiveMQContainer; import org.springframework.boot.testsupport.container.TestImage; diff --git a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/activemq/ArtemisContainerConnectionDetailsFactoryIntegrationTests.java b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/activemq/ArtemisContainerConnectionDetailsFactoryIntegrationTests.java index e1b8c7ae5f..4d0280dae5 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/activemq/ArtemisContainerConnectionDetailsFactoryIntegrationTests.java +++ b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/activemq/ArtemisContainerConnectionDetailsFactoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration; import org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration; +import org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration; import org.springframework.boot.testcontainers.service.connection.ServiceConnection; import org.springframework.boot.testsupport.container.TestImage; import org.springframework.context.annotation.Bean;