I'm new in Task Queues. I added one Push queue to test it how it work. 
As mention in documentation I added one task in default queue.

Queue queue = QueueFactory.getDefaultQueue();
queue.add(TaskOptions.Builder.withUrl("/insertentity"));


Here is insert entity code.

@SuppressWarnings("serial")
@WebServlet(name = "InsertEntity", description = "Insert entries in datastore",
 urlPatterns = "/insertentity")
public class InsertEntity extends HttpServlet {

   @Override
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws 
IOException,
         ServletException {
      
      PrintWriter out = resp.getWriter();
       resp.setContentType("text/plain");

       Post post = new Post("This is Fourth Post");
       post.setUserKey(Key.create(User.class, 123));
      
       ofy().save().entity(post).now();

      out.print("post is saved \n");

   }
   
}


I'm just saving one entity in datastore to test it. 

After adding Push Queue I checked the dashboard it successfully added there.

<https://lh3.googleusercontent.com/-WDAFL9YvyD4/WhqS7QZW5HI/AAAAAAAABLU/PXvvbkcQrmQlcpkNCeMrFau38mkaA-bkgCLcBGAs/s1600/Capture3.PNG>
I wait more than one minute and after that I checked datastore there is no 
entity is added. and Task Queue viewer still showing there is one task in 
queue, why it's not running ?
I click on run button to execute it manually it show the message task is 
running but if I check datastore there is no entity added and still there 
is one task in queue Even how many times I click on Run Button to execute 
it. 

<https://lh3.googleusercontent.com/-Ge5pxSBFazo/WhqUhYAbUaI/AAAAAAAABLg/GF_kpkhoFF07F2oBq8a7825kR2XYi2UxwCLcBGAs/s1600/Capture4.PNG>
How can I get log message. How I know what's the problem ? 
*InsertEntity *file work fine If I run it manually it successfully add 
entity in datastore. 

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/8c55575d-779d-431e-8006-b05961a175da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to