-
Notifications
You must be signed in to change notification settings - Fork 81
WIP: Make number of Netty thread configurable #2448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,11 +20,11 @@ | |
| import org.opendaylight.mdsal.dom.api.DOMRpcService; | ||
| import org.opendaylight.mdsal.dom.api.DOMSchemaService; | ||
| import org.opendaylight.netconf.transport.http.HttpServerStackConfiguration; | ||
| import org.opendaylight.netconf.transport.tcp.BootstrapFactory; | ||
| import org.opendaylight.restconf.api.query.PrettyPrintParam; | ||
| import org.opendaylight.restconf.server.AAAShiroPrincipalService; | ||
| import org.opendaylight.restconf.server.MessageEncoding; | ||
| import org.opendaylight.restconf.server.NettyEndpointConfiguration; | ||
| import org.opendaylight.restconf.server.OSGiNettyEndpoint; | ||
| import org.opendaylight.restconf.server.PrincipalService; | ||
| import org.opendaylight.restconf.server.SimpleNettyEndpoint; | ||
| import org.opendaylight.restconf.server.jaxrs.JaxRsLocationProvider; | ||
|
|
@@ -88,17 +88,21 @@ protected boolean initProcedure() { | |
|
|
||
| final PrincipalService service = new AAAShiroPrincipalService((AAAShiroWebEnvironment) webEnvironment); | ||
| final var serverStackGrouping = new HttpServerStackConfiguration(new TcpBuilder().setTcp(tcpConfig).build()); | ||
| final BootstrapFactory factory = new BootstrapFactory("lighty-restconf-nb-worker", 1); | ||
| final NettyEndpointConfiguration configuration = new NettyEndpointConfiguration(ErrorTagMapping.RFC8040, | ||
| PrettyPrintParam.FALSE, Uint16.valueOf(0), Uint32.valueOf(10000), restconfServletContextPath, | ||
| MessageEncoding.JSON, serverStackGrouping); | ||
| this.mdsalRestconfStreamRegistry = new MdsalRestconfStreamRegistry(domDataBroker, domNotificationService, | ||
| domSchemaService, new JaxRsLocationProvider(), databindProvider); | ||
|
|
||
| nettyEndpoint = | ||
| new SimpleNettyEndpoint(server, service, mdsalRestconfStreamRegistry, factory, | ||
| configuration); | ||
|
|
||
| /** | ||
| * FIXME make number of work threads configurable | ||
| * | ||
| * 1. use new RestconfBootstrapFactory(bootstrapFactoryConfig) | ||
| * 2. create lighty.io config | ||
| * 2. hardcode 0 which is ODL netconf default allowing to use Netty default | ||
| */ | ||
| final var pros = OSGiNettyEndpoint.props(bootstrapFactory, configuration); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line will not compile because the To fix this, you need to create a final var bootstrapFactory = new org.opendaylight.netconf.transport.tcp.BootstrapFactory("lighty-restconf-nb-worker", 0);Note that you'll need to use the fully qualified name or re-add the import for |
||
| nettyEndpoint = new OSGiNettyEndpoint(server, service, mdsalRestconfStreamRegistry, pros); | ||
| return true; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a small typo in the numbering of this list; the second item
2.should probably be3..