You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by "Robert A. Decker" <de...@robdecker.com> on 2012/08/10 04:55:19 UTC

event priority?

Hi,

EventUtil.JobPriority is deprecated. Reading the docs I'm not sure how I'd use it anyway, unless it's just used automatically be the osgi eventing system.

Since it's deprecated is there another way to set job priorities?

I have a situation where event type A fires off high-priority event types B that should preferably be processed before any other already existing event type A are processed.

Rob

Re: event priority?

Posted by "Robert A. Decker" <de...@robdecker.com>.
After restarting the instance it works fine. I'm not sure what went wrong.

The queues are exactly what I was looking for. Works perfect.

Rob

On Aug 11, 2012, at 9:49 AM, Carsten Ziegeler wrote:

> 2012/8/11 Robert A. Decker <de...@robdecker.com>:
>> Job queues look like exactly what I'm looking for. I missed them in the api. Thanks.
>> 
>> I've been trying to launch one using some of the properties but it doesn't seem to launch. Can they just fail silently without throwing exceptions?
> 
> Hmm, actually no, unless there is some hidden bug
>> 
>> The props are:
>> props {event.job.priority=NORM, event.job.retries=5, property.user_id=100004152510575, event.job.run.local=true, event.job.retrydelay=30000, topic.update.sub=user.initial.update, event.job.parallel=10, event.job.
>> queuename=user.queue}
>> 
>> If I remove event.job.* properties it works fine, just not in the way I want it to run.
> 
> And if you just keep the event.job.queuename property?
> 
> Maybe enabling debug logging for org.apache.sling.event gives more
> information. In this case it should log all steps.
> 
> Regards
> Carsten
> 
>> 
>> Rob
>> 
>> 
>> On Aug 10, 2012, at 3:15 AM, Carsten Ziegeler wrote:
>> 
>>> OSGi eventing by itself has no priority - the Sling job handling
>>> doesn't have this either. The JobPriority you're referring to, is just
>>> used to set the priority of the thread executing the job. But it
>>> doesn't contol when this thread will be started.
>>> 
>>> But you could put your  A and B jobs into different job queues -
>>> configure one for each - if you then configure the priority for the B
>>> queue to MAX, B jobs are performed with a higher priority than A
>>> tasks. However this gives you only minimum control and does not ensure
>>> that A jobs are processed before a new B job.
>>> 
>>> Regards
>>> Carsten
>>> 
>>> 2012/8/10 Robert A. Decker <de...@robdecker.com>:
>>>> Hi,
>>>> 
>>>> EventUtil.JobPriority is deprecated. Reading the docs I'm not sure how I'd use it anyway, unless it's just used automatically be the osgi eventing system.
>>>> 
>>>> Since it's deprecated is there another way to set job priorities?
>>>> 
>>>> I have a situation where event type A fires off high-priority event types B that should preferably be processed before any other already existing event type A are processed.
>>>> 
>>>> Rob
>>> 
>>> 
>>> 
>>> --
>>> Carsten Ziegeler
>>> cziegeler@apache.org
>>> 
>> 
> 
> 
> 
> -- 
> Carsten Ziegeler
> cziegeler@apache.org
> 


Re: event priority?

Posted by Carsten Ziegeler <cz...@apache.org>.
2012/8/11 Robert A. Decker <de...@robdecker.com>:
> Job queues look like exactly what I'm looking for. I missed them in the api. Thanks.
>
> I've been trying to launch one using some of the properties but it doesn't seem to launch. Can they just fail silently without throwing exceptions?

Hmm, actually no, unless there is some hidden bug
>
> The props are:
> props {event.job.priority=NORM, event.job.retries=5, property.user_id=100004152510575, event.job.run.local=true, event.job.retrydelay=30000, topic.update.sub=user.initial.update, event.job.parallel=10, event.job.
> queuename=user.queue}
>
> If I remove event.job.* properties it works fine, just not in the way I want it to run.

And if you just keep the event.job.queuename property?

Maybe enabling debug logging for org.apache.sling.event gives more
information. In this case it should log all steps.

Regards
Carsten

