Skip to content

[Task][Java Client] Expose bounded registration progress and health diagnostics #8430

Open

Description

@Aias00

Description

Related to #7602 and #8038. Give business applications an optional, bounded view of their Java client's registration progress and failures so application startup success is not mistaken for usable gateway registration.

Current Evidence

Reviewed main 9dd9a12fb7c64e8a0e26449caa906fe562350dca:

  • The publisher sends asynchronous registration work to subscribers.
  • FailbackRegistryRepository catches persistence failures and schedules retry; FailureRegistryTask has finite retries and removes its pending holder on exhaustion.
  • These paths provide logging, but the inspected client code does not expose a dedicated registration-progress HealthIndicator or a consistent application-consumable state snapshot.

The requirement is client registration observability, distinct from whether the application process is alive, whether an upstream health probe succeeds, or whether gateway configuration has converged.

Task List

  • Define a small state vocabulary for queued/pending, attempting, Admin-acknowledged, retrying, exhausted, offline and unsupported/unknown, with timestamps and a bounded failure category. Reconcile this mapping with [Task] Define a language-neutral client registration OpenAPI and lifecycle contract #8038.
  • Maintain status at the existing publisher/repository/retry completion boundaries; adding diagnostics must not cause extra registration calls, a second retry chain or polling on every business request.
  • Offer a programmatic snapshot and an optional Spring Boot health/diagnostic integration, with bounded aggregate counters where useful. Keep Actuator/metrics dependencies optional and avoid forcing application liveness/readiness to fail by default.
  • Distinguish transport success, legacy acknowledgement, persistence when known and gateway-observed readiness only when actual evidence exists. Unsupported visibility remains unknown; do not infer convergence from a successful POST.
  • Bound retained identities/history, retire state on context/resource shutdown, and omit credentials, JWTs, raw API schemas and arbitrary/high-cardinality metric labels.

Acceptance Criteria

  • A fixture demonstrates initial success, transport failure with retry, permanent/exhausted registration, recovery and orderly close; the snapshot matches actual lifecycle events.
  • Duplicate/replaced retry tasks cannot overwrite a newer result or inflate logical registration counts. Config/namespace/protocol identities remain correctly scoped.
  • Applications can obtain the last acknowledgement and bounded failure reason without parsing logs. Missing Actuator/metrics libraries do not break client startup.
  • Diagnostics distinguish pending/unknown from success and do not advertise gateway readiness without an independent observation contract.
  • Verify optional-dependency behavior, state bounds, cleanup and absence of sensitive fixture values in exported output. Existing forwarding and registration timing behavior remains covered.

Scope and Validation

This is the Java-side observation/adoption slice, not a new Admin readiness endpoint, registration protocol, distributed tracing framework or retry-recovery policy. Reuse existing shared observations/metrics if suitable and coordinate with #6366's fixture assertions. Opening this task does not claim logging is absent; the gap is a stable application-facing registration status.

Evidence is source inspection. The new diagnostic API/adapter and fixture have not been implemented or tested in this report.

Activity

  1. konlue commented on Nov 22, 2026

    @konlue
    Contributor

    Taking this one. The state machine lands in shenyu-register-client-api, next to FailbackRegistryRepository where every completion boundary already lives, so all repository implementations inherit it with zero new dependencies: a small RegistrationStatus vocabulary (QUEUED, REGISTERED for the Admin-acknowledged persist return, RETRYING with an attempt counter, EXHAUSTED, OFFLINE, UNKNOWN), per-identity entries keyed by the existing failback holder key (config/namespace/protocol scoped), timestamps, a bounded failure category plus a truncated credential-free reason (the fenced-protocol "diagnostic message without credentials" precedent), and bounded aggregate counters. The map is hard-capped (rejected overflows only bump a counter), there is no history chain, and shutdown retires entries to OFFLINE. Status is written only at the existing persist/retry/exhaustion/close boundaries — no extra registration calls, no second retry chain, no request-path polling; the disruptor enqueue side contributes a queued aggregate only, because per-event identity is not reliably available there. Applications get ClientRegistrationDiagnostics.snapshot() (bounded list + counters); an opt-in Spring Boot health contributor ships in shenyu-client-autoconfig, gated on @ConditionalOnClass for Actuator and a shenyu.register.props flag, and always reports UP with the snapshot in details so application liveness never fails by default. Tests will drive a fixture through initial success, transport failure with retry, recovery, exhaustion and orderly close at the real boundaries (not wall-clock retries), pin the duplicate/putIfAbsent no-overwrite semantics, the cap, identity scoping, shutdown retirement and the optional-Actuator behavior.

  2. konlue commented on Nov 22, 2026

    @konlue
    Contributor

    /assign

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions