Skip to content

Investigate exposing gRPC over Undertow port 8080 #301

Description

@darranl

It is common that is users are exposing something over HTTP that they want to expose it using the same HTTP listener as everything else i.e. Undertow.

At the core gRPC is well defined messages making use of HTTP/2 - could these be intercepted and passed over the the gRPC server?

The path information sounds like it is /service name/method name so unless we deployed and used the service name to register with Undertow we may need to consider should be on the root context (like our HTTP upgrade support) - however the content-type would be application/grpc which maybe we could detect early in the request handling flow.

Activity

  1. changed the title [-]Invetigate exposing gRPC over Undertow port 8080[/-] [+]Investigate exposing gRPC over Undertow port 8080[/+] on Aug 14, 2026
  2. jmesnil commented on Aug 20, 2026

    @jmesnil
    Member

    I agree with you that gRPC traffic should go on the undertow port (:8080) and not on another distinct port.

    The feature pack uses a different port because it actually starts a distinct Netty server inside WildFly that serves the gRPC traffic.
    This is also why the grpc subsystem seems to duplicate a lot of attributes from the undertow subsystem for any configurable knob and buttons of its HTTP stack.

    That's a fundamental architectural problem: the gRPC stack is running on top of Netty with its own threading model that is distinct from the XNIO thread model from Undertow and WildFly.

    I don't know if it would be possible to use the https://github.com/xnio/netty-xnio-transport to start with requests on undertow:8080 and transfer it to netty with a Netty Transport that is still backed by XNIO...

    Another approach would be to implement gRPC over Undertow/XNIO but @jamezp prototyped this and while it works, it relies on internal API from the gRPC project that is not meant for external use...

    Another approach would be to use a version of Undertow that is backed by Netty instead of XNIO. In that case, we could perhaps use io.grpc.netty for "free" (that remains to be verified).

    Another approach that is possible now is to rely on the io.grpc.servlet package to deploy gRPC service as regular Servlet. It is flagged as experimental by gRPC and might not be optimal but it has the benefits of:

    1. running on the undertow stack
    2. working fine with CDI (using @dependent + ServletAdapter)
  3. jamezp commented on Aug 20, 2026

    @jamezp
    Member

    I thought there was something about io.grpc.servlet that wasn't working, but maybe I'm remembering wrong. However, that is definitely the right move if that works.

    There was a reason I didn't start with that approach, but I don't recall why.

  4. linked a pull request that will close this issueservlet-based rewriting of the subsystem #484on Sep 28, 2026
  5. jmesnil commented on Sep 28, 2026

    @jmesnil
    Member

    #484 is an attempt at switching to a servlet-based approach for gRPC. It delegates most of the code to undertow and is much simpler to maintain.
    The servlet provided by gRPC java is experimental API (subject to change) but the surface area is smaller than the current Netty-based API.

  6. added theissue type on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions