Deprecate HornetQ support

Closes gh-6377
pull/6059/head
Stephane Nicoll 8 years ago
parent 8319291efd
commit 6bd7a2fedd

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * @author Phillip Webb
* @since 1.1.0 * @since 1.1.0
* @see HornetQProperties * @see HornetQProperties
* @deprecated as of 1.4 in favor of the artemis support
*/ */
@Configuration @Configuration
@AutoConfigureBefore(JmsAutoConfiguration.class) @AutoConfigureBefore(JmsAutoConfiguration.class)
@ -51,6 +52,7 @@ import org.springframework.context.annotation.Import;
@Import({ HornetQEmbeddedServerConfiguration.class, @Import({ HornetQEmbeddedServerConfiguration.class,
HornetQXAConnectionFactoryConfiguration.class, HornetQXAConnectionFactoryConfiguration.class,
HornetQConnectionFactoryConfiguration.class }) HornetQConnectionFactoryConfiguration.class })
@Deprecated
public class HornetQAutoConfiguration { public class HornetQAutoConfiguration {
} }

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * @author Phillip Webb
* @since 1.1.0 * @since 1.1.0
* @see HornetQAutoConfiguration * @see HornetQAutoConfiguration
* @deprecated as of 1.4 in favor of the artemis support
*/ */
@Deprecated
public interface HornetQConfigurationCustomizer { public interface HornetQConfigurationCustomizer {
/** /**

@ -30,9 +30,11 @@ import org.springframework.context.annotation.Configuration;
* *
* @author Phillip Webb * @author Phillip Webb
* @since 1.2.0 * @since 1.2.0
* @deprecated as of 1.4 in favor of the artemis support
*/ */
@Configuration @Configuration
@ConditionalOnMissingBean(ConnectionFactory.class) @ConditionalOnMissingBean(ConnectionFactory.class)
@Deprecated
class HornetQConnectionFactoryConfiguration { class HornetQConnectionFactoryConfiguration {
@Bean @Bean

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 Phillip Webb
* @author Stephane Nicoll * @author Stephane Nicoll
* @since 1.2.0 * @since 1.2.0
* @deprecated as of 1.4 in favor of the artemis support
*/ */
@Deprecated
class HornetQConnectionFactoryFactory { class HornetQConnectionFactoryFactory {
static final String EMBEDDED_JMS_CLASS = "org.hornetq.jms.server.embedded.EmbeddedJMS"; static final String EMBEDDED_JMS_CLASS = "org.hornetq.jms.server.embedded.EmbeddedJMS";

@ -34,7 +34,9 @@ import org.springframework.boot.autoconfigure.jms.hornetq.HornetQProperties.Embe
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Phillip Webb * @author Phillip Webb
* @since 1.1.0 * @since 1.1.0
* @deprecated as of 1.4 in favor of the artemis support
*/ */
@Deprecated
class HornetQEmbeddedConfigurationFactory { class HornetQEmbeddedConfigurationFactory {
private static final Log logger = LogFactory private static final Log logger = LogFactory

@ -41,10 +41,12 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator;
* @author Phillip Webb * @author Phillip Webb
* @author Stephane Nicoll * @author Stephane Nicoll
* @since 1.2.0 * @since 1.2.0
* @deprecated as of 1.4 in favor of the artemis support
*/ */
@Configuration @Configuration
@ConditionalOnClass(name = HornetQConnectionFactoryFactory.EMBEDDED_JMS_CLASS) @ConditionalOnClass(name = HornetQConnectionFactoryFactory.EMBEDDED_JMS_CLASS)
@ConditionalOnProperty(prefix = "spring.hornetq.embedded", name = "enabled", havingValue = "true", matchIfMissing = true) @ConditionalOnProperty(prefix = "spring.hornetq.embedded", name = "enabled", havingValue = "true", matchIfMissing = true)
@Deprecated
class HornetQEmbeddedServerConfiguration { class HornetQEmbeddedServerConfiguration {
private final HornetQProperties properties; private final HornetQProperties properties;

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * @author Stephane Nicoll
* @since 1.1.0 * @since 1.1.0
* @deprecated as of 1.4 in favor of the artemis support
*/ */
@Deprecated
public enum HornetQMode { public enum HornetQMode {
/** /**

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * @author Stephane Nicoll
* @since 1.1.0 * @since 1.1.0
* @deprecated as of 1.4 in favor of the artemis support
*/ */
@Deprecated
public class HornetQNoOpBindingRegistry implements BindingRegistry { public class HornetQNoOpBindingRegistry implements BindingRegistry {
@Override @Override

@ -30,8 +30,10 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @since 1.1.0 * @since 1.1.0
* @deprecated as of 1.4 in favor of the artemis support
*/ */
@ConfigurationProperties(prefix = "spring.hornetq") @ConfigurationProperties(prefix = "spring.hornetq")
@Deprecated
public class HornetQProperties { public class HornetQProperties {
/** /**

@ -35,11 +35,13 @@ import org.springframework.context.annotation.Primary;
* *
* @author Phillip Webb * @author Phillip Webb
* @since 1.2.0 * @since 1.2.0
* @deprecated as of 1.4 in favor of the artemis support
*/ */
@Configuration @Configuration
@ConditionalOnMissingBean(ConnectionFactory.class) @ConditionalOnMissingBean(ConnectionFactory.class)
@ConditionalOnClass(TransactionManager.class) @ConditionalOnClass(TransactionManager.class)
@ConditionalOnBean(XAConnectionFactoryWrapper.class) @ConditionalOnBean(XAConnectionFactoryWrapper.class)
@Deprecated
class HornetQXAConnectionFactoryConfiguration { class HornetQXAConnectionFactoryConfiguration {
@Primary @Primary

@ -30,7 +30,9 @@ import org.springframework.util.StringUtils;
* *
* @author Stéphane Lagraulet * @author Stéphane Lagraulet
* @author Stephane Nicoll * @author Stephane Nicoll
* @deprecated as of 1.4 in favor of the artemis support
*/ */
@Deprecated
class SpringBootHornetQConnectionFactory extends HornetQConnectionFactory { class SpringBootHornetQConnectionFactory extends HornetQConnectionFactory {
private final HornetQProperties properties; private final HornetQProperties properties;

@ -30,7 +30,9 @@ import org.springframework.util.StringUtils;
* *
* @author Stéphane Lagraulet * @author Stéphane Lagraulet
* @author Stephane Nicoll * @author Stephane Nicoll
* @deprecated as of 1.4 in favor of the artemis support
*/ */
@Deprecated
class SpringBootHornetQXAConnectionFactory extends HornetQXAConnectionFactory { class SpringBootHornetQXAConnectionFactory extends HornetQXAConnectionFactory {
private final HornetQProperties properties; private final HornetQProperties properties;

@ -65,6 +65,8 @@ import static org.mockito.Mockito.spy;
* *
* @author Stephane Nicoll * @author Stephane Nicoll
*/ */
@Deprecated
@SuppressWarnings("deprecation")
public class HornetQAutoConfigurationTests { public class HornetQAutoConfigurationTests {
@Rule @Rule

@ -28,6 +28,8 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Phillip Webb * @author Phillip Webb
*/ */
@Deprecated
@SuppressWarnings("deprecation")
public class HornetQEmbeddedConfigurationFactoryTests { public class HornetQEmbeddedConfigurationFactoryTests {
@Test @Test

@ -3963,15 +3963,53 @@ resolved against their provided names.
[[boot-features-artemis]] [[boot-features-artemis]]
==== Artemis support ==== Artemis support
Apache Artemis was formed in 2015 when HornetQ was donated to the Apache Foundation. All Apache Artemis was formed in 2015 when HornetQ was donated to the Apache Foundation. Make
the features listed in the <<boot-features-hornetq>> section below can be applied to sure to use that rather than the deprecated HornetQ support.
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.
NOTE: You should not try and use Artemis and HornetQ and the same time. 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]] [[boot-features-hornetq]]

Loading…
Cancel
Save