In JavaDoc, I see that I can go from JobManager to queue and then to
configuration:
Queue queue = jobManager.getQueue(queueName)
QueueConfiguration config = queue.getConfiguration();
but at that point I get stuck. I can’t do anything with the config other than
read the values. Same thing with QueueConfigurationManager.
In the Sling class JobHandlingReplicationQueueProvider I see some code that
does what I’d like to do using org.osgi.service.cm classes to set up a factory
configuration for a queue. Basically, in the getOrCreateQueue method it does:
org.osgi.service.cm.ConfigurationAdmin configAdmin;
if (jobManager.getQueue(name) == null) {
org.osgi.service.cm.Configuration config =
configAdmin.createFactoryConfiguration(QueueConfiguration.class.getName(),
null);
// create a props dict and set values
Dictionary<String, Object> props = new Hashtable<String, Object>();
props.put(ConfigurationConstants.PROP_NAME, name);
props.put(ConfigurationConstants.PROP_PRIORITY, "MAX");
config.update(props);
}
So, I do understand what’s happening here and I can work with this example. But
using this method I can't change any queue properties on a running queue.
Is this the route I should take? Or is there something simpler? I also see
InternalQueueConfiguration but not sure if I should really be looking there...
Robert A. Decker
[email protected]
http://robdecker.com/about
On 30 Apr 2014, at 11:56, Carsten Ziegeler <[email protected]> wrote:
> The only way to configure the priority now is to use the queue
> configuration - which means all jobs in the same queue use the same
> priority.
>
> Carsten
>
>
> 2014-04-29 21:18 GMT+02:00 Robert A. Decker <[email protected]>:
>
>> I notice that the property
>> org.apache.sling.event.jobs.Job.PROPERTY_JOB_PRIORITY is deprecated.
>>
>> Is there something equivalent? I’ve been looking through the javadoc I
>> generated from a recent build and I don’t see anything.
>>
>> I found it useful to be able to set job priority in the past when I’ve had
>> thousands of jobs running in different queues.
>>
>>
>> Robert A. Decker
>> [email protected]
>> http://robdecker.com/about
>>
>>
>>
>
>
> --
> Carsten Ziegeler
> [email protected]