-
Notifications
You must be signed in to change notification settings - Fork 26.5k
事件通知的几个问题 #8098
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
Comments
@kylixs PTAL |
3.0 分支重构了ReferenceBean的逻辑,统一了xml及Annotation的初始化过程,方法回调配置解析改为: org.apache.dubbo.config.spring.reference.ReferenceCreator#createMethodConfig。 相关pr: #8109 |
可以提供一个具体的测试用例吗? |
接口方法入参NotifyDto:
定义Dubbo Reference bean的notify.xml:
事件通知接口ConsumerNotifyService:
事件通知接口实现类ConsumerNotifyServiceImpl :
注解MethodAnnotation:
切面MethodAspect :
测试类:
|
问题1、2、3在不同dubbo版本下的测试:
补充:
|
@zrlw |
可以关了,目前master分支还只支持一个onXXX回调,多个回调还要等多实例实现。 |
Environment
Steps to reproduce this issue
xml配置dubbo:reference方式,dubbo:method配置的onreturn,onthrow方法为spring bean(以下称A)的方法,这些方法上还有诸如
@Transactional
之类的Spring AOP注解。问题1:
A里面
@Autowired
注解的成员均注入失败,使用时均为null对象。我们采取的补救方法是去掉
@Autowired
注解,将A增加ApplicationListener<ContextRefreshedEvent>
接口实现,在onApplicationEvent方法里重新从ApplicationContext里取得相应的bean赋给本该由@Autowired
注入的成员。问题2:
onreturn,onthrow方法上的Spring AOP注解均失效。
我们采取的补救方法是将onreturn,onthrow方法拆分,相关业务处理代码以及Spring AOP注解移到另外一个bean,A里面的onreturn,onthrow方法只是调用另外那个bean带注解的方法。
问题3:
onThrow方法捕获不了dubbo客户端抛出的RpcException。
重现方法:删除dubbo服务接口入参class上的序列化接口定义,在事件通知方式下客户端的onThrow方法未捕获到任何异常,在
@Reference
注解方式下调用会抛出dubbo入参未实现java.io.Serializable接口的RPC异常。问题4:
@Reference
注解配置oninvoke,onreturn,onthrow无效,我们看到 #6833 已经描述过这个问题,5月份已修复,我们看到最新发布的3.0代码里已包含了修复,但是修复的方法上还有@Deprecated
注解,是否还有进一步修订计划?The text was updated successfully, but these errors were encountered: