Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 29434 invoked from network); 27 Aug 2010 23:47:02 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Aug 2010 23:47:02 -0000 Received: (qmail 1502 invoked by uid 500); 27 Aug 2010 23:47:02 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 1368 invoked by uid 500); 27 Aug 2010 23:47:01 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 1360 invoked by uid 500); 27 Aug 2010 23:47:01 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 1355 invoked by uid 99); 27 Aug 2010 23:47:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Aug 2010 23:47:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Aug 2010 23:47:01 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o7RNke6M009121 for ; Fri, 27 Aug 2010 23:46:40 GMT Message-ID: <12402865.2441282952800482.JavaMail.jira@thor> Date: Fri, 27 Aug 2010 19:46:40 -0400 (EDT) From: "Ben O'Day (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Updated: (CAMEL-3009) Add option to quartz consumer to ignore jobs being triggered due restarting In-Reply-To: <6461740.55431280391171808.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c [ https://issues.apache.org/activemq/browse/CAMEL-3009?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ben O'Day updated CAMEL-3009: ----------------------------- Attachment: camel-quartz-maxTimeDelay-patch.txt I ran into an issue with skipping all missed jobs. This is because a job's scheduledFireTime is ALWAYS before the current time. This difference is usually just a few millis, but can be much longer depending on system load. So, unless I assume an allowable delay to account for this, every run looks like a delayed job... So, I settled on a simpler solution for now. The attached patch just adds a "maxTimeDelay" attribute to skip jobs that have been delayed by more than a specified value (in millis). When a context/route is suspended/resumed, only the jobs that have been delayed less than the maxTimeDelay will be executed. This should handle the majority of cases for long delays and prevent multiple "catch up" jobs from running. Some examples, trigger every 5s with maxTimeDelay=2000 (ms) consumer is paused for 2 hours at most, a single "catch up" job will execute trigger every Wed at noon, maxTimeDelay=60000 consumer paused on Tuesday, resumes on Thursday missed job is skipped, next job will run the following Wed at noon The one remaining case is where you want the delayed job to run (regardless of the delay), but only once. This was my original patch, but seems less useful (and more confusing) than just specifying the max allowed delay. If you think this mode is still valuable, let me know and I can add this back in as well... > Add option to quartz consumer to ignore jobs being triggered due restarting > --------------------------------------------------------------------------- > > Key: CAMEL-3009 > URL: https://issues.apache.org/activemq/browse/CAMEL-3009 > Project: Apache Camel > Issue Type: New Feature > Components: camel-quartz > Affects Versions: 2.4.0 > Reporter: Claus Ibsen > Priority: Minor > Fix For: 2.5.0 > > Attachments: camel-quartz-maxTimeDelay-patch.txt, camel-quartz-skip-missed-jobs-patch.txt > > > Quartz scheduler may by default try to catch up if a quartz consumer has been stopped for a while. > Then when its started it may trigger a series of jobs due they were supposed to be triggered if the consumer has been always running. > We should make it easy to configure an option to tell Camel to ignore those jobs. > For example if you have a trigger to run every 5th second. And you pause a consumer for 2 hours. You may not want quartz to fire 12 * 60 * 2 jobs when its started to catch up for those 2 hours. > Quartz itself may have an option you can configure on the job but it may not be obviously how to do this. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.