use of com.navercorp.pinpoint.grpc.client.config.SslOption in project pinpoint by naver.
the class GrpcTransportConfig method read.
public void read(Properties properties) {
ValueAnnotationProcessor reader = new ValueAnnotationProcessor();
reader.process(this, properties);
this.agentClientOption = readAgentClientOption(properties);
// Metadata
this.metadataClientOption = readMetadataClientOption(properties);
// Stat
this.statClientOption = readStatClientOption(properties);
// Span
this.spanClientOption = readSpanClientOption(properties);
// Ssl
SslOption sslOption = readSslOption(properties);
this.sslOption = sslOption;
}
use of com.navercorp.pinpoint.grpc.client.config.SslOption in project pinpoint by naver.
the class AgentGrpcDataSenderProvider method newChannelFactoryBuilder.
ChannelFactoryBuilder newChannelFactoryBuilder(boolean sslEnable) {
final int channelExecutorQueueSize = grpcTransportConfig.getAgentChannelExecutorQueueSize();
final UnaryCallDeadlineInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(grpcTransportConfig.getAgentRequestTimeout());
final ClientOption clientOption = grpcTransportConfig.getAgentClientOption();
ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("AgentGrpcDataSender");
channelFactoryBuilder.setHeaderFactory(headerFactory);
channelFactoryBuilder.setNameResolverProvider(nameResolverProvider);
channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
if (clientInterceptorList != null) {
for (ClientInterceptor clientInterceptor : clientInterceptorList) {
logger.info("addClientInterceptor:{}", clientInterceptor);
channelFactoryBuilder.addClientInterceptor(clientInterceptor);
}
}
channelFactoryBuilder.setExecutorQueueSize(channelExecutorQueueSize);
channelFactoryBuilder.setClientOption(clientOption);
if (sslEnable) {
SslOption sslOption = grpcTransportConfig.getSslOption();
channelFactoryBuilder.setSslOption(sslOption);
}
return channelFactoryBuilder;
}
use of com.navercorp.pinpoint.grpc.client.config.SslOption in project pinpoint by naver.
the class MetadataGrpcDataSenderProvider method newChannelFactoryBuilder.
protected ChannelFactoryBuilder newChannelFactoryBuilder(boolean sslEnable) {
final int channelExecutorQueueSize = grpcTransportConfig.getMetadataChannelExecutorQueueSize();
final UnaryCallDeadlineInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(grpcTransportConfig.getMetadataRequestTimeout());
final ClientOption clientOption = grpcTransportConfig.getMetadataClientOption();
ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("MetadataGrpcDataSender");
channelFactoryBuilder.setHeaderFactory(headerFactory);
channelFactoryBuilder.setNameResolverProvider(nameResolverProvider);
channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
if (clientInterceptorList != null) {
for (ClientInterceptor clientInterceptor : clientInterceptorList) {
logger.info("addClientInterceptor:{}", clientInterceptor);
channelFactoryBuilder.addClientInterceptor(clientInterceptor);
}
}
channelFactoryBuilder.setExecutorQueueSize(channelExecutorQueueSize);
channelFactoryBuilder.setClientOption(clientOption);
if (sslEnable) {
SslOption sslOption = grpcTransportConfig.getSslOption();
channelFactoryBuilder.setSslOption(sslOption);
}
return channelFactoryBuilder;
}
use of com.navercorp.pinpoint.grpc.client.config.SslOption in project pinpoint by naver.
the class StatGrpcDataSenderProvider method newChannelFactoryBuilder.
private ChannelFactoryBuilder newChannelFactoryBuilder(boolean sslEnable) {
final int channelExecutorQueueSize = grpcTransportConfig.getStatChannelExecutorQueueSize();
final UnaryCallDeadlineInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(grpcTransportConfig.getStatRequestTimeout());
final ClientOption clientOption = grpcTransportConfig.getStatClientOption();
ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("StatGrpcDataSender");
channelFactoryBuilder.setHeaderFactory(headerFactory);
channelFactoryBuilder.setNameResolverProvider(nameResolverProvider);
channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
if (clientInterceptorList != null) {
for (ClientInterceptor clientInterceptor : clientInterceptorList) {
logger.info("addClientInterceptor:{}", clientInterceptor);
channelFactoryBuilder.addClientInterceptor(clientInterceptor);
}
}
channelFactoryBuilder.setExecutorQueueSize(channelExecutorQueueSize);
channelFactoryBuilder.setClientOption(clientOption);
if (sslEnable) {
SslOption sslOption = grpcTransportConfig.getSslOption();
channelFactoryBuilder.setSslOption(sslOption);
}
return channelFactoryBuilder;
}
use of com.navercorp.pinpoint.grpc.client.config.SslOption in project pinpoint by naver.
the class GrpcTransportConfig method readSslOption.
public SslOption readSslOption(final Properties properties) {
final String sslPrefix = "profiler.transport.grpc.ssl.";
String agentRootPath = properties.getProperty(AgentDirectory.AGENT_ROOT_PATH_KEY);
final SslOption.Builder builder = new SslOption.Builder(agentRootPath);
ValueAnnotationProcessor reader = new ValueAnnotationProcessor();
reader.process(builder, new PropertyPlaceholderHelper.PlaceholderResolver() {
@Override
public String resolvePlaceholder(String placeholderName) {
String prefix = sslPrefix + placeholderName;
return properties.getProperty(prefix);
}
});
return builder.build();
}
Aggregations