Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 354CF183EE for ; Mon, 1 Feb 2016 08:11:02 +0000 (UTC) Received: (qmail 44637 invoked by uid 500); 1 Feb 2016 08:10:40 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 44308 invoked by uid 500); 1 Feb 2016 08:10:40 -0000 Mailing-List: contact issues-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 issues@camel.apache.org Received: (qmail 44226 invoked by uid 99); 1 Feb 2016 08:10:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Feb 2016 08:10:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C5B522C044E for ; Mon, 1 Feb 2016 08:10:39 +0000 (UTC) Date: Mon, 1 Feb 2016 08:10:39 +0000 (UTC) From: "Justin W (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CAMEL-9553) Twitter consumer doesn't respect the delay parameter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Justin W created CAMEL-9553: ------------------------------- Summary: Twitter consumer doesn't respect the delay parameter Key: CAMEL-9553 URL: https://issues.apache.org/jira/browse/CAMEL-9553 Project: Camel Issue Type: Bug Components: camel-twitter Affects Versions: 2.16.2 Environment: OpenJDK Runtime Environment (IcedTea 2.6.4) (Arch Linux build 7.u95_2.6.4-1-x86_64) Reporter: Justin W Priority: Minor I've configured a polling Twitter endpoint with nearly default Spring configuration as follows: {code} from("twitter://search?type=polling&keywords=searchterms&delay=60&consumerKey=[s]&consumerSecret=[s]&accessToken=[s]&accessTokenSecret=[s]") {code} However, it doesn't seem to respect the delay parameter. On debugging, the delay parameter is set properly: {code} public TwitterConsumerPolling(TwitterEndpoint endpoint, Processor processor, Twitter4JConsumer twitter4jConsumer) { super(endpoint, processor); this.twitter4jConsumer = twitter4jConsumer; int delay = endpoint.getProperties().getDelay(); setInitialDelay(1); setDelay(delay); // delay is set properly to 60 here setTimeUnit(TimeUnit.SECONDS); } {code} but when the run() method of the ScheduledPollConsumer runs, the delay parameter is still the default of 500. {code} public void run() { // avoid this thread to throw exceptions because the thread pool wont re-schedule a new thread try { // log starting if (LoggingLevel.ERROR == runLoggingLevel) { LOG.error("Scheduled task started on: {}", this.getEndpoint()); } else if (LoggingLevel.WARN == runLoggingLevel) { LOG.warn("Scheduled task started on: {}", this.getEndpoint()); } else if (LoggingLevel.INFO == runLoggingLevel) { LOG.info("Scheduled task started on: {}", this.getEndpoint()); } else if (LoggingLevel.DEBUG == runLoggingLevel) { LOG.debug("Scheduled task started on: {}", this.getEndpoint()); } else { LOG.trace("Scheduled task started on: {}", this.getEndpoint()); } // execute scheduled task doRun(); // log completed if (LoggingLevel.ERROR == runLoggingLevel) { LOG.error("Scheduled task completed on: {}", this.getEndpoint()); } else if (LoggingLevel.WARN == runLoggingLevel) { LOG.warn("Scheduled task completed on: {}", this.getEndpoint()); } else if (LoggingLevel.INFO == runLoggingLevel) { LOG.info("Scheduled task completed on: {}", this.getEndpoint()); } else if (LoggingLevel.DEBUG == runLoggingLevel) { LOG.debug("Scheduled task completed on: {}", this.getEndpoint()); } else { LOG.trace("Scheduled task completed on: {}", this.getEndpoint()); } } catch (Error e) { // must catch Error, to ensure the task is re-scheduled LOG.error("Error occurred during running scheduled task on: " + this.getEndpoint() + ", due: " + e.getMessage(), e); } } {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)