SpringCloud Ribbon 负载均衡器 轮询访问 Hello world 方法
地址: https://blog.csdn.net/qq_17025903/article/details/91463289
在之前我们通过RestTemplate实现了最简单的服务访问,
下面我们将详细介绍RestTemplate针对几种不同请求类型和参数类型的服务调用实现。
客户端代码
package com.kero99.test;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.serviceregistry.Registration;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bin