Blame view

cloud/consumer/src/main/java/com/example/consumer/ConsumerApplication.java 801 Bytes
a94761b5   陶汉栋   no message
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package com.example.consumer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@ConfigurationProperties
@SpringBootApplication
@EnableDiscoveryClient
public class ConsumerApplication {

    @Bean
    @LoadBalanced
e92e5a92   陶汉栋   增加网关负载
18
    RestTemplate restTemplate() {
a94761b5   陶汉栋   no message
19
20
21
22
23
24
25
26
        return new RestTemplate();
    }

    public static void main(String[] args) {
        SpringApplication.run(ConsumerApplication.class, args);
    }

}