Skip to content

Conversation

@Wweiei
Copy link
Contributor

@Wweiei Wweiei commented Mar 7, 2025

complete task 4 in #5923 , modify dubbo registry config base on selector.

  1. i add one parameter "registry" in dubbo selector, and change "protocol" to not required.
    image
  2. for example, change the shenyu-examples-apache-dubbo-service's dubbo.registry.address to 'nacos://localhost:8848?namespace=local_test&username=nacos&password=nacos'
    image
    if the dubbo selector parameter registry is empty, it will use the default plugin config. i add a common method to get the dubbo ReferenceConfig in ApacheDubboProxyService.java#getReferenceConfig
    image
    when invoke the api 'http://localhost:9195/dubbo/findById', it will throw No provider exception.
    image
  3. set the dubbo selector parameter to 'nacos://localhost:8848?namespace=local_test&username=nacos&password=nacos'
    image
    when invoke the api the 'dubboUpstreams' is not empty in ApacheDubboProxyService.java#getReferenceConfig
    image
    then chose one upstream and create a new ReferenceConfig with a new cacheKey
    image
    finally, it will use the new ReferenceConfig to invoke the dubbo interface through the new registry。
    image
  4. when build the ReferenceConfig in ApacheDubboConfigCache.java, it will use the new dubbo RegistryConfig and the dubbo rule config is not used in default model. so i wrote a new buildReference method。
    image
    And when use the multi registry or there are multiple Dubbo instances, the custom dubbo LoadBalance ApacheDubboGrayLoadBalance will be triggered, so when build the ReferenceConfig i didn't use reference.setLoadbalance("gray") and methodConfig.setLoadbalance("gray").

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

@Aias00
Copy link
Contributor

Aias00 commented Mar 20, 2025

@Wweiei if u got time, fix the conflicts

…g-base-on-selector

# Conflicts:
#	db/upgrade/2.7.0-upgrade-2.7.1-mysql.sql
#	db/upgrade/2.7.0-upgrade-2.7.1-ob.sql
#	db/upgrade/2.7.0-upgrade-2.7.1-og.sql
#	db/upgrade/2.7.0-upgrade-2.7.1-oracle.sql
#	db/upgrade/2.7.0-upgrade-2.7.1-pg.sql
@Wweiei
Copy link
Contributor Author

Wweiei commented Mar 20, 2025

@Wweiei if u got time, fix the conflicts
ok, i have fixed it

@Aias00
Copy link
Contributor

Aias00 commented Mar 27, 2025

@Wweiei hi, fix the ci, pls

Wweiei and others added 2 commits March 28, 2025 09:00
…g-base-on-selector

# Conflicts:
#	db/upgrade/2.7.0-upgrade-2.7.1-mysql.sql
#	db/upgrade/2.7.0-upgrade-2.7.1-ob.sql
#	db/upgrade/2.7.0-upgrade-2.7.1-og.sql
#	db/upgrade/2.7.0-upgrade-2.7.1-oracle.sql
#	db/upgrade/2.7.0-upgrade-2.7.1-pg.sql
@Aias00 Aias00 added this to the 2.7.0.1 milestone Mar 31, 2025
@Aias00
Copy link
Contributor

Aias00 commented Apr 10, 2025

@Wweiei fix ci pls

@Aias00 Aias00 requested a review from moremind April 10, 2025 12:08
}

ReferenceConfig<GenericService> reference = new ReferenceConfig<>();
reference.setGeneric("true");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why "true"? not true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it set to "true", it means the generic invocation function is enabled.Otherwise, when initializing ReferenceConfig, the caller still needs to hold the Class object of the service interface.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 12 out of 22 changed files in this pull request and generated 1 comment.

Files not reviewed (10)
  • db/init/mysql/schema.sql: Language not supported
  • db/init/ob/schema.sql: Language not supported
  • db/init/og/create-table.sql: Language not supported
  • db/init/oracle/schema.sql: Language not supported
  • db/init/pg/create-table.sql: Language not supported
  • db/upgrade/2.7.0-upgrade-2.7.1-mysql.sql: Language not supported
  • db/upgrade/2.7.0-upgrade-2.7.1-ob.sql: Language not supported
  • db/upgrade/2.7.0-upgrade-2.7.1-og.sql: Language not supported
  • db/upgrade/2.7.0-upgrade-2.7.1-oracle.sql: Language not supported
  • db/upgrade/2.7.0-upgrade-2.7.1-pg.sql: Language not supported

@moremind moremind modified the milestones: 2.7.0.1, 2.7.0.2 Apr 24, 2025
@Aias00 Aias00 merged commit 9ac8659 into apache:master Jun 20, 2025
52 of 62 checks passed
478320 pushed a commit to 478320/shenyu that referenced this pull request Jul 17, 2025
* modify dubbo plugin configuration based on selector

* code optimization,change some magic value in ApacheDubboConfigCache

* fix: dubbo plugin configuration base on selector code review

---------

Co-authored-by: xiaoyu <[email protected]>
Co-authored-by: aias00 <[email protected]>
Co-authored-by: zhengpeng <[email protected]>
Co-authored-by: VampireAchao <[email protected]>
@Wweiei Wweiei deleted the feature/dubbo-config-base-on-selector branch September 17, 2025 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants