The API I'm using, spymemcached, basically gives
MemcachedClient memc = new MemCachedClient(new InetSocketAddress("host", port));
It doesn't really give me a connect()
or isConnected()
function. The API offers a DefaultConnectionFactory
but at first look at the code it doesn't look like it manages a connection pool. Does anyone know how to do this in spymemcached or in another Java memcached library?
More generally - what's the most "moral" way to make my application tolerant against loss of connection?
Copyright Notice:Content Author:「djechlin」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/10691528/how-to-connection-pool-memcached-in-java-spymemcached