Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically read a Queue's parameters

I've got a queue defined in queue.xml file

<queue-entries>
    <queue>
        <name>crawler</name>
        <rate>1/s</rate>
        <retry-parameters>
            ...
            <task-retry-limit>5</task-retry-limit>
        </retry-parameters>
    </queue>
</queue-entries>

To obtain a queue in Java I'm using simple code

Queue queue = QueueFactory.getQueue("crawler");

Now I need to obtain the task-retry-limit value for given queue. Is it possible? I haven't found any method to do so in javadoc.

like image 854
tomrozb Avatar asked Jul 24 '26 17:07

tomrozb


1 Answers

It appears this is not possible.

If you look at the source code, you will see that there is no such functionality defined.

The only property you can retrieve is the name, with Queue.getName();


I see no way to retrieve it using the current appengine api.

A hacky way as you call it, could be to parse the queue.xml file with an xml library, and extract the value manually.

like image 163
Tim Avatar answered Jul 26 '26 07:07

Tim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!