I need an equivalent to java.net.InetSocketAddress
that can resolve the host name asynchronously. I'm developing a polling program that must resolve and connect to over 25,000 servers every five minutes indefinitely without a large memory or CPU footprint.
These servers are selected from a database, looped through, and connections are dispatched through the Netty Library. Everything that Netty does is highly efficient and satisfactory, however the thread that loops through and creates InetSocketAddress
instances to pass to Netty is being bottlenecked by the DNS resolutions (as the hostname is looked up on initialization of the InetSocketAddress
). My temporary solution is to create a thread pool that does the DNS resolving, but I would much prefer an actual asynchronous DNS resolution library.
Thanks!