use of io.etcd.jetcd.ClientBuilder in project jetcd by coreos.
the class ClientBuilderTest method testMaxInboundMessageSize.
@Test
public void testMaxInboundMessageSize() throws URISyntaxException {
final int value = 1024 + new Random().nextInt(10);
final ClientBuilder builder = Client.builder().endpoints(new URI("http://127.0.0.1:2379")).maxInboundMessageSize(value);
final VertxChannelBuilder channelBuilder = (VertxChannelBuilder) new ClientConnectionManager(builder).defaultChannelBuilder();
assertThat(channelBuilder.nettyBuilder()).hasFieldOrPropertyWithValue("maxInboundMessageSize", value);
}
use of io.etcd.jetcd.ClientBuilder in project jetcd by coreos.
the class ClientBuilderTest method testDefaultNamespace.
@Test
public void testDefaultNamespace() throws URISyntaxException {
// test default namespace setting
final ClientBuilder builder = Client.builder().endpoints(new URI("http://127.0.0.1:2379"));
final ClientConnectionManager connectionManager = new ClientConnectionManager(builder);
assertThat(connectionManager.getNamespace()).isEqualTo(ByteSequence.EMPTY);
}
use of io.etcd.jetcd.ClientBuilder in project dubbo by alibaba.
the class JEtcdClientWrapper method prepareClient.
private Client prepareClient(URL url) {
int maxInboundSize = DEFAULT_INBOUND_SIZE;
if (StringUtils.isNotEmpty(System.getProperty(GRPC_MAX_INBOUND_SIZE_KEY))) {
maxInboundSize = Integer.valueOf(System.getProperty(GRPC_MAX_INBOUND_SIZE_KEY));
}
// TODO, uses default pick-first round robin.
ClientBuilder clientBuilder = Client.builder().endpoints(endPoints(url.getBackupAddress())).maxInboundMessageSize(maxInboundSize);
return clientBuilder.build();
}
Aggregations