From b87a591d278432c14da0d92fd161fa4fdf55f81b Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 9 Oct 2014 19:24:47 -0700 Subject: [PATCH] Revert "Add ActiveMQ MQTT connection URL auto-detection" This reverts commit 0d8bde58c905f3857d92cee7c2c4334b22985b59. Fixes gh-1679 --- .../ActiveMQConnectionFactoryFactory.java | 20 ------------------- .../jms/activemq/ActiveMQProperties.java | 10 ---------- .../appendix-application-properties.adoc | 1 - 3 files changed, 31 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java index 0d493eef161..6d3f82074b2 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java @@ -16,13 +16,8 @@ package org.springframework.boot.autoconfigure.jms.activemq; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - import org.apache.activemq.ActiveMQConnectionFactory; import org.springframework.util.Assert; -import org.springframework.util.ClassUtils; import org.springframework.util.StringUtils; /** @@ -38,14 +33,6 @@ class ActiveMQConnectionFactoryFactory { private static final String DEFAULT_NETWORK_BROKER_URL = "tcp://localhost:61616"; - private static final Map CLASS_BASED_BROKER_URLS; - static { - Map map = new LinkedHashMap(); - map.put("org.apache.activemq.transport.mqtt.MQTTTransport", - "mqtt://localhost:1883"); - CLASS_BASED_BROKER_URLS = Collections.unmodifiableMap(map); - } - private final ActiveMQProperties properties; public ActiveMQConnectionFactoryFactory(ActiveMQProperties properties) { @@ -80,13 +67,6 @@ class ActiveMQConnectionFactoryFactory { if (this.properties.getBrokerUrl() != null) { return this.properties.getBrokerUrl(); } - if (this.properties.isAutodetectConnectionUrl()) { - for (Map.Entry entry : CLASS_BASED_BROKER_URLS.entrySet()) { - if (ClassUtils.isPresent(entry.getKey(), null)) { - return entry.getValue(); - } - } - } if (this.properties.isInMemory()) { return DEFAULT_EMBEDDED_BROKER_URL; } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java index b4eed04d0d4..0709c08668b 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java @@ -29,8 +29,6 @@ public class ActiveMQProperties { private String brokerUrl; - private boolean autodetectConnectionUrl = true; - private boolean inMemory = true; private boolean pooled; @@ -47,14 +45,6 @@ public class ActiveMQProperties { this.brokerUrl = brokerUrl; } - public boolean isAutodetectConnectionUrl() { - return this.autodetectConnectionUrl; - } - - public void setAutodetectConnectionUrl(boolean autodetectConnectionUrl) { - this.autodetectConnectionUrl = autodetectConnectionUrl; - } - /** * Specify if the default broker url should be in memory. Ignored if an explicit * broker has been specified. diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index b23f07d3fda..f3789bfe6c0 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -284,7 +284,6 @@ content into your application; rather pick only the properties that you need. spring.activemq.broker-url=tcp://localhost:61616 # connection URL spring.activemq.user= spring.activemq.password= - spring.activemq.autodetect-connection-url=true # attempt to guess URL based on classpath spring.activemq.in-memory=true # broker kind to create if no broker-url is specified spring.activemq.pooled=false