From 44b4df2d3d49533e7db8c5615fc1d7d6f1c0e43f Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 26 May 2016 14:14:59 +0200 Subject: [PATCH] Deprecate hornetq support Closes gh-6034 --- .../main/asciidoc/spring-boot-features.adoc | 3 ++ .../spring-boot-starter-hornetq/pom.xml | 5 +- ...erDeprecationWarningAutoConfiguration.java | 47 +++++++++++++++++++ .../main/resources/META-INF/spring.factories | 3 ++ 4 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 spring-boot-starters/spring-boot-starter-hornetq/src/main/java/org/springframework/boot/starter/hornetq/HornetQStarterDeprecationWarningAutoConfiguration.java create mode 100644 spring-boot-starters/spring-boot-starter-hornetq/src/main/resources/META-INF/spring.factories 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 05696d83b7e..98ea69f4bee 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -3898,6 +3898,9 @@ NOTE: You should not try and use Artemis and HornetQ and the same time. [[boot-features-hornetq]] ==== HornetQ support + +NOTE: HornetQ is deprecated in 1.4, consider migrating to <> + Spring Boot can auto-configure a `ConnectionFactory` when it detects that HornetQ 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 diff --git a/spring-boot-starters/spring-boot-starter-hornetq/pom.xml b/spring-boot-starters/spring-boot-starter-hornetq/pom.xml index ecbedfdb1cb..a11bd6448ab 100644 --- a/spring-boot-starters/spring-boot-starter-hornetq/pom.xml +++ b/spring-boot-starters/spring-boot-starter-hornetq/pom.xml @@ -7,8 +7,9 @@ 1.4.0.BUILD-SNAPSHOT spring-boot-starter-hornetq - Spring Boot HornetQ Starter - Starter for JMS messaging using HornetQ + spring-boot-starter-hornetq (DEPRECATED) + Starter for JMS messaging using HornetQ. Deprecated as of 1.4 in favor + of spring-boot-starter-artemis http://projects.spring.io/spring-boot/ Pivotal Software, Inc. diff --git a/spring-boot-starters/spring-boot-starter-hornetq/src/main/java/org/springframework/boot/starter/hornetq/HornetQStarterDeprecationWarningAutoConfiguration.java b/spring-boot-starters/spring-boot-starter-hornetq/src/main/java/org/springframework/boot/starter/hornetq/HornetQStarterDeprecationWarningAutoConfiguration.java new file mode 100644 index 00000000000..88ab21a6ae6 --- /dev/null +++ b/spring-boot-starters/spring-boot-starter-hornetq/src/main/java/org/springframework/boot/starter/hornetq/HornetQStarterDeprecationWarningAutoConfiguration.java @@ -0,0 +1,47 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.starter.hornetq; + +import javax.annotation.PostConstruct; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.Configuration; + +/** + * {@link EnableAutoConfiguration Auto-configuration} to print a deprecation warning about + * the starter. + * + * @author Stephane Nicoll + * @since 1.4.0 + */ +@Configuration +@Deprecated +public class HornetQStarterDeprecationWarningAutoConfiguration { + + private static final Log logger = LogFactory + .getLog(HornetQStarterDeprecationWarningAutoConfiguration.class); + + @PostConstruct + public void logWarning() { + logger.warn("spring-boot-starter-hornetq is deprecated as of Spring Boot 1.4, " + + "please migrate to spring-boot-starter-artemis"); + } + +} diff --git a/spring-boot-starters/spring-boot-starter-hornetq/src/main/resources/META-INF/spring.factories b/spring-boot-starters/spring-boot-starter-hornetq/src/main/resources/META-INF/spring.factories new file mode 100644 index 00000000000..989f05e7b02 --- /dev/null +++ b/spring-boot-starters/spring-boot-starter-hornetq/src/main/resources/META-INF/spring.factories @@ -0,0 +1,3 @@ +# Auto Configure +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.springframework.boot.starter.hornetq.HornetQStarterDeprecationWarningAutoConfiguration