use of com.navercorp.pinpoint.grpc.client.interceptor.DiscardClientInterceptor in project pinpoint by naver.
the class SpanClientMock method newChannelFactory.
private ChannelFactory newChannelFactory() {
HeaderFactory headerFactory = new AgentHeaderFactory("mockAgentId", "mockAgentName", "mockApplicationName", ServiceType.UNDEFINED.getCode(), System.currentTimeMillis());
ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("SpanClientMock");
final ClientInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(1000);
channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
final ClientInterceptor discardClientInterceptor = newDiscardClientInterceptor();
channelFactoryBuilder.addClientInterceptor(discardClientInterceptor);
channelFactoryBuilder.setHeaderFactory(headerFactory);
channelFactoryBuilder.setClientOption(new ClientOption());
return channelFactoryBuilder.build();
}
use of com.navercorp.pinpoint.grpc.client.interceptor.DiscardClientInterceptor 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;
}
Aggregations