Is there a clean way to resolve a DNS query (get IP by hostname) in Java asynchronously, in non-blocking way (i.e. state machine, not 1 query = 1 thread - I\'d like to run tens
You have multiple options
Option 1: Java 5 Executors
Option 2: JMS with MessageListener
Option 2: Actor based framework
You can scale this well with this.Look at Akka.