Skip to content

Service group is not working in hessian and rmi protocol #6737

@TimYi

Description

@TimYi
  • 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: 2.7.8
  • Operating System version: ubuntu 18.04
  • Java version: open jdk 1.8.0_222

Steps to reproduce this issue

  1. write two providers in different groups
<dubbo:reference
        id="dealMenuFileProvider"
        interface="com.jiurong.mfront.workflow.checker.file.FileProvider" 
        protocol="hessian"
        group="g1"
        lazy="false"
        check="false"/>
        
<dubbo:reference
        id="newDealMnoteFileProvider"
        interface="com.jiurong.mfront.workflow.checker.file.FileProvider" 
        protocol="hessian"
        group="g2"
        lazy="false"
        check="false"/>
  1. write two consumers in different groups
<dubbo:service
        interface="com.jiurong.mfront.workflow.checker.file.FileProvider"
        ref="dealMenuFileProvider"
        protocol="hessian"
        group="g1"
    />
    
<dubbo:service
        interface="com.jiurong.mfront.workflow.checker.file.FileProvider"
        ref="newDealMnoteFileProvider"
        protocol="hessian"
        group="g2"
    />
  1. invoke each consumer to see which implemention is invoked
  @Autowired(required = false)
  public void setFileProviders(List<FileProvider> providers) {
    for (FileProvider fileProvider : providers) {
      System.out.println(fileProvider.getType());
    }
    this.providers = providers;
  }
  1. When I use hessian or rmi protocol, the provider being invoked is always the first one, group="g1". But when I use dubbo protocol, each group is invoked one by one.

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

What do you expected from the above steps?

Consomer of g2 group should invoke provider of g2 group.

Actual Result

What actually happens?

All the consomers always invoke the first provider, the g1 provider.

Possible explanation

org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol class used the group parameter inside, but org.apache.dubbo.rpc.protocol.hessian.HessianProtocol did not. Is service-group only supported by dubbo protocol?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions