On Wed, Apr 27, 2011 at 4:19 AM, Marcel Overdijk
<marceloverd...@gmail.com>wrote:

> But is it possible to change queue settings for Deferred task?
>

A DeferredTask is just like any other task. There is no restriction on
DeferredTasks with respect to queue settings or which queues you put them
in.

The fact that a special handler exists for deferred task is inconsequential.
 It's just a simplification, in that you don't need to do that for yourself.
 i.e. if you do not specify a URL, it will work out of the box.  The task is
automatically set to the correct handler when you set the DeferredTask
payload.


>
> Like a deferred Email task I would like to throttle differently then
> anotther queue (using Deferred Task(
>
> So baically the questions are:
> - With Deferred task, can you have multiple queues?
>

Like any task.  You can add a deferred task to any queue.


> - Is it possible to change throttling configuration per Deferred task
> queue?
>

DeferredTasks may be placed in any queue.

Just a note.  You seem to be conflating handlers/servlet mappings with
queues.  There is nothing stopping you from having a single handler accept
requests from any queue.

In the case of the TaskOptions.payload(DeferredTask) method, it will
automatically set the handler url for you if it is not otherwise specified.
 URL is somewhat irrelevant for deferred task since the run() method you
define is essentially the "entry point" for the task.


>
>
> On Apr 26, 4:59 pm, Gianni Mariani <gmari...@google.com> wrote:
> > The preconfigured URL mapping for the DeferredTaskServlet may be used
> > for any queue.  There is no need to specify your own URL mapping that
> > I can see.
> >
> > On Apr 22, 8:05 pm, Marcel Overdijk <marceloverd...@gmail.com> wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > I did some quick testing and I found out:
> >
> > > QueueFactory.getQueue("email-
> > > queue").add(TaskOptions.Builder.withPayload(new
> > > EmailTask(email)).url("/email-queue"));
> >
> > > that with above I can enqueue adeferredtaskin the another queue
> > > (not default).
> > > I had to to use the url("/email-queue") setting otherwise it was
> > > pushed to the default __deferred__ handler.
> >
> > > I just configured the
> > > com.google.apphosting.utils.servlet.DeferredTaskServlet and mapped it
> > > to /email-queue
> >
> > > When I try System.out.println("queue name: " +
> > > DeferredTaskContext.getCurrentRequest().getHeader("X-AppEngine-
> > > QueueName"));
> > > I see the correct e-mail-queue being printed thus so far everything
> > > seems to work.
> >
> > > I also configured <task-retry-limit>5</task-retry-limit> for this
> > > queue but this does not seem to work.
> >
> > > So the setup is working but the DeferredTask / DeferredTaskServlet do
> > > not seem to look into the settings configured in queue.xml
> >
> > > Can somebody confirm this?
> >
> > Do you have more information on how you determined that this is not
> > working?
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > On Apr 22, 11:13 am, Marcel Overdijk <marceloverd...@gmail.com> wrote:
> >
> > > > Maybe use additional mappings to
> > > > com.google.apphosting.utils.servlet.DeferredTaskServlet
> > > > The documentation onDeferredTasks is a little bit sparse... Any
> > > > pointers appreciated.
> >
> > > > Basically what I would like to do is have multiple queue defined with
> > > > different throttling settings.
> > > > And use DeferredTask to send them to one of the queues depending on
> > > > the my needs.
> >
> > > > I would have no problem with configuring additional servlet mappings
> > > > using com.google.apphosting.utils.servlet.DeferredTaskServlet
> >
> > > > On Apr 22, 8:58 am, Marcel Overdijk <marceloverd...@gmail.com>
> wrote:
> >
> > > > > Is it possible to useDeferredTasks outside the default queue?
> >
> > > > > I would like to setup multiple queues with different config
> settings.
> >
> > > > > For theDeferredTasks a specific handler is setup at /_ah/queue/
> > > > > __deferred__ so I wonder how that would work with multiple
> queues....
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "giannim" group.
> To post to this group, send email to gian...@google.com.
> To unsubscribe from this group, send email to
> giannim+unsubscr...@google.com.
> For more options, visit this group at
> http://groups.google.com/a/google.com/group/giannim/?hl=en.
>
>


-- 
Gianni Mariani
Google, Sydney

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to