关于 springboot异步 RequestContextHolder.getRequestAttributes()为空处理

获取后 在线程内部 set一下

RequestAttributes test11=RequestContextHolder.getRequestAttributes();
			Future<List<InfoAllStatusAreaSumView>> retvalliageList=test.submit(new Callable<List<InfoAllStatusAreaSumView>>() {
			@Override
			public List<InfoAllStatusAreaSumView> call() throws Exception {
				
				RequestContextHolder.setRequestAttributes(test11);
				List<InfoAllStatusAreaSumView> retvalliageList = busCleanwarmInfoServiceSub.selectInfoAllStatusAreaSum(search);
				return retvalliageList;
			}	
		});
	

你可能感兴趣的:(spring,boot,java,后端)