Why the sample 'dubbo-samples-notify' need interface Notify.class
- Dominant language
- Java
- Stars
- 2.4k
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Description
why we need interface Notify for NotifyImpl? In the sample inject bean is NotifyImpl ,so what Notify need for?
It's seem that dubbo need Notify for each method. but different method has their own params。
So I definition the notify interface like this:
```
public interface Notify {
void onReturn(DubboResult result, T t);
void onThrow(Throwable ex, T t);
}
```
implements like this:
```
public class AllotNotify implements Notify{
public Map ret = Maps.newConcurrentMap();
@Override
public void onReturn(DubboResult result, FulfillmentContext context) {
log.info("[AllotNotify] onReturn storeId:{} result:{}",context.getErpStoreId(),result.getResult());
ret.remove(context.getErpStoreId());
}
@Override
public void onThrow(Throwable ex, FulfillmentContext context) {
log.error("[AllotNotify] onThrow storeId:"+context.getErpStoreId(),ex);
}
}
```
then spring throw exception :
```
Caused by: java.lang.IllegalStateException: java.lang.IllegalStateException:Not unique method for method name(onReturn) in class(rpc.notify.AllotNotify), find 2 methods.
```
in `ReflectUtils.findMethodByMethodSignature` clazz.getMethods it has double methods for eatch methods

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.