Conversation
|
Looks like some scalafmt problems - something up with the IntelliJ scalafmt execution perhaps. |
pekko-http directives that detect grpc/grpc-web requests. This support integration of grpc endpoints alongside other HTTP requests on the same server binding (e.g. HTTP based /healthz handlers etc.).
|
@timw could you add javadoc with |
Done.
There's a spec for the scaladsl directives there already - do we want coverage of the javadsl as well? |
|
|
||
| package org.apache.pekko.grpc.scaladsl | ||
|
|
||
| import org.apache.pekko |
There was a problem hiding this comment.
Can you move keep the pekko imports together?
|
It's not super obvious what use cases this should cover. We already have some examples of Pekko HTTP integrations documented at https://pekko.apache.org/docs/pekko-grpc/current/server/pekko-http.html - perhaps it would be good to add some examples of typical use cases for this API to that page? |
This adds pekko-http directives that detect grpc/grpc-web requests.
This support integration of grpc endpoints alongside other HTTP requests on the same server binding (e.g. HTTP based /healthz handlers etc.) and different handling for different protocol types (e.g. enforcing
Strict-Transport-Securityfor grpc-web requests).Java and Scala DSLs are provided.
Currently the Java DSL uses the
@InternalApiRouteHandlerfrom pekk-http - this could be copied in-tree if that's not considered maintainable.The
GrpcProtocol.detecthasn't been used, as it doesn't check the main type of the MediaType at present - alternatively that could be changed and used for this purpose as well.