異步線程RequestContextHolder.getRequestAttributes()爲null

使用Spring框架,在Service中開啓一個新的線程,在新的線程中使用 RequestAttributes ra = RequestContextHolder.getRequestAttributes(); 獲取出來爲null,有沒有什麼辦法能解決?多線程 問題出現的環境背景及本身嘗試過哪些方法 Service中爲優化響應時間,使用了多線程,部分線程中使用到了RequestContextHol
相關文章
相關標籤/搜索