Skip to content

[#493] Add enable-server-reflection management attribute to gRPC subsystem - #502

Open
jmesnil wants to merge 1 commit into
wildfly-extras:mainfrom
jmesnil:worktree-493_server_reflection
Open

jmesnil wants to merge 1 commit into
wildfly-extras:mainfrom
jmesnil:worktree-493_server_reflection

Conversation

@jmesnil

@jmesnil jmesnil commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Add a boolean management attribute enable-server-reflection (default: false, stability level: experimental) that, when set to true, registers ProtoReflectionService on the Netty gRPC server at startup to support gRPC server reflection.

  • Add io.grpc:grpc-services dependency to subsystem and galleon-pack common
  • Add enable-server-reflection attribute to GrpcSubsystemDefinition
  • Conditionally register ProtoReflectionService in GrpcServerService.start()
  • Update XSD schema with new attribute
  • Update subsystem unit test fixtures
  • Add NoServerReflectionTest: verifies reflection is disabled by default
  • Add EnableServerReflectionTest: enables via management write-attribute + reload-enhanced, verifies helloworld.Greeter appears in reflection response

This fixes #493

@jmesnil
jmesnil requested a review from hpehl as a code owner October 1, 2026 11:48
@jmesnil

jmesnil commented Oct 1, 2026 •

Copy link
Copy Markdown
Member Author

@hpehl Once this and #490 are done, we could update the examples to leverage this new attribute so that the client will no longer need to have access to the proto file (that's simpler at least for prototyping with grpcurl).

The server started by the example would have to be provisioned and started at the experimental stability level with this attribute enabled:

./target/wildfly/bin/standalone.sh --stability experimental

and grpcurl can list, describe and serve the services:

$ grpcurl  -plaintext localhost:9555 list

grpc.reflection.v1.ServerReflection
helloworld.Greeter

$ grpcurl  -plaintext localhost:9555 describe  helloworld.Greeter

helloworld.Greeter is a service:
service Greeter {
  rpc SayHello ( .helloworld.HelloRequest ) returns ( .helloworld.HelloReply );
}

$ grpcurl -plaintext \
  -d '{"name":"Bob"}' \
  localhost:9555 helloworld.Greeter/SayHello

{
  "message": "Hello Bob"
}

@jmesnil jmesnil changed the title [#493] Add enable-server-reflection management attribute to gRPC subs… [#493] Add enable-server-reflection management attribute to gRPC subsystem Oct 1, 2026

@hpehl hpehl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jmesnil
jmesnil force-pushed the worktree-493_server_reflection branch 17 times, most recently from ccc7d86 to 060cfb8 Compare October 2, 2026 14:20
…e to gRPC subsystem

Adds an `enable-server-reflection` boolean attribute (default: false,
stability: EXPERIMENTAL) to the gRPC subsystem management model.

When enabled, `ProtoReflectionServiceV1` is registered with the gRPC
server at startup, allowing clients to discover available services using
the gRPC Server Reflection Protocol.

Schema changes:
- Add VERSION_1_0_EXPERIMENTAL schema variant with its own namespace
  (urn:wildfly:grpc:experimental:1.0) and XSD that includes the attribute
- PREVIEW schema and XSD do not expose the attribute, preventing it from
  being parsed from standalone.xml at PREVIEW stability
- Register all schema variants via SubsystemPersistence.of(EnumSet.allOf)
  so the framework selects the correct writer per server stability level
- Add io.grpc:grpc-services artifact to the io.grpc-all JBoss module

Integration tests:
- NoServerReflectionTest: verifies reflection is disabled by default;
  accepts UNAVAILABLE alongside UNIMPLEMENTED to handle transient port
  rebind races after a prior server reload; deploys an empty WAR
- EnableServerReflectionTest: enables via SnapshotServerSetupTask at
  EXPERIMENTAL stability, verifies helloworld.Greeter appears in the
  reflection response
- awaitTermination return value checked in afterClass with a warning log

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@jmesnil
jmesnil force-pushed the worktree-493_server_reflection branch from 060cfb8 to b685740 Compare October 2, 2026 14:21
@jmesnil jmesnil added experimental Experimental feature and removed experimental Experimental feature labels Oct 8, 2026

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide server reflection

2 participants