Task queue java

Posted by user268515 on Stack Overflow See other posts from Stack Overflow or by user268515
Published on 2010-06-12T06:28:42Z Indexed on 2010/06/12 6:32 UTC
Read the original article Hit count: 487

Filed under:
|
|
|

Hi i'm new to Task queue concepts when i referred the guide I got struck on this line

queue.add( DatastoreServiceFactory.getDatastoreService().getCurrentTransaction(), TaskOptions().url("/path/to/my/worker"));

what is TaskOptions() method. Is it default method are method created manually what will TaskOptions() method will return.

I created a method called TaskOption() when i to return a string value its saying error as "The method url(String) is undefined for the type String"

In url what i want to specify servlet are any other.

My doubt may be stupid but plz clarify it.

Thank you, sharun.

© Stack Overflow or respective owner

Task queue java

Posted by user268515 on Stack Overflow See other posts from Stack Overflow or by user268515
Published on 2010-06-12T12:21:36Z Indexed on 2010/06/12 12:32 UTC
Read the original article Hit count: 487

Filed under:
|
|
|

Hi i'm new to Task queue java API i tried a simple Example for it. My idea is to redirect the queue file to a servlet and to print some statement in the servlet.But it doesn't work. i mapped web.xml and used default queue I didnt get any Error but the file is not redirected to servlet . this is the codee i followed

taskq.java
           public class taskq extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)throwsIOException {


    Queue queue = QueueFactory.getDefaultQueue();

    System.out.println("taskqueue");
    queue.add(url("/worker"));

}
    worker.java
         public class worker extends HttpServlet {

private static final long serialVersionUID = 1L;
public String s;

public void doGet(HttpServletRequest req, HttpServletResponse resp)throws IOException {
    String s="crimsom";
    System.out.println(s);
}

 }

Please Help me on this issue. Regards Sharun.

© Stack Overflow or respective owner

Related posts about java

Related posts about api