Skip to content

Instantly share code, notes, and snippets.

@dwelch2344
Created September 17, 2015 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwelch2344/3424b7752fbb0172ad89 to your computer and use it in GitHub Desktop.
Save dwelch2344/3424b7752fbb0172ad89 to your computer and use it in GitHub Desktop.
@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