I have implemented a Push Task Queue at Google App Engine. This is the code how I call the Task Queue
Queue queue = QueueFactory.getDefaultQueue();
queue.add(TaskOptions.Builder.withUrl("/tasks/myTask").param("myparam", Long.toString(myparam)).retryOptions(RetryOptions.Builder.withTaskRetryLimit(1)).method(TaskOptions.Method.POST)) ;
and this is the code of the Task
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
super.doPost(req, resp);
String param = req.getParameter("myparam") ;
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType("text/plain");
resp.getWriter().println("dummy");
resp.getWriter().flush();
}
But I can see in the logs that my Task returns the status code 405 and the Task will be executed again but in my code I set the value 200 as Response code. Any idea why my code is not working?