📌 a missing Java std lib(simple & 0-dependency) for framework/middleware, provide an enhanced InheritableThreadLocal that transmits values between threads even using thread pooling components.
Spring Async Request时,在Filter中设置ThreadLocal数据,但在Deferredresult.SetResult()后,在filter中HttpServletResponse重写OutStream方法时已经无法从ThreadLocal中获取数据,但在Tocmat=8.044版本中没有发现这个问题.
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) {
set ThreadLocal
HttpServletResponse resWrapper = new HttpServletResponseWrapper(servletResponse) {
@Override
public ServletOutputStream getOutputStream() throws IOException {
get ThreadLocal (8.0.26版本tomcat会丢失,8.0.44版本不会丢失)
}
}
Tocmat=8.0.26V
transmittable=2.13.2V
Spring Async Request时,在Filter中设置ThreadLocal数据,但在Deferredresult.SetResult()后,在filter中HttpServletResponse重写OutStream方法时已经无法从ThreadLocal中获取数据,但在Tocmat=8.044版本中没有发现这个问题.