yanghao605 commented on issue #3164:
URL:
https://github.com/apache/servicecomb-java-chassis/issues/3164#issuecomment-1179862571
是在业务线程中设置ThreadLocal数据,在Filter中无法获取到数据。
@RequestMapping(value = "/user", method = RequestMethod.GET)
public String userInfo(@RequestParam(value = "name", required = true)
String name) {
ContextInterceptor.setContextCachethreadLocal(10000989);
……
public class ContextInterceptor {
private static final ThreadLocal<Integer> threadLocal = new
ThreadLocal<>();
……
public class CseTest implements HttpClientFilter {
@Override
public int getOrder() {
return 0;
}
@Override
public void beforeSendRequest(Invocation invocation,
HttpServletRequestEx requestEx) {
System.out.println("threadLocal=" +
ContextInterceptor.getContextCachethreadLocal());
这里获取为空
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]