Skip to content

[BUG] New registrar path never propagates namespaceId — multi-namespace support broken in @EnableClientRegister path #6664

Closed

Description

@Aias00
  • Severity: High
  • Location:
    shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/registrar/UriApiRegistrarImplImpl.java:44-52,57-65; MateDataApiRegistrarImpl.java:50-68,72-90; ApiDocRegistrarImpl.java:65-82; shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/ClientRegisterConfig.java:22-66 (interface lacks namespace accessor); ClientRegisterConfigImpl.java:49-62 (has ShenyuClientConfig but never reads getNamespace())

Description:
The old path (AbstractContextRefreshedEventListener) loops over all namespaces: for (String namespaceId : namespaceIds) and sets .namespaceId(namespaceId) on every DTO (SpringMvcClientEventListener.buildURIRegisterDTO:159, ApacheDubboServiceBeanListener:127, handleClass:312, handleMethod:327). The new registrar path publishes DTOs with no .namespaceId(...) call at all. ClientRegisterConfig has no namespace accessor, and ClientRegisterConfigImpl receives ShenyuClientConfig but never reads getNamespace(). AbstractApiRegistrar.register / BaseApiRegistrarImpl.register also do not loop over namespaces.

Impact:
When the ApiBean-based registrar path is active, all URI/MetaData/ApiDoc registrations carry null namespaceId, breaking multi-namespace support entirely; registrations land in the default namespace regardless of shenyu.namespace configuration. Compounds FUNC-B1 (when processors are fixed, namespace is still missing).

Suggested fix:
Add List<String> getNamespace() to ClientRegisterConfig; extract in ClientRegisterConfigImpl from shenyuClientConfig.getNamespace() (with the same default fallback the old path uses). Have BaseApiRegistrarImpl.register or the doRegisterApi/doRegisterBean methods loop over namespaces and set .namespaceId(...).

Confidence: High


Identified during the 2026-08-02 deep re-scan; full list in docs/scan2-2026-08-02/00-consolidated-critical-high.md.

Activity

  1. added
    type: bug
    priority: high
    on Aug 3, 2026
  2. github-actions commented on Aug 3, 2026

    @github-actions
    Contributor

    👋 Hello @yuluo-yx

    A new issue has been opened by @Aias00:

    Please review when you have time. Thank you! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    client: registerpriority: hightype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions