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");
* 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 {
}

@ -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 {
/**

@ -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

@ -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";

@ -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

@ -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;

@ -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 {
/**

@ -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

@ -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 {
/**

@ -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

@ -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;

@ -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;

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

@ -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

@ -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 <<boot-features-hornetq>> 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]]

Loading…
Cancel
Save