<NME> ConcurrentClientMain.java
<BEF> package com.github.wenweihu86.raft.example.client;

import com.github.wenweihu86.raft.example.server.service.Example;
import com.github.wenweihu86.raft.example.server.service.ExampleService;
import com.github.wenweihu86.rpc.client.RPCClient;
import com.google.protobuf.util.JsonFormat;

import java.util.concurrent.ExecutorService;

import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * Created by wenweihu86 on 2017/5/14.
 */
    public static void main(String[] args) {
        // parse args
        String ipPorts = args[0];

        // init rpc client
        RPCClient rpcClient = new RPCClient(ipPorts);
        final ExampleService exampleService = new ExampleServiceProxy(rpcClient);

        long startTime = System.currentTimeMillis();
        // set
        }

        // parse args
        String ipPorts = args[0];
        RpcClient rpcClient = new RpcClient(ipPorts);
        ExampleService exampleService = BrpcProxy.getProxy(rpcClient, ExampleService.class);

        ExecutorService readThreadPool = Executors.newFixedThreadPool(3);
        ExecutorService writeThreadPool = Executors.newFixedThreadPool(3);
        Future<?>[] future = new Future[3];
        for (int i = 0; i < 3; i++) {
            future[i] = writeThreadPool.submit(new SetTask(exampleService, readThreadPool));
        }
    }

    public static class SetTask implements Runnable {
        private ExampleService exampleService;
        ExecutorService readThreadPool;

        public SetTask(ExampleService exampleService, ExecutorService readThreadPool) {
            this.exampleService = exampleService;
            this.readThreadPool = readThreadPool;
        }

        @Override
        public void run() {
            while (true) {
                String key = UUID.randomUUID().toString();
                String value = UUID.randomUUID().toString();
                ExampleProto.SetRequest setRequest = ExampleProto.SetRequest.newBuilder()
                        .setKey(key).setValue(value).build();

                long startTime = System.currentTimeMillis();
                ExampleProto.SetResponse setResponse = exampleService.set(setRequest);
                try {
                    if (setResponse != null) {
                        System.out.printf("set request, key=%s, value=%s, response=%s, elapseMS=%d\n",
                                key, value, jsonFormat.printToString(setResponse), System.currentTimeMillis() - startTime);
                        readThreadPool.submit(new GetTask(exampleService, key));
                    } else {
                        System.out.printf("set request failed, key=%s value=%s\n", key, value);
                    }
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
            }
        }
    }

    public static class GetTask implements Runnable {
        private ExampleService exampleService;
        private String key;

        public GetTask(ExampleService exampleService, String key) {
            this.exampleService = exampleService;
            this.key = key;
        }

        @Override
        public void run() {
            ExampleProto.GetRequest getRequest = ExampleProto.GetRequest.newBuilder()
                    .setKey(key).build();
            long startTime = System.currentTimeMillis();
            ExampleProto.GetResponse getResponse = exampleService.get(getRequest);
            try {
                if (getResponse != null) {
                    System.out.printf("get request, key=%s, response=%s, elapseMS=%d\n",
                            key, jsonFormat.printToString(getResponse), System.currentTimeMillis() - startTime);
                } else {
                    System.out.printf("get request failed, key=%s\n", key);
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    }

}

<MSG> update client

<DFF> @@ -2,7 +2,6 @@ package com.github.wenweihu86.raft.example.client;
 
 import com.github.wenweihu86.raft.example.server.service.Example;
 import com.github.wenweihu86.raft.example.server.service.ExampleService;
-import com.github.wenweihu86.rpc.client.RPCClient;
 import com.google.protobuf.util.JsonFormat;
 
 import java.util.concurrent.ExecutorService;
@@ -18,10 +17,7 @@ public class ConcurrentClientMain {
     public static void main(String[] args) {
         // parse args
         String ipPorts = args[0];
-
-        // init rpc client
-        RPCClient rpcClient = new RPCClient(ipPorts);
-        final ExampleService exampleService = new ExampleServiceProxy(rpcClient);
+        final ExampleService exampleService = new ExampleServiceProxy(ipPorts);
 
         long startTime = System.currentTimeMillis();
         // set

update client