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/02/26 03:19:26 UTC
[GitHub] [servicecomb-java-chassis] Bluselye opened a new issue #1596: 微服务RPC调用时在HttpClientFilter 中如何处理请求中产生的异常?
Bluselye opened a new issue #1596: 微服务RPC调用时在HttpClientFilter 中如何处理请求中产生的异常?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1596
在微服务RPC请求时,增加一个HttpClientFilter 做过滤器记录外部请求情况。
如果请求中发生异常,比如超时异常时,在过滤器中会进beforeSendRequest方法但是不会进afterReceiveResponse方法。此时应该如何处理才能满足需求?
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [servicecomb-java-chassis] Bluselye commented on issue #1596: 微服务RPC调用时在HttpClientFilter 中如何处理请求中产生的异常?
Posted by GitBox <gi...@apache.org>.
Bluselye commented on issue #1596: 微服务RPC调用时在HttpClientFilter 中如何处理请求中产生的异常?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1596#issuecomment-591735961
请问下这个Handler有没有对应的开发资料,提供一下,这个也是一个方法,或者有没有对应接口和配置,去重写Invocation实现?
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1596: 微服务RPC调用时在HttpClientFilter 中如何处理请求中产生的异常?
Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #1596: 微服务RPC调用时在HttpClientFilter 中如何处理请求中产生的异常?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1596#issuecomment-591406000
比较通用的做法可以实现一个[Handler](https://docs.servicecomb.io/java-chassis/zh_CN/references-handlers/intruduction/),比如 error-handler, 然后配置在其他Handler的前面。 Handler里面可以从Invocation取到很多信息,如果没有的信息,比如HTTP协议里面的某些header,可以在HttpClientFilter里面setContext。
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [servicecomb-java-chassis] Bluselye commented on issue #1596: 微服务RPC调用时在HttpClientFilter 中如何处理请求中产生的异常?
Posted by GitBox <gi...@apache.org>.
Bluselye commented on issue #1596: 微服务RPC调用时在HttpClientFilter 中如何处理请求中产生的异常?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1596#issuecomment-592286928
实践了一下,这样做不能在Invocation的LocalContext中传递消息,并且handler会在filter之前调用前执行,处理起来比较麻烦,有专门的设置ExceptionHandler处理么?
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1596: 微服务RPC调用时在HttpClientFilter 中如何处理请求中产生的异常?
Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #1596: 微服务RPC调用时在HttpClientFilter 中如何处理请求中产生的异常?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1596#issuecomment-591889667
我的回复有链接
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #1596: 微服务RPC调用时在HttpClientFilter 中如何处理请求中产生的异常?
Posted by GitBox <gi...@apache.org>.
liubao68 edited a comment on issue #1596: 微服务RPC调用时在HttpClientFilter 中如何处理请求中产生的异常?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1596#issuecomment-591889667
我的回复有链接, [servicecomb-fence](https://github.com/apache/servicecomb-fence/tree/master/api/edge-service/endpoint/src/main/java/org/apache/servicecomb/authentication/edge) 有 Handler 和 HttpServerFilter 配合使用的例子 `AuthHandler` 和 `AuthenticationFilter `
----------------------------------------------------------------
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
With regards,
Apache Git Services