-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReaderInterceptor不起作用 #30
Comments
是的,也调不到,我追源码,restprotocol是把extend的值统一交给RESTEasy框架来管理,应该是靠后者来实现jax-rs规范吧?也就是说问题不在dubbox,而是要从RESTEasy下手吧? |
经过我自己的测试,发现单独使用resteasy,最新版本下也存在这个问题,不过目前看来,更换成官方提供的preProcessInterceptor是可以满足要求的,具体细节还需要看一下resteasy源码,不过该拦截器接口已经被官方提示不建议使用。如下代码 public class MyPreProcessInterceptor implements PreProcessInterceptor {
public ServerResponse preProcess(HttpRequest request, ResourceMethodInvoker method) throws Failure, WebApplicationException{
System.out.println("Reader interceptor invoked");
return null;
}
} 官方文档上解释的也很笼统,我在 根据文档中下面这句话:
我还尝试了使用POST以表单形式提交参数,试图测试是否可以触发,结果也是徒劳的~ |
我看了一下,这个不是bug。在不需要做反序列化的比如get场景,reader inteceptor肯定就不会被调用。 |
如果做认证的话,就不能用这个拦截器了~ |
用filter吧,不用interceptor。另外dubbo自己也有filter |
按照官方例子,却发现
ReaderInterceptor
不起作用,只打印出"Writer interceptor invoked",断点也无法捕获在对应位置,可以证明确实是没有调用。请问如何解决?
The text was updated successfully, but these errors were encountered: