加入Feign
调用
转发head信息
-
Ribbon转发
-
Feign转发
注意
- Feign返回对象不能为接口对象
@FeignClient(value = "hqrfid-core",path = "taizBang")
public interface FeignCoreTaizService{
@PostMapping("list")
public Ret<Page<TaizBang>> list(PageRequest pageRequest);
//返回对象不能为口对象
}
- 服务之间传递head参数
@EnableFeignClients和Feign的过滤器 RequestInterceptor
@Bean
public RequestInterceptor requestInterceptor(){
return new FeignBasicAuthRequestInterceptor();
}
都是只需在调用者上加,不需要再被调用者上加