hacky spring cloud connector so we don't have to configure each service individually for the cloud local connector
This commit is contained in:
15
pom.xml
15
pom.xml
@@ -63,6 +63,21 @@
|
||||
<artifactId>spring-platform-config-client</artifactId>
|
||||
<version>1.0.0.BUILD-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-spring-service-connector</artifactId>
|
||||
<version>1.1.0.BUILD-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-localconfig-connector</artifactId>
|
||||
<version>1.1.0.BUILD-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-cloudfoundry-connector</artifactId>
|
||||
<version>1.1.0.BUILD-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.springframework.cloud.notcfconfig;
|
||||
|
||||
import org.springframework.cloud.localconfig.LocalConfigConnector;
|
||||
import org.springframework.cloud.service.UriBasedServiceData;
|
||||
import org.springframework.cloud.util.EnvironmentAccessor;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Spencer Gibb
|
||||
* Let's spring boots current auto-configuration work, effectivly disabling spring cloud local
|
||||
* TODO: workaround for not having to configure the local cloud connector
|
||||
*/
|
||||
public class NotCFConfigConnector extends LocalConfigConnector {
|
||||
|
||||
private EnvironmentAccessor env = new EnvironmentAccessor();
|
||||
|
||||
@Override
|
||||
public boolean isInMatchingCloud() {
|
||||
return env.getEnvValue("VCAP_APPLICATION") == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<UriBasedServiceData> getServicesData() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
org.springframework.cloud.notcfconfig.NotCFConfigConnector
|
||||
@@ -0,0 +1,5 @@
|
||||
org.springframework.cloud.localconfig.AmqpServiceInfoCreator
|
||||
org.springframework.cloud.localconfig.MongoServiceInfoCreator
|
||||
org.springframework.cloud.localconfig.MysqlServiceInfoCreator
|
||||
org.springframework.cloud.localconfig.PostgresqlServiceInfoCreator
|
||||
org.springframework.cloud.localconfig.RedisServiceInfoCreator
|
||||
Reference in New Issue
Block a user