public static void main(String[] args) throws UnknownHostException {
    String host = System.getenv("ECHO_SERVICE_HOST");
    String port = System.getenv("ECHO_SERVICE_PORT");
    final ManagedChannel channel = ManagedChannelBuilder.forTarget(host + ":" + port)
		.usePlaintext()
        .build();

    final String self = InetAddress.getLocalHost().getHostName();

    ExecutorService executorService = Executors.newFixedThreadPool(THREADS);
    for (int i = 0; i < THREADS; i++) {
      EchoServiceGrpc.EchoServiceBlockingStub stub = EchoServiceGrpc.newBlockingStub(channel);
      executorService.submit(() -> {
        while (true) {
        	try {
              EchoResponse response = stub.echo(EchoRequest.newBuilder()
                      .setMessage(self + ": " + Thread.currentThread().getName())
                      .build());
              System.out.println(response.getFrom() + " echoed");

              Thread.sleep(RANDOM.nextInt(700));
            } catch (Exception e) {
        		e.printStackTrace();
            }
        }
      });
    }
  }
This is a simple client that depends on external load balancing, either via a proxy,
or a L4/L7 load balancer.
kubernetes-lb-example/echo-client-simple/src/main/java/com/example/grpc/client/SimpleEchoClient.java