0

I'm having difficulty understanding some aspects of Google AppEngine Push Task Queue for java, namely, when a task is executed, where does the response go?

If I add something to the queue like this:

Queue queue = QueueFactory.getDefaultQueue();
queue.add(withUrl("/worker").param("key", key));

Then sometime later the task is executed, with something like this:

public class SomeServlet extends HttpServlet {
  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    ...
    resp.getWriter().println("something");  //-- where does this response go???
  }
}

Sorry for the newbie question, but where does this response go? My app didn't set up a normal http request so it's not waiting for a normal http response. I must be missing something fundamental about the task queue.

aez
  • 2,406
  • 2
  • 26
  • 46

2 Answers2

5

The response doesn't go anywhere. In a task you would typically write to the datastore, add new tasks to task queue, send xmpp, call external URLs.

If the response code is 200 OK, the task is removed from the queue, if it's an error code, it is retried (depending on retry settings).

tesdal
  • 2,409
  • 16
  • 11
0

There is no document indicated where GAE stored these responses. I would not surprise GAE just don't care the response after it trigger the request url successfully.

By the way, I don't see a point to care about the response. If you want to log what happen during the task execution, you should use Log instead. https://developers.google.com/appengine/docs/java/runtime#Logging

lucemia
  • 6,349
  • 5
  • 42
  • 75
  • Hmmm... maybe your 2nd paragraph is the whole point: you never actually use this in a way that you actually care about the HTTP response? The HTTP response is only used by the task queue mediator thingy to determine if the task execution was successful? Do you think that's it? – aez Jun 22 '12 at 18:06