微服务Feign调用后开启Schedule报错No thread-bound request found: Are you referring to request attributes outsid

微服务Feign调用后开启Schedule定时任务后报错

No thread-bound request found: Are you referring to request attributes outsid

此方法用于:单独调用接口没问题,开启定时任务就报错

解决方法
FeignClient类方法加参数@RequestHeader(“from”) String from

@RequestMapping(value = "/user/list", method = RequestMethod.GET)
	R> getUserList(@RequestHeader("from") String from);
	```
	调用方式,穿参“Y”
	```
	sysAdminService.getUserList("Y");
	```

你可能感兴趣的:(#,微服务,java,spring,开发语言)