From 59ff3f152e73063494222f2b650d3625f6246812 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 d313eec1a..1e084d0ec 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(PlayPekkoHttpServer) // uncomment to use the Netty backend .enablePlugins(PekkoGrpcPlugin) // enables source generation for gRPC .enablePlugins(PlayPekkoHttp2Support) // 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 159bed6d3..109d54740 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(PlayPekkoHttpServer) // uncomment to use the Netty backend .enablePlugins(PekkoGrpcPlugin) // enables source generation for gRPC .enablePlugins(PlayPekkoHttp2Support) // 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 7198aaef8..f359a3152 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(PlayPekkoHttpServer) // uncomment to use the Netty backend .settings(commonSettings) lazy val two = (project in file("modules/two")) .enablePlugins(PlayScala) + //.enablePlugins(PlayNettyServer).disablePlugins(PlayPekkoHttpServer) // uncomment to use the Netty backend .settings(commonSettings) lazy val root = (project in file(".")) .enablePlugins(PlayScala, PlayPekkoHttp2Support) + //.enablePlugins(PlayNettyServer).disablePlugins(PlayPekkoHttpServer) // uncomment to use the Netty backend .settings(commonSettings) .settings( name := """play-scala-tls-example""", From a07414160fd24e69daf989b140b053477569ca27 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 ad144addc..f641e7b20 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 Pekko gRPC to both expose a For detailed documentation refer to https://www.playframework.com/documentation/latest/Home and https://pekko.apache.org/docs/pekko-grpc/current/. +## Server backend + +By default, the project uses the Pekko 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 f2ddc829e..468a6c162 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 Pekko gRPC to both expose a For detailed documentation refer to https://www.playframework.com/documentation/latest/Home and https://pekko.apache.org/docs/pekko-grpc/current/. +## Server backend + +By default, the project uses the Pekko 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..69172e2e0 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 Pekko 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.