首页>代码>Spring Cloud微服务架构项目搭建实例,微服务组件介绍,基于maven多模块搭建>/springcloud/consumer-banji-80/src/main/java/com/neusoft/config/Config.java
package com.neusoft.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class Config {
    @Bean
    @LoadBalanced//实现负载均衡
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
最近下载更多
落后就要挨打  LV26 2023年11月23日
644106  LV8 2023年6月8日
heweimin  LV12 2022年10月28日
aqin_qin  LV1 2022年6月4日
mylzdy  LV12 2022年3月8日
huangxiaoke20  LV17 2021年11月2日
newhaijun  LV15 2021年9月2日
sunlzh888888  LV28 2021年6月21日
李东曙  LV14 2021年4月10日
13043860zj  LV16 2021年2月23日
最近浏览更多
kashen114230 4月5日
暂无贡献等级
appleman988 3月19日
暂无贡献等级
malagou  LV1 1月22日
whfuai  LV14 1月2日
落后就要挨打  LV26 2023年10月19日
huangminglun 2023年9月26日
暂无贡献等级
644106  LV8 2023年6月8日
berdan 2023年1月16日
暂无贡献等级
秦sir3067683450  LV10 2022年12月31日
1049066887  LV12 2022年12月25日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友