[Studio] feat: rip 2 proxy admin grpc - #117
Open
zhaohai666 wants to merge 4 commits into
Open
Conversation
Add a dedicated, independent ProxyAdminService (design decision D1 Option B) to apache/rocketmq/v2/admin.proto, covering the RIP-2 control-plane interface for the RocketMQ Proxy over gRPC: - M1 Online client query: ListClients, DescribeClient, ListClientsByGroup, ListClientsByTopic (cursor-based pagination, dual gRPC/Remoting coverage) - M2 Runtime config & connection management: GetProxyConfig, UpdateProxyConfig, DisconnectClient - M3 POP receipt handle diagnostics: DescribePopReceiptHandles - M4 Batch consumption diagnostics: DescribeBatchConsumeDiagnostics - Server-streaming route change subscription: SubscribeRouteEvents Reuses existing apache.rocketmq.v2 types (Status, Resource, Settings, SubscriptionEntry, Language, Permission, MessageModel) from definition.proto and the existing Admin service for a consistent protocol surface.
Address the capability gaps found against the official RIP-2 competition spec: P0 naming alignment: - GetProxyConfig -> DescribeProxyConfig (consistent Describe* prefix) - DisconnectClient -> KickClient; add DisconnectChannel(channel_id) for transport-level connection control P1 M1 minimum-set fields: - ClientInstance.topics (associate topics, in addition to groups) - PublishSettings + ClientDetail.publish_settings (producer publish info) - ClientFilter.connected_before (time-window upper bound) - ProxyScope wired into ListClients/ByGroup/ByTopic requests (D3) P1 new modules (M2 planning): - Quota visualization: DescribeQuota/UpdateQuota + QuotaPolicy/QuotaDimension (ACL resource proxy.admin.quota) - Route & load-balance observation: DescribeRouteTopology + ProxyBrokerLink/ LoadBalanceInfo (ACL resource proxy.admin.route) P2 diagnostics & ACL: - POP lock view (PopLockView), ACK/NACK counters, NOT_CONSUME_YET reason - Batch pull window state (BatchPullWindowState) - Enumerate proxy.admin.* ACL resource vocabulary in service doc & per-RPC protoc 25.3 validation passes; no stale references remain.
- Pagination: ListClients/ByGroup/ByTopic now use page_num/page_size (server-enforced max 100) per RIP-2 D4, replacing the cursor-based next_token + page_size(1000) scheme; responses echo total/page_num/page_size. (M3/M4 diagnostics already used page_num/page_size, now consistent.) - ACL 2.0 carrier: D2 clarifies credentials ride gRPC request metadata (Authorization header, RIP-1 AUTH-01 AuthCallCredentials), NOT the message body, matching RIP-2's decoupled-auth requirement. - Dedicated error model (D6): add ProxyAdminErrorCode enum (11 RIP-2-specific codes) surfaced via an optional error_code field on every response, replacing ad-hoc Status.message parsing. - Bump protocol version java/VERSION 2.2.0 -> 2.3.0. - Add RIP-2 entry (15) to ChangeLog.md. protoc 25.3 validation passes; no stale next_token/1000 references remain.
Roll back the two additions from the previous review pass that the RIP-2 competition spec does NOT mandate: - Drop the dedicated ProxyAdminErrorCode enum and the optional error_code field on every response (RIP-2 D6). Transport-level errors keep using standard gRPC status codes + Status.message; the spec does not ask for a bespoke error-code taxonomy. - Revert ListClients/ByGroup/ByTopic pagination from page_num/page_size (max 100) back to the cursor-based next_token + page_size scheme (D4), since the spec only requires pagination (filter-pushdown, no full dump) without prescribing a concrete paging form. M3/M4 diagnostics keep their existing page_num/page_size, unchanged. Kept (spec-mandated or user-requested): - ACL 2.0 credentials ride gRPC request metadata (Authorization header, RIP-1 AUTH-01), not the message body. - java/VERSION 2.3.0 (user-requested bump). - ChangeLog entry 15 trimmed to reflect the above. protoc 25.3 validation passes; no stale ProxyAdminErrorCode/error_code remain.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RIP-2: Add
ProxyAdminServicegRPC interface surface toadmin.protoSummary
This PR implements the RIP-2 (Proxy Admin gRPC Interface Surface) control-plane
contract for the RocketMQ Proxy, expressed at the protocol-definition layer
(
rocketmq-apis). It adds a new, independent gRPC serviceProxyAdminServicetoapache/rocketmq/v2/admin.proto, covering online clientquery, runtime configuration, connection control, rate-limit/quota observation,
POP/batch consumption diagnostics, and a server-streaming route-event
subscription.
The service is intentionally separate from the data-plane
MessagingServiceand from the existing broker-facing
Adminservice, and it covers both gRPCand Remoting clients connected to the Proxy. This PR is the API contract only
(message/service definitions); the server-side binding lives in the Proxy
implementation repo (e.g.
rocketmq-proxy).Background
RIP-2 introduces a dedicated administrative interface for the Proxy over gRPC so
that operators and consoles can inspect and manage the clients/state attached to
a Proxy at runtime, without overloading the data plane. It complements — rather
than extends — the existing
Adminservice, which targets the broker controlplane.
Design Decisions (RIP-2)
ProxyAdminService, keptseparate from
MessagingServiceand the broker-facingAdmin.proxy.admin.*, one per sub-module:proxy.admin.client—ListClients/DescribeClient/ListClientsByGroup/ListClientsByTopicproxy.admin.config—DescribeProxyConfig/UpdateProxyConfigproxy.admin.connection(high privilege) —KickClient/DisconnectChannelproxy.admin.quota(high privilege) —DescribeQuota/UpdateQuotaproxy.admin.route—DescribeRouteTopology/SubscribeRouteEventsAuthorizationheader via the RIP-1 AUTH-01
AuthCallCredentialsmechanism), not in therequest message body — auth stays decoupled from the data plane and reuses the
5.0 ACL 2.0 baseline. A global
proxyAdminEnablekill switch disables thewhole surface.
with
proxy_endpoint+epochso a dashboard/CLI can deduplicate across aProxy cluster.
ProxyScope(LOCAL / CLUSTER / PROXY_ID) is wired into theaggregate queries.
next_token) pagination for the highlydynamic client lists; offset-based (
page_num/page_size) for diagnosticsnapshots (M3/M4). No full unpaginated dumps.
distinguished by the
protocolfield ofClientInstance.Added RPCs (14 total)
ListClientsDescribeClientListClientsByGroupListClientsByTopicDescribeProxyConfigProxyRuntimeConfig).UpdateProxyConfigproxy.admin.config).KickClientclient_id(ACLproxy.admin.connection).DisconnectChannelchannel_id.DescribeQuotaUpdateQuotaproxy.admin.quota).DescribePopReceiptHandlesDescribeBatchConsumeDiagnosticsSubscribeRouteEventsDescribeRouteTopologyKey new message/enum types
ClientInstance,ClientDetail,ClientFilter,PublishSettings,HeartbeatRecord,AuthStatus,ClientConsumeProgress,NetworkInfoProxyRuntimeConfig,ProxyScope,ProxyClientIdentityQuotaPolicy,QuotaDimensionPopReceiptHandleGroupSummary,PopReceiptHandleInfo,PopLockViewBatchConsumeGroupSummary,BatchConsumeClientDiagnostics,BatchPullWindowStateRouteChangeEvent,ProxyBrokerLink,LoadBalanceInfoClientRole(PRODUCER/PUSH_CONSUMER/SIMPLE_CONSUMER),ClientProtocol(GRPC/REMOTING),RouteChangeEventTypeExisting
apache.rocketmq.v2types (Status,Resource,Settings,SubscriptionEntry,Language,Permission,MessageModel) fromdefinition.protoare reused to stay consistent with the rest of the API.Validation
protoc 25.3compilesapache/rocketmq/v2/admin.protocleanly (withdefinition.protoand the well-known typesTimestamp/Duration).Adminservice.Versioning & Changelog
java/VERSION2.2.0→2.3.0(backward-compatible minor).ChangeLog.mddocumenting the RIP-2 addition.Commits on this branch
60cafc1RIP-2: addProxyAdminServicegRPC interface surface toadmin.proto976b7e2RIP-2: alignProxyAdminServicewith competition spec (gap fixes)15183c4RIP-2: alignProxyAdminServicewith review feedback2cd7e56RIP-2: revert items not required by the competition specNotes / Follow-ups
ProxyStartupwiring must be implemented in the Proxy implementation repo.concerns; the contract already documents the
proxy.admin.*resource vocabularyfor those integrations.
ProxyAdminErrorCodetaxonomy and a concretepage_num/page_sizemandate them (standard gRPC status codes +
Status.messageare used for errors;cursor pagination is used per D4).