添加负载均衡
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.gzzn.omms.adminapi.config;
|
||||
|
||||
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
||||
@@ -9,6 +10,7 @@ import org.springframework.web.client.RestTemplate;
|
||||
@Configuration
|
||||
public class RestTemplateConfig {
|
||||
@Bean
|
||||
@LoadBalanced
|
||||
public RestTemplate restTemplate(ClientHttpRequestFactory factory){
|
||||
return new RestTemplate(factory);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user