In the last answer, Korea uses the wrong link for the sender, the correct way to do this is:
public class ReduceActor extends UntypedActor { @Override public void onReceive(Object message) throws Exception { if (message instanceof URI) { URI url = (URI) message; AsyncHttpClient asyncHttpClient = new AsyncHttpClient(); final ActorRef sender = getSender(); asyncHttpClient.prepareGet(url.toURL().toString()).execute(new AsyncCompletionHandler<Response>() { @Override public Response onCompleted(Response response) throws Exception { File f = new File("e:/tmp/crawler/" + UUID.randomUUID().toString() + ".html");
Checkout this second branch akka: fooobar.com/questions/1444868 / ...
source share