>
> Rob
>
>
> On Aug 10, 2012, at 3:15 AM, Carsten Ziegeler wrote:
>
>> OSGi eventing by itself has no priority - the Sling job handling
>> doesn't have this either. The JobPriority you're referring to, is just
>> used to set the priority of the thread executing the job. But it
>> doesn't contol when this thread will be started.
>>
>> But you could put your  A and B jobs into different job queues -
>> configure one for each - if you then configure the priority for the B
>> queue to MAX, B jobs are performed with a higher priority than A
>> tasks. However this gives you only minimum control and does not ensure
>> that A jobs are processed before a new B job.
>>
>> Regards
>> Carsten
>>
>> 2012/8/10 Robert A. Decker <de...@robdecker.com>:
>>> Hi,
>>>
>>> EventUtil.JobPriority is deprecated. Reading the docs I'm not sure how I'd use it anyway, unless it's just used automatically be the osgi eventing system.
>>>
>>> Since it's deprecated is there another way to set job priorities?
>>>
>>> I have a situation where event type A fires off high-priority event types B that should preferably be processed before any other already existing event type A are processed.
>>>
>>> Rob
>>
>>
>>
>> --
>> Carsten Ziegeler
>> cziegeler@apache.org
>>
>



-- 
Carsten Ziegeler
cziegeler@apache.org

Re: event priority?

Posted by "Robert A. Decker" <de...@robdecker.com>.
Job queues look like exactly what I'm looking for. I missed them in the api. Thanks.

I've been trying to launch one using some of the properties but it doesn't seem to launch. Can they just fail silently without throwing exceptions?

The props are:
props {event.job.priority=NORM, event.job.retries=5, property.user_id=100004152510575, event.job.run.local=true, event.job.retrydelay=30000, topic.update.sub=user.initial.update, event.job.parallel=10, event.job.
queuename=user.queue}

If I remove event.job.* properties it works fine, just not in the way I want it to run.

Rob


On Aug 10, 2012, at 3:15 AM, Carsten Ziegeler wrote:

> OSGi eventing by itself has no priority - the Sling job handling
> doesn't have this either. The JobPriority you're referring to, is just
> used to set the priority of the thread executing the job. But it
> doesn't contol when this thread will be started.
> 
> But you could put your  A and B jobs into different job queues -
> configure one for each - if you then configure the priority for the B
> queue to MAX, B jobs are performed with a higher priority than A
> tasks. However this gives you only minimum control and does not ensure
> that A jobs are processed before a new B job.
> 
> Regards
> Carsten
> 
> 2012/8/10 Robert A. Decker <de...@robdecker.com>:
>> Hi,
>> 
>> EventUtil.JobPriority is deprecated. Reading the docs I'm not sure how I'd use it anyway, unless it's just used automatically be the osgi eventing system.
>> 
>> Since it's deprecated is there another way to set job priorities?
>> 
>> I have a situation where event type A fires off high-priority event types B that should preferably be processed before any other already existing event type A are processed.
>> 
>> Rob
> 
> 
> 
> -- 
> Carsten Ziegeler
> cziegeler@apache.org
> 


Re: event priority?

Posted by Carsten Ziegeler <cz...@apache.org>.
OSGi eventing by itself has no priority - the Sling job handling
doesn't have this either. The JobPriority you're referring to, is just
used to set the priority of the thread executing the job. But it
doesn't contol when this thread will be started.

But you could put your  A and B jobs into different job queues -
configure one for each - if you then configure the priority for the B
queue to MAX, B jobs are performed with a higher priority than A
tasks. However this gives you only minimum control and does not ensure
that A jobs are processed before a new B job.

Regards
Carsten

2012/8/10 Robert A. Decker <de...@robdecker.com>:
> Hi,
>
> EventUtil.JobPriority is deprecated. Reading the docs I'm not sure how I'd use it anyway, unless it's just used automatically be the osgi eventing system.
>
> Since it's deprecated is there another way to set job priorities?
>
> I have a situation where event type A fires off high-priority event types B that should preferably be processed before any other already existing event type A are processed.
>
> Rob



-- 
Carsten Ziegeler
cziegeler@apache.org