Remove @Bean RestTemplate

(If users need one they can add it themselves)

Fixes gh-239
This commit is contained in:
Dave Syer
2016-03-31 13:31:34 +01:00
parent 84f4d3720c
commit 00b67a87d5
10 changed files with 122 additions and 67 deletions

View File

@@ -25,6 +25,7 @@ import org.springframework.cloud.sleuth.zipkin.ZipkinSpanReporter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.client.RestTemplate;
/**
* @author Spencer Gibb
@@ -40,9 +41,14 @@ public class SampleZipkinApplication {
SpringApplication.run(SampleZipkinApplication.class, args);
}
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
// Use this for debugging (or if there is no Zipkin server running on port 9411)
@Bean
@ConditionalOnProperty(value="sample.zipkin.enabled", havingValue="false")
@ConditionalOnProperty(value = "sample.zipkin.enabled", havingValue = "false")
public ZipkinSpanReporter spanCollector() {
return new ZipkinSpanReporter() {
@Override