Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5261B18D47 for ; Sat, 6 Jun 2015 04:01:29 +0000 (UTC) Received: (qmail 54445 invoked by uid 500); 6 Jun 2015 04:01:28 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 54393 invoked by uid 500); 6 Jun 2015 04:01:28 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 54374 invoked by uid 99); 6 Jun 2015 04:01:28 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Jun 2015 04:01:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 2E1581A466B for ; Sat, 6 Jun 2015 04:01:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 5.213 X-Spam-Level: ***** X-Spam-Status: No, score=5.213 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 4UJn4GIpE_Dz for ; Sat, 6 Jun 2015 04:01:21 +0000 (UTC) Received: from mail-ig0-f175.google.com (mail-ig0-f175.google.com [209.85.213.175]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 8327924965 for ; Sat, 6 Jun 2015 04:01:20 +0000 (UTC) Received: by igbzc4 with SMTP id zc4so29514811igb.0 for ; Fri, 05 Jun 2015 21:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=XWeJ9dU8jnPdxkKUKPq513l+8CxB8ip/NwYHo1foEEs=; b=P2dz8SnCrKoui8HcQX0/GiAsSMD65XPsh1lX2NshwOJ9EBIWKhPXbG0ATSinGz2Thb Njg08QKNHHSJUbfb2BeMGhlH152dTx1GQIK5WtMi7MvrHVJAOq761W7PoO3xhG/O+TSb AptY1YEL8I7uNQnLhszGXFDVfyq8nvdsrpQ8StVfmP59YNvGTk8IKStrzU3rxi/Feao0 7ZJMD6uKy5K0HeH1aBOb/eeUXcoXn0QsQ8PxOW1DbMSuiywsUVj7g9ST9CdtXC3uGhlA 5Jnf/5pJlNGEMSGZX3WkVpE6nfbu8QQDpHIQJBuwoFlb7IOULoki4TpQn0OF4syju+xU lSTg== MIME-Version: 1.0 X-Received: by 10.43.169.137 with SMTP id nm9mr13347471icc.82.1433563279520; Fri, 05 Jun 2015 21:01:19 -0700 (PDT) Received: by 10.36.149.194 with HTTP; Fri, 5 Jun 2015 21:01:19 -0700 (PDT) In-Reply-To: References: <1433522441894-5767916.post@n5.nabble.com> Date: Sat, 6 Jun 2015 09:31:19 +0530 Message-ID: Subject: Re: Is there any way to unschedule the Camel quartz job From: Ravindra Godbole To: users@camel.apache.org Content-Type: multipart/alternative; boundary=001a11c2d1f60a03f80517d176cc --001a11c2d1f60a03f80517d176cc Content-Type: text/plain; charset=UTF-8 To use controlbus you need to identify/name your route. Your from definition will look like this from("quartz://myGroup/everyMinute?cron=0+0/1+*+*+*+? &stateful=true).routeId("stopThisRoute"). .to("stream:out")/ If you dont plan to use the controlbus, then in the current stopRoute method you can stop the route with following lines. context.stopRoute("stopThisRoute"); On Fri, Jun 5, 2015 at 11:02 PM, Andrew Block wrote: > Take a look at the Control Bus [1] which provides the functionality to > start/stop routes from another route. > > - Andy > > [1] - http://camel.apache.org/controlbus.html > > -- > Andrew Block > > > On June 5, 2015 at 11:41:24 AM, Akram (akram.sa18@gmail.com) wrote: > > I am triggering the quartz cron scheduler in one route. The requirement is > to > stop/remove the scheduled quartz job from another route. I have tried the > below code but in vain. > //Quartz route > /from("quartz://myGroup/everyMinute?cron=0+0/1+*+*+*+?&stateful=true) > .to("stream:out")/ > > //Another route to stop the quartz scheduler > /from("restlet:/stopquartz?restletMethod=GET") > .beanRef("processor", "StopRoute") > .to("stream:out");/ > > //Stop Route method > /public void stopRoute(Exchange exchange) throws Exception { > CamelContext context = exchange.getContext(); > ServiceStatus status = > context.getRouteStatus(exchange.getIn().getHeader(ROUTE_NAME).toString()); > if (!(status == ServiceStatus.Stopped || status == > ServiceStatus.Stopping)) { > context.stopRoute(ROUTE_NAME); > > exchange.getOut().setBody(context.getRouteStatus(exchange.getIn().getHeader(ROUTE_NAME).toString())); > }else{ > exchange.getOut().setBody(ROUTE_NAME+" is already in stopped > state"); > > } > }/ > > Quartz route is not stopping and Scheduled job is still running. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Is-there-any-way-to-unschedule-the-Camel-quartz-job-tp5767916.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- - Ravi *[ View My Youtube Channel ]* Phone: +91 *98 509 760 91* --001a11c2d1f60a03f80517d176cc--