Rev 1946 | Rev 2885 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
package in.shop2020.payment.service;import org.apache.thrift.protocol.TBinaryProtocol;import org.apache.thrift.protocol.TProtocolFactory;import org.apache.thrift.server.TServer;import org.apache.thrift.server.TThreadPoolServer;import org.apache.thrift.transport.TFramedTransport;import org.apache.thrift.transport.TServerSocket;import org.apache.thrift.transport.TServerTransport;import org.apache.thrift.transport.TTransportFactory;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import in.shop2020.payment.service.handler.PaymentServiceHandler;import in.shop2020.payments.PaymentService.Processor;public class PaymentServer {private static Logger logger = LoggerFactory.getLogger(PaymentServer.class);private static PaymentServiceHandler handler;private static Processor processor;public static void main(String[] args){try{handler = new PaymentServiceHandler();processor = new Processor(handler);TServerTransport serverTransport = new TServerSocket(9012);TTransportFactory tFactory = new TFramedTransport.Factory();TProtocolFactory pFactory = new TBinaryProtocol.Factory();TServer server = new TThreadPoolServer(processor, serverTransport, tFactory, pFactory);logger.info("Payment service started on port 9012");server.serve();}catch(Exception ex){ex.printStackTrace();}}}