Last active
December 30, 2019 07:59
-
-
Save gistlyn/879d4ea24d4000b8b00864aaa8c1403a to your computer and use it in GitHub Desktop.
Java Google protoc insecure gRPC Service Client TodoWorld Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.grpc.ManagedChannel; | |
import io.grpc.ManagedChannelBuilder; | |
public class Program { | |
public static void main(String[] args) { | |
ManagedChannel channel = ManagedChannelBuilder.forAddress( | |
"todoworld.servicestack.net", 5054).usePlaintext().build(); | |
GrpcServicesGrpc.GrpcServicesBlockingStub client = GrpcServicesGrpc.newBlockingStub(channel); | |
Services.Hello request = Services.Hello.newBuilder().setName("gRPC Java").build(); | |
String result = client.getHello(request).getResult(); | |
System.out.println(result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment