Load balance with thrift and nginx -


i have following thrift server (socket), listening connections on specific host/port.

 final tprotocolfactory factory = new tbinaryprotocol.factory();         tnonblockingservertransport servertransport = new tnonblockingserversocket(serverport);   final signatureservice.processor theprocessor = new signatureservice.processor(new signatureservicefacade());  tserver server = new thshaserver(new thshaserver.args(servertransport).processor(theprocessor).                 protocolfactory(factory).                 minworkerthreads(minthreads).                 maxworkerthreads(maxthreads)); 

and following client connection:

clienttransport = new tframedtransport(new tsocket(signaturehost, signatureport)); final tprotocol theprotocol = new tbinaryprotocol(clienttransport); client = new signatureservice.client(theprotocol); clienttransport.open(); //call business specific method client.dostuff(param1, param2, param3); 

as can see in code above need provide host , port in order open connection server.

but want use service discovery load balance support, because i'll have multiple instances of service running.

anybody has example of using nginx? examples using regular http rest based applications.

tks in advance.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -