在微服務環境下,遠端呼叫feign和非同步執行緒存在請求資料丟失問題
阿新 • • 發佈:2021-01-26
RequestAttributes requestAttributes = RequestContextHolder.currentRequestAttributes();
Thread thread=new Thread(()-> {
RequestContextHolder.setRequestAttributes(requestAttributes, true);
syncKjlInfoService.deleteBuilding(vo);
});
thread. start();