@SuppressWarnings("unchecked") private ClientBuilder setDefaultSettings(ClientBuilder builder) { return builder.name(clientName) .codec(ThriftClientFramedCodec.apply(Option.apply(clientId))) .failFast(false) .noFailureAccrual() // disable retries on finagle client builder, as there is only one host per finagle client // we should throw exception immediately on first failure, so DL client could quickly detect // failures and retry other proxies. .retries(1) .keepAlive(true); }
@SuppressWarnings("unchecked") private ClientBuilder setDefaultSettings(ClientBuilder builder) { return builder.name(clientName) .failFast(false) .noFailureAccrual() // disable retries on finagle client builder, as there is only one host per finagle client // we should throw exception immediately on first failure, so DL client could quickly detect // failures and retry other proxies. .retries(1) .keepAlive(true); }
@SuppressWarnings("unchecked") private ClientBuilder setDefaultSettings(ClientBuilder builder) { return builder.name(clientName) .codec(ThriftClientFramedCodec.apply(Option.apply(clientId))) .failFast(false) .noFailureAccrual() // disable retries on finagle client builder, as there is only one host per finagle client // we should throw exception immediately on first failure, so DL client could quickly detect // failures and retry other proxies. .retries(1) .keepAlive(true); }
public PinLaterClient(String host, int port, int concurrency) { this.service = ClientBuilder.safeBuild( ClientBuilder.get() .hosts(new InetSocketAddress(host, port)) .codec(ThriftClientFramedCodec.apply(Option.apply(new ClientId("pinlaterclient")))) .hostConnectionLimit(concurrency) .tcpConnectTimeout(Duration.apply(2, TimeUnit.SECONDS)) .requestTimeout(Duration.apply(10, TimeUnit.SECONDS)) .retries(1)); this.iface = new PinLater.ServiceToClient(service, new TBinaryProtocol.Factory()); }
.codec(ThriftClientFramedCodec.get()) .timeout(Duration.apply(2, TimeUnit.SECONDS)) .retries(4) .hostConnectionLimit(1)
.connectTimeout(Duration.fromMilliseconds(200)) .requestTimeout(Duration.fromSeconds(1)) .retries(20); if (!clientConfig.getThriftMux()) { builder = builder.hostConnectionLimit(1);