ThriftInterfaceConfiguration cfg = new ThriftInterfaceConfiguration();
cfg.setServerAddress("127.0.0.1");
cfg.setServerPort(19191);
ThriftClientPoolService clientPool = new ThriftClientPoolService(
cfg);
ThriftInterfaceExecutorService executorService = new ThriftInterfaceExecutorService(
cfg);
ThriftServer clientServer = new ThriftServer(clientProcessor,
executorService, new InetSocketAddress("127.0.0.1", 7979));
clientServer.start();
ThriftServer server = new ThriftServer(serverProcessor,
executorService, new InetSocketAddress("127.0.0.1", 19191));
server.start();
Client client = clientPool.acquireSync();
String message = "Test echo message";
String result = client.invokeJsonRpc(message);