use of io.micronaut.http.netty.channel.DefaultEventLoopGroupConfiguration in project micronaut-core by micronaut-projects.
the class DefaultNettyHttpClientRegistry method resolveSocketChannelFactory.
private ChannelFactory resolveSocketChannelFactory(HttpClientConfiguration configuration, BeanContext beanContext) {
final String eventLoopGroup = configuration.getEventLoopGroup();
final EventLoopGroupConfiguration eventLoopGroupConfiguration = beanContext.findBean(EventLoopGroupConfiguration.class, Qualifiers.byName(eventLoopGroup)).orElseGet(() -> {
if (EventLoopGroupConfiguration.DEFAULT.equals(eventLoopGroup)) {
return new DefaultEventLoopGroupConfiguration();
} else {
throw new HttpClientException("Specified event loop group is not defined: " + eventLoopGroup);
}
});
return () -> eventLoopGroupFactory.clientSocketChannelInstance(eventLoopGroupConfiguration);
}
Aggregations