You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.2 KiB
35 lines
1.2 KiB
package com.trgis.sb2sc;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.web.client.RestTemplateBuilder;
|
|
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
|
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
|
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
|
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
|
|
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
|
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
@EnableDiscoveryClient
|
|
//@EnableEurekaClient
|
|
@EnableFeignClients
|
|
@EnableCircuitBreaker
|
|
@EnableHystrix
|
|
@SpringBootApplication
|
|
public class Sb2scConsumerApplication {
|
|
|
|
@Autowired
|
|
private RestTemplateBuilder builder;
|
|
|
|
@Bean
|
|
@LoadBalanced
|
|
public RestTemplate restTemplate() {
|
|
return builder.build();
|
|
}
|
|
public static void main(String[] args) {
|
|
SpringApplication.run(Sb2scConsumerApplication.class, args);
|
|
}
|
|
}
|
|
|