About setting the connections to the method part.
There are currently two problems. The first question, is the setting of connections on the method valid?
The second question, is it necessary to set the connections property on the method?
After testing, the connections property on the method does not take effect. There is no impact on the number of connections.
Should we disable the connections property on the method? I think it should be disabled.
Currently an invoker is targeting a service instead of a method. It is not appropriate for us to set connections to the method.
If we can set connections to the method and take effect, how do we weigh the relationship between the service's connections and the methods' connections?
对于method上的connections有两个问题。
- 设置method上的connections目前是否生效?
- 我们有没有必要允许用户设置这个属性?
第一个问题,目前简单测试并且check了一下代码,发现method上的connections是不生效的。 第二个问题,我认为应该禁止method上设置connections。
目前一个dubbo invoker针对的是一个service。对于method上设置connections不太恰当。connections是针对一个invoker而言的。 另外如果我们允许设置connections,那么我们如何权衡method的connections和service的connections之间的关系也是个问题,method覆盖service还是service覆盖method感觉都不是很合适。
@carryxyh, Would be possible to guide me on some documentation or code related to this topic. Actually wanted to understand this part so that it could become easy for me to follow you on this topic.
@khanimteyaz Sorry about that. I didn't notice your comment. Now, we can config like this:
<dubbo:reference id="demoService" check="false" interface="org.apache.dubbo.demo.DemoService">
<dubbo:method name="sayHello" connections="10"/>
</dubbo:reference>
But in my debug, the connections config will not effect. In my opinion, this setting is meaningless. Because the meaning of connections is to set the number of tcp channels, and for dubbo, an invoker corresponds to a service. We can only control the number of tcp links managed by an invoker, not the method.
At present, we also need to solicit opinions from many people. If we can agree, I think we need to modify the xbd file of dubbo, and the connections are not allowed on the method config..
@carryxyh thanks for caring and explaining it. Based on the input provided by you, I am with you to have it on the service level, instead of method level. One more question, is this applicable to client-side or provider side or both?
@carryxyh
I am agree with you. It doesn't make sense to specify connection on method level, even though it is do-able.
so the follow up question is, should we throw exception if user configures it?
In xml, we can disable setting connections by modifying the dubbo.xsd file.
Is it a good way to throw an exception when using the Config class? Personally feel that this way is not a big problem, maybe we can add an expired annotation to MethodConfig's setConnections?
Method config can no longer set connections, the definition in xsd can be deleted directly.