springCloud服务之间传递复杂参数

1. 在yml配置文件中添加

feign: # 服务之间可以传递对象参试
  httpclient:
    enabled: true

2. 添加pom



    org.apache.httpcomponents
    httpclient



    com.netflix.feign
    feign-httpclient
    8.15.1

3. 接口写法

4. 接口实现写法



error问题

如果报找不到服务错误的话:需要在被调用的服务实现类加上@RestController

com.netflix.client.ClientException: Load balancer does not have available server for client: ***

 

你可能感兴趣的:(微服务领域)