zhaohai666 opened a new issue, #10633: URL: https://github.com/apache/rocketmq/issues/10633
### Before Creating the Enhancement Request - [x] I have confirmed that this should be classified as an enhancement rather than a bug/feature. ### Summary # [studio] feat: Proxy Admin gRPC Service Binding and Startup Integration ## Background This is the second atomic PR in the RIP-2 (Proxy Admin Interface) series. It builds on the proto definition (PR #1) to implement the actual gRPC service handlers and integrate the admin service into the Proxy startup lifecycle. ## Design Proposal ### gRPC Service Layer - **ProxyAdminBindableService**: Implements `io.grpc.BindableService` to register the admin gRPC service on a dedicated port, isolated from the data-plane gRPC service to avoid resource contention - **ProxyAdminGrpcService**: Core RPC handler implementation that delegates to downstream services (client service, route service, diagnostics). Handles request validation, error mapping, and response assembly - **ProxyAdminMetricsManager**: Dedicated metrics collection for admin operations (request count, latency histogram, error rate), exposed via the existing Prometheus endpoint ### Startup Integration - **ProxyStartup**: Modified to conditionally bootstrap the admin service based on configuration. Admin service starts on a separate port (default: 8081) with its own Netty server instance - **ProxyConfig**: New configuration fields for admin service (port, enabled flag, thread pool size, auth mode) ### Constants - **GrpcConstants**: Admin-specific gRPC metadata keys for authentication headers and request tracing ## Scope | File | Type | Description | |------|------|-------------| | `ProxyAdminBindableService.java` | New | gRPC service registration | | `ProxyAdminGrpcService.java` | New | RPC handler implementation | | `ProxyAdminMetricsManager.java` | New | Admin operation metrics | | `ProxyStartup.java` | Modified | Admin service bootstrap (+116 lines) | | `ProxyConfig.java` | Modified | Admin configuration fields (+98 lines) | | `GrpcConstants.java` | Modified | Admin header constants | | `ProxyMetricsManager.java` | Modified | Metrics integration point | | `ProxyStartupTest.java` | New | Startup lifecycle tests | | `ProxyAdminBindableServiceTest.java` | New | Service binding tests | | `ProxyAdminGrpcServiceTest.java` | New | RPC handler tests (1060 lines) | | `ProxyAdminMetricsManagerTest.java` | New | Metrics collection tests | **Total: 11 files, +2959 lines** ## Dependencies - Depends on PR #1 (proto definition and serialization layer) ## Testing - Unit tests for each RPC handler with mocked downstream services - Startup test verifying admin service lifecycle (init → start → shutdown) - Metrics test verifying counter/histogram registration and recording ## Branch `feature/rip-2-pr2-grpc-service-startup` ### Motivation # [studio] feat: Proxy Admin gRPC Service Binding and Startup Integration ## Background This is the second atomic PR in the RIP-2 (Proxy Admin Interface) series. It builds on the proto definition (PR #1) to implement the actual gRPC service handlers and integrate the admin service into the Proxy startup lifecycle. ## Design Proposal ### gRPC Service Layer - **ProxyAdminBindableService**: Implements `io.grpc.BindableService` to register the admin gRPC service on a dedicated port, isolated from the data-plane gRPC service to avoid resource contention - **ProxyAdminGrpcService**: Core RPC handler implementation that delegates to downstream services (client service, route service, diagnostics). Handles request validation, error mapping, and response assembly - **ProxyAdminMetricsManager**: Dedicated metrics collection for admin operations (request count, latency histogram, error rate), exposed via the existing Prometheus endpoint ### Startup Integration - **ProxyStartup**: Modified to conditionally bootstrap the admin service based on configuration. Admin service starts on a separate port (default: 8081) with its own Netty server instance - **ProxyConfig**: New configuration fields for admin service (port, enabled flag, thread pool size, auth mode) ### Constants - **GrpcConstants**: Admin-specific gRPC metadata keys for authentication headers and request tracing ## Scope | File | Type | Description | |------|------|-------------| | `ProxyAdminBindableService.java` | New | gRPC service registration | | `ProxyAdminGrpcService.java` | New | RPC handler implementation | | `ProxyAdminMetricsManager.java` | New | Admin operation metrics | | `ProxyStartup.java` | Modified | Admin service bootstrap (+116 lines) | | `ProxyConfig.java` | Modified | Admin configuration fields (+98 lines) | | `GrpcConstants.java` | Modified | Admin header constants | | `ProxyMetricsManager.java` | Modified | Metrics integration point | | `ProxyStartupTest.java` | New | Startup lifecycle tests | | `ProxyAdminBindableServiceTest.java` | New | Service binding tests | | `ProxyAdminGrpcServiceTest.java` | New | RPC handler tests (1060 lines) | | `ProxyAdminMetricsManagerTest.java` | New | Metrics collection tests | **Total: 11 files, +2959 lines** ## Dependencies - Depends on PR #1 (proto definition and serialization layer) ## Testing - Unit tests for each RPC handler with mocked downstream services - Startup test verifying admin service lifecycle (init → start → shutdown) - Metrics test verifying counter/histogram registration and recording ## Branch `feature/rip-2-pr2-grpc-service-startup` ### Describe the Solution You'd Like # [studio] feat: Proxy Admin gRPC Service Binding and Startup Integration ## Background This is the second atomic PR in the RIP-2 (Proxy Admin Interface) series. It builds on the proto definition (PR #1) to implement the actual gRPC service handlers and integrate the admin service into the Proxy startup lifecycle. ## Design Proposal ### gRPC Service Layer - **ProxyAdminBindableService**: Implements `io.grpc.BindableService` to register the admin gRPC service on a dedicated port, isolated from the data-plane gRPC service to avoid resource contention - **ProxyAdminGrpcService**: Core RPC handler implementation that delegates to downstream services (client service, route service, diagnostics). Handles request validation, error mapping, and response assembly - **ProxyAdminMetricsManager**: Dedicated metrics collection for admin operations (request count, latency histogram, error rate), exposed via the existing Prometheus endpoint ### Startup Integration - **ProxyStartup**: Modified to conditionally bootstrap the admin service based on configuration. Admin service starts on a separate port (default: 8081) with its own Netty server instance - **ProxyConfig**: New configuration fields for admin service (port, enabled flag, thread pool size, auth mode) ### Constants - **GrpcConstants**: Admin-specific gRPC metadata keys for authentication headers and request tracing ## Scope | File | Type | Description | |------|------|-------------| | `ProxyAdminBindableService.java` | New | gRPC service registration | | `ProxyAdminGrpcService.java` | New | RPC handler implementation | | `ProxyAdminMetricsManager.java` | New | Admin operation metrics | | `ProxyStartup.java` | Modified | Admin service bootstrap (+116 lines) | | `ProxyConfig.java` | Modified | Admin configuration fields (+98 lines) | | `GrpcConstants.java` | Modified | Admin header constants | | `ProxyMetricsManager.java` | Modified | Metrics integration point | | `ProxyStartupTest.java` | New | Startup lifecycle tests | | `ProxyAdminBindableServiceTest.java` | New | Service binding tests | | `ProxyAdminGrpcServiceTest.java` | New | RPC handler tests (1060 lines) | | `ProxyAdminMetricsManagerTest.java` | New | Metrics collection tests | **Total: 11 files, +2959 lines** ## Dependencies - Depends on PR #1 (proto definition and serialization layer) ## Testing - Unit tests for each RPC handler with mocked downstream services - Startup test verifying admin service lifecycle (init → start → shutdown) - Metrics test verifying counter/histogram registration and recording ## Branch `feature/rip-2-pr2-grpc-service-startup` ### Describe Alternatives You've Considered # [studio] feat: Proxy Admin gRPC Service Binding and Startup Integration ## Background This is the second atomic PR in the RIP-2 (Proxy Admin Interface) series. It builds on the proto definition (PR #1) to implement the actual gRPC service handlers and integrate the admin service into the Proxy startup lifecycle. ## Design Proposal ### gRPC Service Layer - **ProxyAdminBindableService**: Implements `io.grpc.BindableService` to register the admin gRPC service on a dedicated port, isolated from the data-plane gRPC service to avoid resource contention - **ProxyAdminGrpcService**: Core RPC handler implementation that delegates to downstream services (client service, route service, diagnostics). Handles request validation, error mapping, and response assembly - **ProxyAdminMetricsManager**: Dedicated metrics collection for admin operations (request count, latency histogram, error rate), exposed via the existing Prometheus endpoint ### Startup Integration - **ProxyStartup**: Modified to conditionally bootstrap the admin service based on configuration. Admin service starts on a separate port (default: 8081) with its own Netty server instance - **ProxyConfig**: New configuration fields for admin service (port, enabled flag, thread pool size, auth mode) ### Constants - **GrpcConstants**: Admin-specific gRPC metadata keys for authentication headers and request tracing ## Scope | File | Type | Description | |------|------|-------------| | `ProxyAdminBindableService.java` | New | gRPC service registration | | `ProxyAdminGrpcService.java` | New | RPC handler implementation | | `ProxyAdminMetricsManager.java` | New | Admin operation metrics | | `ProxyStartup.java` | Modified | Admin service bootstrap (+116 lines) | | `ProxyConfig.java` | Modified | Admin configuration fields (+98 lines) | | `GrpcConstants.java` | Modified | Admin header constants | | `ProxyMetricsManager.java` | Modified | Metrics integration point | | `ProxyStartupTest.java` | New | Startup lifecycle tests | | `ProxyAdminBindableServiceTest.java` | New | Service binding tests | | `ProxyAdminGrpcServiceTest.java` | New | RPC handler tests (1060 lines) | | `ProxyAdminMetricsManagerTest.java` | New | Metrics collection tests | **Total: 11 files, +2959 lines** ## Dependencies - Depends on PR #1 (proto definition and serialization layer) ## Testing - Unit tests for each RPC handler with mocked downstream services - Startup test verifying admin service lifecycle (init → start → shutdown) - Metrics test verifying counter/histogram registration and recording ## Branch `feature/rip-2-pr2-grpc-service-startup` ### Additional Context _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
