Created
September 17, 2015 22:26
-
-
Save dwelch2344/3424b7752fbb0172ad89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Slf4j | |
@SpringBootApplication(exclude={ AmqpBusAutoConfiguration.class }) | |
public class Server { | |
public static void main(String[] args) { | |
EnhancedSpringApplication.run(Server.class, args); | |
} | |
@Autowired(required = false) | |
private ConfigServicePropertySourceLocator locator; | |
@PostConstruct | |
public void init(){ | |
if(locator != null){ | |
RestTemplate rt = new RestTemplate(); | |
rt.setInterceptors(Arrays.asList((ClientHttpRequestInterceptor) (request, body, execution) -> { | |
log.info("Attempting to locate properties via {}", request.getURI().getHost()); | |
return execution.execute(request, body); | |
})); | |
locator.setRestTemplate(rt); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment