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 2021/02/11 11:06:13 UTC

[GitHub] [servicecomb-java-chassis] tiger-super opened a new issue #2240: HttpServerFilter问题

tiger-super opened a new issue #2240:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2240


   大佬,我在HttpServerFilter定义了一个私有变量,是为了保存请求的报文数据,用于响应的报文的返回需要用到。
   ![image](https://user-images.githubusercontent.com/32871618/107628597-d8ebe100-6c9b-11eb-9d04-4125406a4119.png)
   ,但现在我有个疑问,这个是不是单例?也是就是在多线程下,这个是不是不安全的。
   
   


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



[GitHub] [servicecomb-java-chassis] wujimin commented on issue #2240: HttpServerFilter问题

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


   context在这一条调用链上,会向下一个进程传递  
   localContext不会


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



[GitHub] [servicecomb-java-chassis] tiger-super closed issue #2240: HttpServerFilter问题

Posted by GitBox <gi...@apache.org>.
tiger-super closed issue #2240:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2240


   


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



[GitHub] [servicecomb-java-chassis] wujimin commented on issue #2240: HttpServerFilter问题

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


   放invocation.localcontext就可以了


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



[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #2240: HttpServerFilter问题

Posted by GitBox <gi...@apache.org>.
liubao68 edited a comment on issue #2240:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2240#issuecomment-781193407


   HttpServerFilter是单实例的(JDK SPI机制),需要考虑多线程访问问题。 你可以考虑在 Invocation 的 LocalContext 里面保存数据。  


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



[GitHub] [servicecomb-java-chassis] tiger-super commented on issue #2240: HttpServerFilter问题

Posted by GitBox <gi...@apache.org>.
tiger-super commented on issue #2240:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2240#issuecomment-782576108


   > context在这一条调用链上,会向下一个进程传递
   > localContext不会
   
   非常感谢


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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2240: HttpServerFilter问题

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


   HttpServerFilter是单实例的(JDK SPI机制),需要考虑多线程访问问题。 


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



[GitHub] [servicecomb-java-chassis] tiger-super commented on issue #2240: HttpServerFilter问题

Posted by GitBox <gi...@apache.org>.
tiger-super commented on issue #2240:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2240#issuecomment-782516882


   > HttpServerFilter是单实例的(JDK SPI机制),需要考虑多线程访问问题。 你可以考虑在 Invocation 的 LocalContext 里面保存数据。
   
   LocalContext和Context这两个有什么区别


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