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 2020/11/28 07:33:29 UTC

[GitHub] [servicecomb-java-chassis] wujimin commented on issue #2091: 为什么Handler中可以使用异步而Filter中不行了?

wujimin commented on issue #2091:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2091#issuecomment-735051226


   基本上我认为这是一个设计缺陷  
   当初定义HttpServerFilter时,仅仅为了用于干预一下codec逻辑而已  
   相关的缺陷,在这里也有一定的描述:https://issues.apache.org/jira/browse/SCB-1929  
     
   使用新的Filter机制,可以解决reactive认证/鉴权的问题  
   不过Filter机制还没有正式发布,我在自己的项目里正在试用  
     
   线程变换的问题,从能不能跑的角度看,应该是没问题,但是能不能跑得好,这个需要你来评估  
   比如,所有请求都要走认证/鉴权,所有的请求就都跑到你这个线程池里去了,是否顶得住?  
   
   另外:CompletableFuture使用指定线程池执行,可以使用它的带async后缀的方法,并指定你想要的executor即可,代码会清晰不少


----------------------------------------------------------------
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.

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