Search in sources :

Example 6 with SslOption

use of com.navercorp.pinpoint.grpc.client.config.SslOption in project pinpoint by naver.

the class SpanGrpcDataSenderProvider method newChannelFactoryBuilder.

private ChannelFactoryBuilder newChannelFactoryBuilder(boolean sslEnable) {
    final int channelExecutorQueueSize = grpcTransportConfig.getSpanChannelExecutorQueueSize();
    final ClientOption clientOption = grpcTransportConfig.getSpanClientOption();
    ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("SpanGrpcDataSender");
    channelFactoryBuilder.setHeaderFactory(headerFactory);
    channelFactoryBuilder.setNameResolverProvider(nameResolverProvider);
    final ClientInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(grpcTransportConfig.getSpanRequestTimeout());
    channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
    // channelFactoryBuilder.addClientInterceptor(discardClientInterceptor);
    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;
}
Also used : UnaryCallDeadlineInterceptor(com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor) SslOption(com.navercorp.pinpoint.grpc.client.config.SslOption) DiscardClientInterceptor(com.navercorp.pinpoint.grpc.client.interceptor.DiscardClientInterceptor) ClientInterceptor(io.grpc.ClientInterceptor) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Aggregations

SslOption (com.navercorp.pinpoint.grpc.client.config.SslOption)6 ChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder)4 DefaultChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)4 UnaryCallDeadlineInterceptor (com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor)4 ClientOption (com.navercorp.pinpoint.grpc.client.config.ClientOption)4 ClientInterceptor (io.grpc.ClientInterceptor)4 ValueAnnotationProcessor (com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor)2 PropertyPlaceholderHelper (com.navercorp.pinpoint.bootstrap.util.spring.PropertyPlaceholderHelper)1 DiscardClientInterceptor (com.navercorp.pinpoint.grpc.client.interceptor.DiscardClientInterceptor)1