Repository navigation
Description
Description
Related to #7602. Validate enabled Java registration-client settings consistently before allocating resources or publishing work, and provide accurate property guidance for application developers while retaining existing configuration syntax/defaults.
Current Evidence
At main 9dd9a12fb7c64e8a0e26449caa906fe562350dca:
- ShenyuClientConfig stores protocol-specific entries in a map with free-form Properties; ShenyuRegisterCenterConfig stores registerType/serverLists and shared Properties.
- ClientRegisterConfigImpl parses a configured port lazily with Integer.parseInt and resolves other values through several fallbacks.
- The Spring MVC starter already validates some application-name requirements and mutates defaults. Other client/protocol/transport checks live at different construction boundaries.
Existing checks are real. The missing capability is a consistent validation/default-resolution and diagnostic entry point, not a claim that no setting is validated today.
Task List
- Inventory supported properties and current defaults/aliases for the enabled clients, registration transport and discovery mode; distinguish global, protocol and transport-specific ownership.
- Validate presence and formats of applicable server addresses, protocol settings, namespace lists and ports, plus currently supported numeric duration/retry properties. Validate only relevant fields; do not invent mandatory settings or new retry options.
- Treat automatic bind-port sentinels separately from an explicit advertised endpoint: server.port=0 may be valid input, but the published address must resolve to a usable bound port.
- Resolve defaults in a predictable order and emit a diagnostic naming the exact property/protocol, expected form and bounded corrective guidance. Never include passwords, tokens or credential-bearing addresses in an exception.
- Add/complete configuration metadata or documented property hints for map/Properties entries using the existing configuration mechanism. Keep YAML/properties keys, valid legacy values, extension SPI settings and supported fallback behavior compatible.
- Validate before starting shared publishers, timers or network attempts where possible; clean partially prepared resources if a late protocol-specific check fails.
Acceptance Criteria
- Starter binding tests cover missing/invalid server settings, malformed/out-of-range ports, supported auto-port mode, blank namespaces, disabled protocols and relevant numeric values.
- Valid existing application configurations and defaults still work. Unsupported/unknown extension settings are handled according to the documented extension contract, not rejected merely because a built-in validator does not recognize them.
- Error output identifies the relevant property without revealing sensitive fixture values, and invalid input does not leave registration workers/timers running.
- IDE metadata examples match actual binding and validation rules; test at least one representative YAML/properties application rather than checking metadata text alone.
- Shared foundation model changes remain compatible with Admin/gateway consumers; apply client-specific validation at the appropriate boundary instead of imposing unrelated application requirements on every shared DTO consumer.
Boundaries and Validation
This task owns client binding/validation and guidance, not Admin request-body validation (#6713), a new registration wire version or release coordinate ownership (#8421). Coordinate automatic endpoint handling with the sibling bound-port issue and actual client defaults in the final migration candidate.
The evidence above is source review of existing configuration paths. No new validation implementation, exhaustive invalid-input matrix or IDE completion test was executed for this report.
Activity