updates to get s-c-consul working again
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package org.springframework.cloud.consul.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.config.client.ConfigClientProperties;
|
||||
import org.springframework.cloud.consul.ConsulAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
|
||||
/**
|
||||
* @author Spencer Gibb
|
||||
@@ -11,6 +14,16 @@ import org.springframework.context.annotation.Import;
|
||||
@Configuration
|
||||
@Import(ConsulAutoConfiguration.class)
|
||||
public class ConsulConfigBootstrapConfiguration {
|
||||
|
||||
@Autowired
|
||||
private ConfigurableEnvironment environment;
|
||||
|
||||
@Bean
|
||||
public ConfigClientProperties configClientProperties() {
|
||||
ConfigClientProperties client = new ConfigClientProperties(environment);
|
||||
return client;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ConsulPropertySourceLocator consulPropertySourceLocator() {
|
||||
return new ConsulPropertySourceLocator();
|
||||
|
||||
@@ -64,6 +64,7 @@ public class ConsulLoadBalancerClient implements LoadBalancerClient {
|
||||
|
||||
@Override
|
||||
public URI reconstructURI(ServiceInstance instance, URI original) {
|
||||
//TODO: move this pattern to a helper method
|
||||
URI uri = UriComponentsBuilder.fromUri(original)
|
||||
.host(instance.getHost())
|
||||
.port(instance.getPort())
|
||||
|
||||
@@ -33,11 +33,6 @@
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-consul-config</artifactId>
|
||||
|
||||
@@ -6,11 +6,6 @@ spring:
|
||||
application:
|
||||
name: testConsulApp
|
||||
|
||||
security:
|
||||
user:
|
||||
name: user
|
||||
password: password
|
||||
|
||||
endpoints:
|
||||
health:
|
||||
sensitive: false
|
||||
|
||||
Reference in New Issue
Block a user