Skip to content

servlet: configurable methodNameResolver#12333

Merged
kannanjgithub merged 1 commit intogrpc:masterfrom
panchenko:methodNameResolver
Sep 16, 2025
Merged

servlet: configurable methodNameResolver#12333
kannanjgithub merged 1 commit intogrpc:masterfrom
panchenko:methodNameResolver

Conversation

@panchenko
Copy link
Copy Markdown
Contributor

instead of #11825

@kannanjgithub kannanjgithub added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Sep 15, 2025
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Sep 15, 2025
@kannanjgithub kannanjgithub merged commit 6f21bc2 into grpc:master Sep 16, 2025
16 of 17 checks passed
@ejona86
Copy link
Copy Markdown
Member

ejona86 commented Sep 17, 2025

There should be at least documentation mentioning that using this method is basically guaranteed to be incompatible with reflection, and that using https://grpc.github.io/grpc-java/javadoc/io/grpc/HandlerRegistry.html when possible is preferred.

@kannanjgithub
Copy link
Copy Markdown
Contributor

I didn't follow. The HandlerRegistry has methods for looking up ServerMethodDefinition but the method name to use for look up would have the context prefix removed using the method name resolver. As the HandlerRegistry and the method resolver are for two different purposes, when do we face the incompatibility with reflection?

AgraVator pushed a commit to AgraVator/grpc-java that referenced this pull request Sep 26, 2025
Introduces configuring a method name resolver in `ServletServerBuilder` for customizing the servlet context root path for request paths.
AgraVator pushed a commit to AgraVator/grpc-java that referenced this pull request Sep 26, 2025
Introduces configuring a method name resolver in `ServletServerBuilder` for customizing the servlet context root path for request paths.
@long76
Copy link
Copy Markdown

long76 commented Oct 15, 2025

@panchenko u forgot protected on constructor GrpcServlet(ServletAdapter servletAdapter)

original solution #11825 (comment)

@panchenko
Copy link
Copy Markdown
Contributor Author

panchenko commented Oct 15, 2025

@long76 you don't need changes to the constructor, it's more flexible if registering servlets from ServletContainerInitializer - #11825 (comment)

long76 added a commit to long76/grpc-java that referenced this pull request Oct 15, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants