Hi, Tien Consistent hash is relying mainly the object's "toString()" protocol. So pls make sure your objects have a unique and stable toString() method and it will be ok.
best regards, Jason > On Jun 11, 2019, at 16:58, [email protected] wrote: > > Dear experts, > > We are using Dubbo to export our services. For data load balancing, we would > like to use the consistent hash load balancer. > For the default usage of this load balancer, we can define either one or > several parameters of the consumed method to be used as the hashing data. > We wonder if it is possible to target the hashing on the field of an object > passed as the param. > For instance, the method interface is as follows: > > MyResponse getResponse(MyRequestParams params); > > The object params has a field named URI, which we would like to apply the > hash algorithm upon. > Of course, we can modify our method to: > > MyResponse getResponse(String uri, MyRequestParams params); > > But this really is contradictory with the design goal of MyRequestParam > object (which is defined to wrap all our request params into one object) > > Best regards > Tien Dat PHAN
