0

My problem is that I want to schedule a job on a server every 10 min which will download, parse and store rss feeds on a database. I have read about Task Queue on App Engine but i am not sure if that would be a right tool for the job?? Thanks guys

Adrian

Adrian L
  • 443
  • 1
  • 8
  • 19

1 Answers1

2

It sounds like you want to schedule tasks using cron: see docs for java and python.

Cron will trigger a GET request for your handler, which has a request deadline of 10 minutes, which should be sufficient if you're running every 10 minutes.

tx802
  • 3,524
  • 2
  • 17
  • 22
  • oh yeh thats even better, thanks. So the GET request would just be a path to a servlet which will do the job right? – Adrian L Sep 24 '14 at 12:07
  • That's right, so you can send a request manually too, but you'll probably want to secure your cron handlers against general use. It's all in the [docs](https://cloud.google.com/appengine/docs/java/config/cron). – tx802 Sep 24 '14 at 14:54
  • Thanks tx802 I have had a look at the docs, all seems pretty clear to me! :) – Adrian L Sep 24 '14 at 14:59
  • I would have one more question. I am building a web app that will serve for a browser clients as well as android and iOS devices. For that reason I want to go with google endpoints so can I create only endpoint classes instead of Java servlets? Or am I wrong in thinking that. Well, the docs left me with unanswered questions ;( – Adrian L Sep 24 '14 at 21:43
  • Servlets and Endpoints are both really different ways to access your business logic. So I am guessing that you will use a servlet (triggered by cron) to grab your RSS feeds and store the data locally (in Datastore or Cloud SQL). You will then create your Endpoint classes to provide access to that locally stored data to your Android and web clients. – tx802 Sep 25 '14 at 06:55
  • So as a minimum would I have only one servlet which would do the cron job and the rest would be endpoint classes ? I was just wondering about how are servlets actually different from endpoints?? They both do pretty much same job except that they access datasource different ways (query params vs. rest)? Am I right here? – Adrian L Sep 25 '14 at 09:24
  • Yes, the Endpoints take care of serialising your response data and are just simple annotations on your business logic. With the servlet you just need to implement a `doGet()` method to make the appropriate calls on your other classes. A lot of App Engine relies on servlets (in the Java runtime): cron, task queues, etc, but Endpoints make it easier to expose your application logic to web and mobile clients. – tx802 Sep 25 '14 at 10:03