From abd5c326d922f12c4c3ebc65ce9fb5f1ada99a4b Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Tue, 23 Jan 2024 10:11:47 +0100 Subject: [PATCH 1/2] Enable PlayNettyServer (requires Http2 support for Netty backend) --- play-java-grpc-example/build.sbt | 1 + play-scala-grpc-example/build.sbt | 1 + play-scala-tls-example/build.sbt | 3 +++ 3 files changed, 5 insertions(+) diff --git a/play-java-grpc-example/build.sbt b/play-java-grpc-example/build.sbt index eba82e523..cc8e0476a 100644 --- a/play-java-grpc-example/build.sbt +++ b/play-java-grpc-example/build.sbt @@ -11,6 +11,7 @@ version := "1.0-SNAPSHOT" // build.sbt lazy val `play-java-grpc-example` = (project in file(".")) .enablePlugins(PlayJava) + //.enablePlugins(PlayNettyServer).disablePlugins(PlayAkkaHttpServer) // uncomment to use the Netty backend .enablePlugins(AkkaGrpcPlugin) // enables source generation for gRPC .enablePlugins(PlayAkkaHttp2Support) // enables serving HTTP/2 and gRPC // #grpc_play_plugins diff --git a/play-scala-grpc-example/build.sbt b/play-scala-grpc-example/build.sbt index ec5288f68..710558523 100644 --- a/play-scala-grpc-example/build.sbt +++ b/play-scala-grpc-example/build.sbt @@ -12,6 +12,7 @@ version := "1.0-SNAPSHOT" // build.sbt lazy val `play-scala-grpc-example` = (project in file(".")) .enablePlugins(PlayScala) + //.enablePlugins(PlayNettyServer).disablePlugins(PlayAkkaHttpServer) // uncomment to use the Netty backend .enablePlugins(AkkaGrpcPlugin) // enables source generation for gRPC .enablePlugins(PlayAkkaHttp2Support) // enables serving HTTP/2 and gRPC // #grpc_play_plugins diff --git a/play-scala-tls-example/build.sbt b/play-scala-tls-example/build.sbt index 265e0bb24..a793932c4 100644 --- a/play-scala-tls-example/build.sbt +++ b/play-scala-tls-example/build.sbt @@ -9,14 +9,17 @@ val commonSettings = Seq( lazy val one = (project in file("modules/one")) .enablePlugins(PlayScala) + //.enablePlugins(PlayNettyServer).disablePlugins(PlayAkkaHttpServer) // uncomment to use the Netty backend .settings(commonSettings) lazy val two = (project in file("modules/two")) .enablePlugins(PlayScala) + //.enablePlugins(PlayNettyServer).disablePlugins(PlayAkkaHttpServer) // uncomment to use the Netty backend .settings(commonSettings) lazy val root = (project in file(".")) .enablePlugins(PlayScala, PlayAkkaHttp2Support) + //.enablePlugins(PlayNettyServer).disablePlugins(PlayAkkaHttpServer) // uncomment to use the Netty backend .settings(commonSettings) .settings( name := """play-scala-tls-example""", From 2b961a0eca89d2d082d3cf6147e6094ac6b3e295 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Tue, 23 Jan 2024 11:13:36 +0100 Subject: [PATCH 2/2] Mention server backend in the README --- play-java-grpc-example/README.md | 5 +++++ play-scala-grpc-example/README.md | 5 +++++ play-scala-tls-example/README.md | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/play-java-grpc-example/README.md b/play-java-grpc-example/README.md index fda4f61e0..892e6902c 100644 --- a/play-java-grpc-example/README.md +++ b/play-java-grpc-example/README.md @@ -6,6 +6,11 @@ This is an example application that shows how to use Akka gRPC to both expose an For detailed documentation refer to https://www.playframework.com/documentation/latest/Home and https://developer.lightbend.com/docs/akka-grpc/current/ . +## Server backend + +By default, the project uses the Akka HTTP Server backend. To switch to the Netty Server backend, enable the `PlayNettyServer` sbt plugin in the `build.sbt` file. +In the `build.sbt` of this project, you'll find a commented line for this setting; simply uncomment it to make the switch. +For more detailed information, refer to the Play Framework [documentation](https://www.playframework.com/documentation/3.0.x/Server). ## Sample license diff --git a/play-scala-grpc-example/README.md b/play-scala-grpc-example/README.md index ad98c4095..cc867a34c 100644 --- a/play-scala-grpc-example/README.md +++ b/play-scala-grpc-example/README.md @@ -6,6 +6,11 @@ This is an example application that shows how to use Akka gRPC to both expose an For detailed documentation refer to https://www.playframework.com/documentation/latest/Home and https://developer.lightbend.com/docs/akka-grpc/current/ . +## Server backend + +By default, the project uses the Akka HTTP Server backend. To switch to the Netty Server backend, enable the `PlayNettyServer` sbt plugin in the `build.sbt` file. +In the `build.sbt` of this project, you'll find a commented line for this setting; simply uncomment it to make the switch. +For more detailed information, refer to the Play Framework [documentation](https://www.playframework.com/documentation/3.0.x/Server). ## Sample license diff --git a/play-scala-tls-example/README.md b/play-scala-tls-example/README.md index 9b4db3171..ffd09a8a8 100644 --- a/play-scala-tls-example/README.md +++ b/play-scala-tls-example/README.md @@ -8,6 +8,12 @@ You must have JDK 11 installed on your machine to run this, to take advantage of * [Adoptium OpenJDK](https://adoptium.net/) +## Server backend + +By default, the project uses the Akka HTTP Server backend. To switch to the Netty Server backend, enable the `PlayNettyServer` sbt plugin in the `build.sbt` file. +In the `build.sbt` of this project, you'll find a commented line for this setting; simply uncomment it to make the switch. +For more detailed information, refer to the Play Framework [documentation](https://www.playframework.com/documentation/3.0.x/Server). + ## Generate Certificates To use HTTPS, you must have X.509 certificates. Generating certificates can be painful, so all the scripts needed to generate the certificates needed are included in the `scripts` directory. For more detail, you can see the [Certificate Generation](https://www.playframework.com/documentation/latest/CertificateGeneration) section in Play WS SSL.