Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.
package com.azure.cosmos.implementation.http;

import com.azure.cosmos.implementation.Configs;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelOption;
Expand Down Expand Up @@ -63,22 +64,29 @@ public static ReactorNettyClient createWithConnectionProvider(ConnectionProvider
}

private void configureChannelPipelineHandlers() {
Configs configs = this.httpClientConfig.getConfigs();
this.httpClient = this.httpClient.tcpConfiguration(tcpClient -> {

if (this.httpClientConfig.getProxy() != null) {
tcpClient =
tcpClient.proxy(typeSpec -> typeSpec.type(ProxyProvider.Proxy.HTTP).address(this.httpClientConfig.getProxy()));
}
tcpClient =
tcpClient.secure(sslContextSpec -> sslContextSpec.sslContext(this.httpClientConfig.getConfigs().getSslContext()));
tcpClient.secure(sslContextSpec -> sslContextSpec.sslContext(configs.getSslContext()));
if (LoggerFactory.getLogger(REACTOR_NETWORK_LOG_CATEGORY).isTraceEnabled()) {
tcpClient = tcpClient.wiretap(REACTOR_NETWORK_LOG_CATEGORY, LogLevel.INFO);
}
// By default, keep alive is enabled on http client
tcpClient = tcpClient.option(ChannelOption.CONNECT_TIMEOUT_MILLIS,
httpClientConfig.getConfigs().getConnectionAcquireTimeoutInMillis());
configs.getConnectionAcquireTimeoutInMillis());

return tcpClient;
}).httpResponseDecoder(httpResponseDecoderSpec -> {
httpResponseDecoderSpec.maxInitialLineLength(configs.getMaxHttpInitialLineLength());
httpResponseDecoderSpec.maxHeaderSize(configs.getMaxHttpHeaderSize());
httpResponseDecoderSpec.maxChunkSize(configs.getMaxHttpChunkSize());
httpResponseDecoderSpec.validateHeaders(true);
return httpResponseDecoderSpec;
});
}

Expand Down