Skip to content

Make transport.Bootstrap usable with no netty-resolver on classpath#13488

Merged
normanmaurer merged 2 commits intonetty:4.1from
mostroverkhov:disable_resolver
Jul 18, 2023
Merged

Make transport.Bootstrap usable with no netty-resolver on classpath#13488
normanmaurer merged 2 commits intonetty:4.1from
mostroverkhov:disable_resolver

Conversation

@mostroverkhov
Copy link
Copy Markdown
Contributor

@mostroverkhov mostroverkhov commented Jul 13, 2023

Motivation:
Since some address families (e.g. unix sockets) do not need name resolver, It should be possible to exclude netty-resolver from classpath.

Currently excluding name resolver leads to NoClassDefFoundError: AddressResolverGroup during Bootstrap instantiation.

Modification:

Add disableResolver() method to Bootstrap.

Change BootstrapConfig.resolver() return null if Bootstrap.disableResolver() is called.

Introduce ExternalAddressResolver class to hold AddressResolver related references to avoid NoClassDefFoundError if Bootstrap.disableResolver() called and no netty-resolver is on classpath.

Result:

Bootstrap is usable with no netty-resolver on classpath.

Motivation:
Since some address families (e.g. unix sockets) do not need name resolver,
It should be possible to exclude netty-resolver from classpath.

Currently excluding name resolver leads to NoClassDefFoundError: AddressResolverGroup during Bootstrap instantiation.

Modification:

Add disableResolver() method to Bootstrap.

Change BootstrapConfig.resolver() return null if Bootstrap.disableResolver() is called.

Introduce ExternalAddressResolver class to hold AddressResolver related references to avoid NoClassDefFoundError if Bootstrap.disableResolver() called and no netty-resolver is on classpath.

Result:

Bootstrap is usable with no netty-resolver on classpath.
@normanmaurer
Copy link
Copy Markdown
Member

@mostroverkhov so is the only motivation for this to be able to remove one dependency ?

@mostroverkhov
Copy link
Copy Markdown
Contributor Author

@normanmaurer to remove dependency which cant have any use for unix or vm sockets - just dead weight.

@normanmaurer
Copy link
Copy Markdown
Member

@chrisvest @franz1981 WDYT ?

@normanmaurer normanmaurer added this to the 4.1.95.Final milestone Jul 17, 2023
Comment thread transport/src/main/java/io/netty/bootstrap/BootstrapConfig.java Outdated
@mostroverkhov mostroverkhov force-pushed the disable_resolver branch 2 times, most recently from 5838edc to ccd0ee6 Compare July 17, 2023 19:50
Co-authored-by: Chris Vest <mr.chrisvest@gmail.com>
@normanmaurer normanmaurer merged commit fa2c81f into netty:4.1 Jul 18, 2023
normanmaurer pushed a commit that referenced this pull request Jul 18, 2023
…13488)

Motivation:
Since some address families (e.g. unix sockets) do not need name
resolver, It should be possible to exclude netty-resolver from
classpath.

Currently excluding name resolver leads to NoClassDefFoundError:
AddressResolverGroup during Bootstrap instantiation.

Modification:

Add disableResolver() method to Bootstrap.

Change BootstrapConfig.resolver() return null if
Bootstrap.disableResolver() is called.

Introduce ExternalAddressResolver class to hold AddressResolver related
references to avoid NoClassDefFoundError if Bootstrap.disableResolver()
called and no netty-resolver is on classpath.

Result:

Bootstrap is usable with no netty-resolver on classpath.

---------

Co-authored-by: Chris Vest <mr.chrisvest@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants