I found the answer to this: the Queue.add() method throws IllegalArgumentException if the specified queue isn't configured (BTW, the message in the IllegalArgumentException is "The specified queue is unknown :" but doesn't actually include the queue name in the message string). This isn't as nice as what I'd like, but I can see that the queue.xml file isn't processed until Queue.add() is invoked.
I guess my workaround will be to try to add a dummy task to the queue when I create it: private static Queue queue; static { queue = QueueFactory.getQueue( "myQueue" ); try { queue.add(); } catch ( IllegalArgumentException e ) { queue = QueueFactory.getDefaultQueue(); } } I'm trying to simplify configuration for users of GaeVFS (http://code.google.com/p/gaevfs/). Rather than requiring them to configure task queues for GaeVFS, I'd like to have it use the default queue by default. However, if they want to change the behavior for specific queues, then they can configure them explicitly. Should I open an issue for a simpler way to detect if a queue is configured? or is this something that's unlikely to change? Vince On Fri, Sep 4, 2009 at 6:19 PM, Vince Bonfanti<vbonfa...@gmail.com> wrote: > My first question on task queues... > > I'd like to design my application to use a named (configured) queue if > it exists, but to drop back to using the default queue if the named > queue isn't configured. I'd like to do something like this: > > Queue q = QueueFactory.getQueue( "myQueue" ); > if ( q == null ) { > q = QueueFactory.getDefaultQueue(); > } > > But, the documentation for QueueFactory.getQueue( String ) implies > that this isn't how it works: > > "Attempting to use a non-existing queue name may result in errors > at the point of use of the Queue object and not when calling > getQueue(String)." > > Is there a way to simply and reliably determine whether a given queue > name has been configured? > > Vince > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---