Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielLiu1123 committed Dec 22, 2024
1 parent 2c9dfb1 commit cf210a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ implementation("io.grpc:grpc-testing-proto")

```java
@SpringBootApplication
public class SimpleApp extends SimpleServiceGrpc.SimpleServiceImplBase {
public class QuickStartApp extends SimpleServiceGrpc.SimpleServiceImplBase {

public static void main(String[] args) {
new SpringApplicationBuilder(SimpleApp.class)
.properties("grpc.client.base-packages=io.grpc")
.properties("grpc.client.authority=127.0.0.1:9090")
new SpringApplicationBuilder(QuickStartApp.class)
.properties("grpc.client.base-packages=io.grpc") // scan packages for gRPC clients
.properties("grpc.client.authority=127.0.0.1:9090") // default authority for gRPC clients
.run(args);
}

Expand All @@ -33,13 +33,12 @@ public class SimpleApp extends SimpleServiceGrpc.SimpleServiceImplBase {
}

@Bean
ApplicationRunner runner(SimpleServiceGrpc.SimpleServiceBlockingStub stub) {
ApplicationRunner runner(SimpleServiceGrpc.SimpleServiceBlockingStub stub) { // inject gRPC client
return args -> {
var response = stub.unaryRpc(SimpleRequest.newBuilder().setRequestMessage("World!").build());
System.out.println(response.getResponseMessage());
};
}

}
```

Expand Down
7 changes: 3 additions & 4 deletions website/docs/05-quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public class QuickStartApp extends SimpleServiceGrpc.SimpleServiceImplBase {

public static void main(String[] args) {
new SpringApplicationBuilder(QuickStartApp.class)
.properties("grpc.client.base-packages=io.grpc")
.properties("grpc.client.authority=127.0.0.1:9090")
.properties("grpc.client.base-packages=io.grpc") // scan packages for gRPC clients
.properties("grpc.client.authority=127.0.0.1:9090") // default authority for gRPC clients
.run(args);
}

Expand All @@ -74,13 +74,12 @@ public class QuickStartApp extends SimpleServiceGrpc.SimpleServiceImplBase {
}

@Bean
ApplicationRunner runner(SimpleServiceGrpc.SimpleServiceBlockingStub stub) { // Inject gRPC stub
ApplicationRunner runner(SimpleServiceGrpc.SimpleServiceBlockingStub stub) { // inject gRPC client
return args -> {
var response = stub.unaryRpc(SimpleRequest.newBuilder().setRequestMessage("World!").build());
System.out.println(response.getResponseMessage());
};
}

}
```

Expand Down

0 comments on commit cf210a0

Please sign in to comment.