camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tracy Snell (JIRA)" <>
Subject [jira] Commented: (CAMEL-3239) camel-quartz should require unique timername
Date Thu, 06 Jan 2011 01:53:49 GMT


Tracy Snell commented on CAMEL-3239:

The only time to check for dupes is when adding it to the scheduler so was pondering.
    private void doAddJob(JobDetail job, Trigger trigger) throws SchedulerException {

        String triggerName = trigger.getName();
        if (!isClustered()){
            // add the context name so different contexts can have the same timer name
            triggerName = getCamelContext().getName() + "-" + getCamelContext().getName();
        // adjust the rest of the method to handle collisions.

If the job is clustered then we don't want to append anything. It's the users responsibility
to be aware that names are global inside the cluster. This keeps the trigger name set by the
user in the actual Trigger instance. Now if they they tried to get a trigger directly from
the scheduler then they would have to append "-" + context.getName. Again it relies on the
user being aware of how trigger names are put into the scheduler. Not ideal but I haven't
thought of a better way (yet) to support restart/resume and prevent duplicate names in a camel


> camel-quartz should require unique timername
> --------------------------------------------
>                 Key: CAMEL-3239
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-quartz
>    Affects Versions: 2.4.0
>            Reporter: Bengt Rodehav
>            Priority: Minor
>             Fix For: 2.6.0
> I'm using camel-quartz (Camel 2.4) and have some problems with the timer name (part of
the URI).
> It seems that if I have two different routes (using camel-quartz) with the same timername,
only one of the quartz endpoints will be activated, e g:
> from("quartz://mytimername"?cron=0+*+*+*+*+?+*").to(endpoint1)
> from("quartz://mytimername"?cron=30+*+*+*+*+?+*").to(endpoint2)
> If I make sure that the timernames are unique, both quartz endpoints will work. Thus
I conclude that the timername must be unique (maybe this is a quartz thing and not a camel-quartz
> However, I get no indication that something is wrong since the camel route is started
and looks fine although the quartz endpoint will never trigger. This is not a good situation.
In my case I use this for monitoring purposes. I thought that the monitoring worked fine but
it was actually never triggered at all.
> I'm not sure if this due to camel-quartz or quartz itself. However, if it is possible
for camel-quartz to determine that the endpoint was created OK (not OK if duplicate timer
names), then this should case the camel context to fail.
> I run this in an OSGi environment (Karaf 1.6.0). Thus routes like the above can be created
independent of each other which makes it hard to guarantee that the timername is unique.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message