Skip to content

Instantly share code, notes, and snippets.

@JoelPM
Created February 5, 2014 07:15
final MessageDistributor messageDistributor = new MessageDistributor();
new Thread(messageDistributor).start();
TProcessorFactory processorFactory = new TProcessorFactory(null) {
@Override
public TProcessor getProcessor(TTransport trans) {
messageDistributor.addClient(new MessageServiceClient(trans));
return new MessageService.Processor(messageDistributor);
}
};
TServerTransport serverTransport = new TServerSocket(port);
TServer server = new TThreadPoolServer(processorFactory, serverTransport);
LOGGER.info("Server started");
server.serve();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment