Skip to content

ApplicationModel serviceName is not unique #2583

@haiyang1985

Description

@haiyang1985
  • 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

  1. 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>
  2. startup the consumer application.
  3. 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.

<dubbo:service interface="com.alibaba.dubbo.DemoService" ref="demoService">
</dubbo:service>

<dubbo:service interface="com.alibaba.dubbo.DemoService" ref="demoService2">
</dubbo:service>

Here is my PR: #2582

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions