diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQAutoConfiguration.java index af703e14e8..3c59613341 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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. @@ -41,6 +41,7 @@ import org.springframework.context.annotation.Import; * @author Phillip Webb * @since 1.1.0 * @see HornetQProperties + * @deprecated as of 1.4 in favor of the artemis support */ @Configuration @AutoConfigureBefore(JmsAutoConfiguration.class) @@ -51,6 +52,7 @@ import org.springframework.context.annotation.Import; @Import({ HornetQEmbeddedServerConfiguration.class, HornetQXAConnectionFactoryConfiguration.class, HornetQConnectionFactoryConfiguration.class }) +@Deprecated public class HornetQAutoConfiguration { } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQConfigurationCustomizer.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQConfigurationCustomizer.java index 53676f97d0..234b59c5f6 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQConfigurationCustomizer.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQConfigurationCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2016 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,7 +27,9 @@ import org.hornetq.jms.server.embedded.EmbeddedJMS; * @author Phillip Webb * @since 1.1.0 * @see HornetQAutoConfiguration + * @deprecated as of 1.4 in favor of the artemis support */ +@Deprecated public interface HornetQConfigurationCustomizer { /** diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQConnectionFactoryConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQConnectionFactoryConfiguration.java index e14c245530..e31dbb10fd 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQConnectionFactoryConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQConnectionFactoryConfiguration.java @@ -30,9 +30,11 @@ import org.springframework.context.annotation.Configuration; * * @author Phillip Webb * @since 1.2.0 + * @deprecated as of 1.4 in favor of the artemis support */ @Configuration @ConditionalOnMissingBean(ConnectionFactory.class) +@Deprecated class HornetQConnectionFactoryConfiguration { @Bean diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQConnectionFactoryFactory.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQConnectionFactoryFactory.java index 637fbe3be4..0650ffffcb 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQConnectionFactoryFactory.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQConnectionFactoryFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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. @@ -40,7 +40,9 @@ import org.springframework.util.ClassUtils; * @author Phillip Webb * @author Stephane Nicoll * @since 1.2.0 + * @deprecated as of 1.4 in favor of the artemis support */ +@Deprecated class HornetQConnectionFactoryFactory { static final String EMBEDDED_JMS_CLASS = "org.hornetq.jms.server.embedded.EmbeddedJMS"; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQEmbeddedConfigurationFactory.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQEmbeddedConfigurationFactory.java index 79d27b89df..ecd6c888f7 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQEmbeddedConfigurationFactory.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQEmbeddedConfigurationFactory.java @@ -34,7 +34,9 @@ import org.springframework.boot.autoconfigure.jms.hornetq.HornetQProperties.Embe * @author Stephane Nicoll * @author Phillip Webb * @since 1.1.0 + * @deprecated as of 1.4 in favor of the artemis support */ +@Deprecated class HornetQEmbeddedConfigurationFactory { private static final Log logger = LogFactory diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQEmbeddedServerConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQEmbeddedServerConfiguration.java index 319e3a51ed..2f04417abe 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQEmbeddedServerConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQEmbeddedServerConfiguration.java @@ -41,10 +41,12 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator; * @author Phillip Webb * @author Stephane Nicoll * @since 1.2.0 + * @deprecated as of 1.4 in favor of the artemis support */ @Configuration @ConditionalOnClass(name = HornetQConnectionFactoryFactory.EMBEDDED_JMS_CLASS) @ConditionalOnProperty(prefix = "spring.hornetq.embedded", name = "enabled", havingValue = "true", matchIfMissing = true) +@Deprecated class HornetQEmbeddedServerConfiguration { private final HornetQProperties properties; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQMode.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQMode.java index a405fc268a..1078db50ed 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQMode.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2016 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. @@ -21,7 +21,9 @@ package org.springframework.boot.autoconfigure.jms.hornetq; * * @author Stephane Nicoll * @since 1.1.0 + * @deprecated as of 1.4 in favor of the artemis support */ +@Deprecated public enum HornetQMode { /** diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQNoOpBindingRegistry.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQNoOpBindingRegistry.java index 1a8777a6de..35aae067a8 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQNoOpBindingRegistry.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQNoOpBindingRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2016 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,7 +23,9 @@ import org.hornetq.spi.core.naming.BindingRegistry; * * @author Stephane Nicoll * @since 1.1.0 + * @deprecated as of 1.4 in favor of the artemis support */ +@Deprecated public class HornetQNoOpBindingRegistry implements BindingRegistry { @Override diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQProperties.java index e5512db1cf..1181bca199 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQProperties.java @@ -30,8 +30,10 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * * @author Stephane Nicoll * @since 1.1.0 + * @deprecated as of 1.4 in favor of the artemis support */ @ConfigurationProperties(prefix = "spring.hornetq") +@Deprecated public class HornetQProperties { /** diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQXAConnectionFactoryConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQXAConnectionFactoryConfiguration.java index 0175a080a1..2e19cae4e9 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQXAConnectionFactoryConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQXAConnectionFactoryConfiguration.java @@ -35,11 +35,13 @@ import org.springframework.context.annotation.Primary; * * @author Phillip Webb * @since 1.2.0 + * @deprecated as of 1.4 in favor of the artemis support */ @Configuration @ConditionalOnMissingBean(ConnectionFactory.class) @ConditionalOnClass(TransactionManager.class) @ConditionalOnBean(XAConnectionFactoryWrapper.class) +@Deprecated class HornetQXAConnectionFactoryConfiguration { @Primary diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/SpringBootHornetQConnectionFactory.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/SpringBootHornetQConnectionFactory.java index d39c162f03..c0541108ed 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/SpringBootHornetQConnectionFactory.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/SpringBootHornetQConnectionFactory.java @@ -30,7 +30,9 @@ import org.springframework.util.StringUtils; * * @author Stéphane Lagraulet * @author Stephane Nicoll + * @deprecated as of 1.4 in favor of the artemis support */ +@Deprecated class SpringBootHornetQConnectionFactory extends HornetQConnectionFactory { private final HornetQProperties properties; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/SpringBootHornetQXAConnectionFactory.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/SpringBootHornetQXAConnectionFactory.java index a94658d26b..ea7768f91d 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/SpringBootHornetQXAConnectionFactory.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/SpringBootHornetQXAConnectionFactory.java @@ -30,7 +30,9 @@ import org.springframework.util.StringUtils; * * @author Stéphane Lagraulet * @author Stephane Nicoll + * @deprecated as of 1.4 in favor of the artemis support */ +@Deprecated class SpringBootHornetQXAConnectionFactory extends HornetQXAConnectionFactory { private final HornetQProperties properties; diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQAutoConfigurationTests.java index 76b3a87739..2a0795fae0 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQAutoConfigurationTests.java @@ -65,6 +65,8 @@ import static org.mockito.Mockito.spy; * * @author Stephane Nicoll */ +@Deprecated +@SuppressWarnings("deprecation") public class HornetQAutoConfigurationTests { @Rule diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQEmbeddedConfigurationFactoryTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQEmbeddedConfigurationFactoryTests.java index 7cfe9b01f9..8268b7b125 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQEmbeddedConfigurationFactoryTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQEmbeddedConfigurationFactoryTests.java @@ -28,6 +28,8 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Stephane Nicoll * @author Phillip Webb */ +@Deprecated +@SuppressWarnings("deprecation") public class HornetQEmbeddedConfigurationFactoryTests { @Test diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index aa7057baaa..910c8fcfed 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -3963,15 +3963,53 @@ resolved against their provided names. [[boot-features-artemis]] ==== Artemis support -Apache Artemis was formed in 2015 when HornetQ was donated to the Apache Foundation. All -the features listed in the <> section below can be applied to -Artemis. Simply replace `+++spring.hornetq.*+++` properties with `+++spring.artemis.*+++` -and use `spring-boot-starter-artemis` instead of `spring-boot-starter-hornetq`. If you -want to embed Artemis, make sure to add `org.apache.activemq:artemis-jms-server` to the -dependencies of your application. +Apache Artemis was formed in 2015 when HornetQ was donated to the Apache Foundation. Make +sure to use that rather than the deprecated HornetQ support. NOTE: You should not try and use Artemis and HornetQ and the same time. +Spring Boot can auto-configure a `ConnectionFactory` when it detects that Artemis is +available on the classpath. If the broker is present, an embedded broker is started and +configured automatically (unless the mode property has been explicitly set). The supported +modes are: `embedded` (to make explicit that an embedded broker is required and should +lead to an error if the broker is not available in the classpath), and `native` to connect +to a broker using the `netty` transport protocol. When the latter is configured, Spring +Boot configures a `ConnectionFactory` connecting to a broker running on the local machine +with the default settings. + +NOTE: If you are using `spring-boot-starter-artemis` the necessary dependencies to +connect to an existing Artemis instance are provided, as well as the Spring infrastructure +to integrate with JMS. Adding `org.apache.activemq:artemis-jms-server` to your application +allows you to use the embedded mode. + +Artemis configuration is controlled by external configuration properties in +`+spring.artemis.*+`. For example, you might declare the following section in +`application.properties`: + +[source,properties,indent=0] +---- + spring.artemis.mode=native + spring.artemis.host=192.168.1.210 + spring.artemis.port=9876 + spring.artemis.user=admin + spring.artemis.password=secret +---- + +When embedding the broker, you can choose if you want to enable persistence, and the list +of destinations that should be made available. These can be specified as a comma-separated +list to create them with the default options; or you can define bean(s) of type +`org.apache.activemq.artemis.jms.server.config.JMSQueueConfiguration` or +`org.apache.activemq.artemis.jms.server.config.TopicConfiguration`, for advanced queue and +topic configurations respectively. + +See +{sc-spring-boot-autoconfigure}/jms/artemis/ArtemisProperties.{sc-ext}[`ArtemisProperties`] +for more of the supported options. + +No JNDI lookup is involved at all and destinations are resolved against their names, +either using the '`name`' attribute in the Artemis configuration or the names provided +through configuration. + [[boot-features-hornetq]]