You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the issues of this repository and believe that this is not a duplicate.
I have checked the FAQ of this repository and believe that this is not a duplicate.
Environment
Dubbo version: all
Operating System version: all
Java version: all
Steps to reproduce this issue
create two ReferenceConfig for same service with different configuration.
<dubbo:reference id="demoService" interface="com.alibaba.dubbo.DemoService">
</dubbo:reference>
<dubbo:reference id="demoServiceAsync" interface="com.alibaba.dubbo.DemoService" async="true">
</dubbo:reference>
startup the consumer application.
get the ConsumerModel from ApplicationModel.
Pls. provide [GitHub address] to reproduce this issue.
Expected Result
ApplicationModel.allConsumerModels() should returns two ConsumerModel.
Actual Result
ApplicationModel.allConsumerModels() only returns the first ConsumerModel.
If there is an exception, please attach the exception trace:
With future investigation, ReferenceConfig cannot put the second ConsumerModel as they are in same serviceName.
Also, this is the same issue for provider with below configuration.
Yes.
The flexibility of refer a service with different proxy is good(As above, one proxy in sync, another in async). But, it's terrible that we are not able to get the proxy we have created.
For that, we are able to cache the proxy by extend the ProxyFactory. But, the issue is that the wrapper executed without order, which result in different proxy returned.
Hopefully, the constrains be removed from the ApplicationModel cache.
I don't think this is a problem or fixing bug. Here are two reasions.
Pratically, the same service is not recommended to create twice on the consumer side. If async and sync are both needed, we can do it in mehod level to config, or a util method to switch between aync and sync.
most importantly, please check the two classes (URL and StringUtils), there is a method named getServiceKey, which is used commonly in Dubbo. A service can be unique under three properties whare are serviceInterface, Group, Version. So, there is no property Ref to constraint service's unique.
For example, a group rule or route rule is defined in ZK, which service is it applied to? I think, serviceKey (name, group, version) is the condition. So as the online/offline rules.
@Jeff-Lv I agree with your opinion. For this particular problem, let's consider it as a limitation. User cannot configure two references with the different behavior. We will provide alternative way to user to change the behavior either via API, utilities or dynamic config.
Activity
kimmking commentedon Sep 30, 2018
It is dependent on how do you defind a Service:
haiyang1985 commentedon Oct 4, 2018
Yes.
The flexibility of refer a service with different proxy is good(As above, one proxy in sync, another in async). But, it's terrible that we are not able to get the proxy we have created.
For that, we are able to cache the proxy by extend the ProxyFactory. But, the issue is that the wrapper executed without order, which result in different proxy returned.
Hopefully, the constrains be removed from the ApplicationModel cache.
beiwei30 commentedon Oct 8, 2018
@haiyang1985 I drop a comment in #2582 (review), pls. take a look.
Issue2583 (#2614)
Jeff-Lv commentedon Oct 24, 2018
I don't think this is a problem or fixing bug. Here are two reasions.
Pratically, the same service is not recommended to create twice on the consumer side. If async and sync are both needed, we can do it in mehod level to config, or a util method to switch between aync and sync.
most importantly, please check the two classes (URL and StringUtils), there is a method named getServiceKey, which is used commonly in Dubbo. A service can be unique under three properties whare are serviceInterface, Group, Version. So, there is no property Ref to constraint service's unique.
For example, a group rule or route rule is defined in ZK, which service is it applied to? I think, serviceKey (name, group, version) is the condition. So as the online/offline rules.
beiwei30 commentedon Oct 24, 2018
@Jeff-Lv I agree with your opinion. For this particular problem, let's consider it as a limitation. User cannot configure two references with the different behavior. We will provide alternative way to user to change the behavior either via API, utilities or dynamic config.
Let's roll back the relevant change in #2646.