You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2022/06/30 08:13:11 UTC

[GitHub] [servicecomb-java-chassis] xyxyhcjr opened a new issue, #3164: 升级到2.6.0版本发现filter逻辑是在网络线程,不是在业务线程,如果业务通过扩展filter获取业务线程上下文,当前2.6版本之后无法获取

xyxyhcjr opened a new issue, #3164:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3164

   https://github.com/apache/servicecomb-java-chassis/blob/703a972576b35154d9a9a46f087411fab86fd74a/transports/transport-rest/transport-rest-client/src/main/java/org/apache/servicecomb/transport/rest/client/http/RestClientInvocation.java#L123


-- 
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: commits-unsubscribe@servicecomb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-java-chassis] lbc97 commented on issue #3164: 升级到2.6.0版本发现filter逻辑是在网络线程,不是在业务线程,如果业务通过扩展filter获取业务线程上下文,当前2.6版本之后无法获取

Posted by GitBox <gi...@apache.org>.
lbc97 commented on issue #3164:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3164#issuecomment-1175704589

   我这里直接是可以取到框架的上下文的。


-- 
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: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-java-chassis] yanghao605 commented on issue #3164: 升级到2.6.0版本发现filter逻辑是在网络线程,不是在业务线程,如果业务通过扩展filter获取业务线程上下文,当前2.6版本之后无法获取

Posted by GitBox <gi...@apache.org>.
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: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-java-chassis] liubao68 closed issue #3164: 升级到2.6.0版本发现filter逻辑是在网络线程,不是在业务线程,如果业务通过扩展filter获取业务线程上下文,当前2.6版本之后无法获取

Posted by GitBox <gi...@apache.org>.
liubao68 closed issue #3164: 升级到2.6.0版本发现filter逻辑是在网络线程,不是在业务线程,如果业务通过扩展filter获取业务线程上下文,当前2.6版本之后无法获取
URL: https://github.com/apache/servicecomb-java-chassis/issues/3164


-- 
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: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #3164: 升级到2.6.0版本发现filter逻辑是在网络线程,不是在业务线程,如果业务通过扩展filter获取业务线程上下文,当前2.6版本之后无法获取

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #3164:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3164#issuecomment-1221555798

   Add a PR  to use async implicitly.  see https://github.com/apache/servicecomb-java-chassis/pull/3291/files  


-- 
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: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-java-chassis] lbc97 commented on issue #3164: 升级到2.6.0版本发现filter逻辑是在网络线程,不是在业务线程,如果业务通过扩展filter获取业务线程上下文,当前2.6版本之后无法获取

Posted by GitBox <gi...@apache.org>.
lbc97 commented on issue #3164:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3164#issuecomment-1175663013

   你这个获取的时候要在哪里获取呢,是下游微服务吗还是说后面的某个特定位置。


-- 
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: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-java-chassis] lbc97 commented on issue #3164: 升级到2.6.0版本发现filter逻辑是在网络线程,不是在业务线程,如果业务通过扩展filter获取业务线程上下文,当前2.6版本之后无法获取

Posted by GitBox <gi...@apache.org>.
lbc97 commented on issue #3164:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3164#issuecomment-1175663532

   能给看一下你是如何在filter里面获取上下文并添加内容的吗?
   


-- 
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: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org