You can use something like Commons GenericObjectPool to do this pretty easily. You should definitely keep connections open rather than opening a new one every time.
On Mon, Sep 6, 2010 at 3:11 AM, Utku Can Topçu <u...@topcu.gen.tr> wrote: > Hi All, > > We're about to deploy a thrift service in production that will have a huge > load of "oneway" service calls. > Right now we're now opening and closing a thrift connection/client for each > call that I can assume is not a good practice. > > Are there any projects or patterns involved in pooling and monitoring the > thrift clients in Java? > > As far as I know the Hector project handles this issue for the > CassandraClient, are there any good practices for a generalized thrift > service? > > Regards, > Utku >