Skip to content

Commit fe731ee

Browse files
committed
grpc: fix javadoc on module
1 parent 8705c82 commit fe731ee

File tree

2 files changed

+57
-2
lines changed

2 files changed

+57
-2
lines changed

modules/jooby-grpc/src/main/java/io/jooby/grpc/GrpcModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import io.jooby.rpc.grpc.GrpcProcessor;
2020

2121
/**
22-
* Native gRPC extension for Jooby. *
22+
* Native gRPC extension for Jooby.
2323
*
2424
* <p>This module allows you to run strictly-typed gRPC services alongside standard Jooby HTTP
2525
* routes on the exact same port. It completely bypasses standard HTTP/1.1 pipelines in favor of a

modules/jooby-grpc/src/main/java/module-info.java

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,62 @@
33
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
44
* Copyright 2014 Edgar Espina
55
*/
6-
/** GraphQL module. */
6+
7+
import org.slf4j.bridge.SLF4JBridgeHandler;
8+
9+
/**
10+
* Native gRPC extension for Jooby.
11+
*
12+
* <p>This module allows you to run strictly-typed gRPC services alongside standard Jooby HTTP
13+
* routes on the exact same port. It completely bypasses standard HTTP/1.1 pipelines in favor of a
14+
* highly optimized, reactive, native interceptor tailored for HTTP/2 multiplexing and trailing
15+
* headers.
16+
*
17+
* <h3>Usage</h3>
18+
*
19+
* <p>gRPC requires HTTP/2. Ensure your Jooby application is configured to use a supported server
20+
* with HTTP/2 enabled.
21+
*
22+
* <pre>{@code
23+
* import io.jooby.Jooby;
24+
* import io.jooby.ServerOptions;
25+
* import io.jooby.grpc.GrpcModule;
26+
* * public class App extends Jooby {
27+
* {
28+
* setServerOptions(new ServerOptions().setHttp2(true).setSecurePort(8443));
29+
* * // Install the extension and register your services
30+
* install(new GrpcModule(new GreeterService()));
31+
* }
32+
* }
33+
* }</pre>
34+
*
35+
* <h3>Dependency Injection</h3>
36+
*
37+
* <p>If your gRPC services require external dependencies (like repositories or configuration), you
38+
* can register the service classes instead of instances. The module will automatically provision
39+
* them using Jooby's DI registry (e.g., Guice, Spring) during the application startup phase.
40+
*
41+
* <pre>{@code
42+
* public class App extends Jooby {
43+
* {
44+
* install(new GuiceModule());
45+
* * // Pass the class reference. Guice will instantiate it!
46+
* install(new GrpcModule(GreeterService.class));
47+
* }
48+
* }
49+
* }</pre>
50+
*
51+
* *
52+
*
53+
* <p><strong>Note:</strong> gRPC services are inherently registered as Singletons. Ensure your
54+
* service implementations are thread-safe and do not hold request-scoped state in instance
55+
* variables.
56+
*
57+
* <h3>Logging</h3>
58+
*
59+
* <p>gRPC internally uses {@code java.util.logging}. This module automatically installs the {@link
60+
* SLF4JBridgeHandler} to redirect all internal gRPC logs to your configured SLF4J backend.
61+
*/
762
module io.jooby.grpc {
863
exports io.jooby.grpc;
964

0 commit comments

Comments
 (0)