Search in sources :

Example 6 with ConnectionFactoryBuilder

use of net.spy.memcached.ConnectionFactoryBuilder in project camel by apache.

the class KestrelComponent method doStart.

@Override
protected void doStart() throws Exception {
    super.doStart();
    ConnectionFactoryBuilder builder = new ConnectionFactoryBuilder();
    // VERY IMPORTANT! Otherwise, spymemcached optimizes away concurrent gets
    builder.setShouldOptimize(false);
    // We never want spymemcached to time out
    builder.setOpTimeout(9999999);
    // Retry upon failure
    builder.setFailureMode(FailureMode.Retry);
    memcachedConnectionFactory = builder.build();
}
Also used : ConnectionFactoryBuilder(net.spy.memcached.ConnectionFactoryBuilder)

Aggregations

ConnectionFactoryBuilder (net.spy.memcached.ConnectionFactoryBuilder)6 MemcachedClient (net.spy.memcached.MemcachedClient)4 InetSocketAddress (java.net.InetSocketAddress)2 AuthDescriptor (net.spy.memcached.auth.AuthDescriptor)2 PlainCallbackHandler (net.spy.memcached.auth.PlainCallbackHandler)2 DataXException (com.alibaba.datax.common.exception.DataXException)1 ResourceHolder (io.druid.collections.ResourceHolder)1 StupidResourceHolder (io.druid.collections.StupidResourceHolder)1 ArrayList (java.util.ArrayList)1 Random (java.util.Random)1 ConnectionFactory (net.spy.memcached.ConnectionFactory)1 Protocol (net.spy.memcached.ConnectionFactoryBuilder.Protocol)1 SerializingTranscoder (net.spy.memcached.transcoders.SerializingTranscoder)1