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 7AE3C101B4 for ; Mon, 16 Dec 2013 17:40:16 +0000 (UTC) Received: (qmail 18763 invoked by uid 500); 16 Dec 2013 17:40:15 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 18716 invoked by uid 500); 16 Dec 2013 17:40:15 -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 18708 invoked by uid 99); 16 Dec 2013 17:40:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Dec 2013 17:40:15 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kraythe@gmail.com designates 209.85.212.53 as permitted sender) Received: from [209.85.212.53] (HELO mail-vb0-f53.google.com) (209.85.212.53) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Dec 2013 17:40:10 +0000 Received: by mail-vb0-f53.google.com with SMTP id o19so3394394vbm.12 for ; Mon, 16 Dec 2013 09:39:49 -0800 (PST) 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=uwBDoQumlCUEaW9Bj34i6RSOvLfJSmnutV5JW8uypkY=; b=oK0I8dmAuY5DQlTrBY8xUVOlbQJQWUdV0V+Mnxyz8YeeYOUCXCJ1zT8quord/C8vRN c7o4Auw4PRyz/tEhwh6VSztFgYfgXwJOF2vtnOy+W/IsTD+MXmSmyTwLswNRTnK3WRdI Fot7kuSu6bEWUiSFV5itqERlas7jB7YPDiI56ZKKv5h1SpSlwA8dH7/wZJ58QgQRgCzF Tzm0you0cf+JAcKOK2QYT1rH0VdyK3qrOrc4HNuAIfkROXe98TLzFf1E6jBRmJ2tc2pf nvHbbcXbd8A068Z5WcFA42oU1E1S8/4WEVxBbVRLoAX7IdfancyTZqwon85RCIi90xAz FDPg== MIME-Version: 1.0 X-Received: by 10.52.240.201 with SMTP id wc9mr845377vdc.60.1387215589305; Mon, 16 Dec 2013 09:39:49 -0800 (PST) Received: by 10.58.172.34 with HTTP; Mon, 16 Dec 2013 09:39:49 -0800 (PST) In-Reply-To: <1431828F-CB7E-4AD4-876E-4D8F8041A03D@integratix.net> References: <1431828F-CB7E-4AD4-876E-4D8F8041A03D@integratix.net> Date: Mon, 16 Dec 2013 11:39:49 -0600 Message-ID: Subject: Re: camel for "short" programs From: "kraythe ." To: Camel Users List Content-Type: multipart/alternative; boundary=20cf307ca5186d7e3604edaa4c2b X-Virus-Checked: Checked by ClamAV on apache.org --20cf307ca5186d7e3604edaa4c2b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable There is nothing that you are trying to do that camel wont do. You simply don't seem want to do it. So why waste our time? You can start it up and shut it down if thats your flavor. You dont really need to do such a thing, but if you want, go for it. You can leave it running as most of us do and use quartz triggers, events on files showing up, AMQ events and so on. The only limit is your imagination. If you care looking for camel-ruby that is weird (and Ruby is ENTIRELY unmaintainable anyway). If you want to do it in something else then we all wish you good fortune but there is NOTHING preventing you from reaching your goals with camel. Always try to think "Is my problem unique to my company or domain?" if not then the odds are its solved already, you jsut have to learn the provided APIs. *Robert Simmons Jr. MSc. - Lead Java Architect @ EA* *Author of: Hardcore Java (2003) and Maintainable Java (2012)* *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39 * On Mon, Dec 16, 2013 at 8:34 AM, Walzer, Thomas < thomas.walzer@integratix.net> wrote: > Why not keep the context+routes running? > If nothing=B4s there nothing gets processed. > We transfer a gazillion files and poll like crazy (5 sec) even when > nothing is expected. Who cares on a corporate network? > > Am 15.12.2013 um 20:11 schrieb Romain Manni-Bucau = : > > > Not really true since it prevents from using camel consumers which > > doesn't support it so it makes camel not as useful as it could. > > Romain Manni-Bucau > > Twitter: @rmannibucau > > Blog: http://rmannibucau.wordpress.com/ > > LinkedIn: http://fr.linkedin.com/in/rmannibucau > > Github: https://github.com/rmannibucau > > > > > > > > 2013/12/15 Claus Ibsen : > >> You can use route policy / event notifier or what not to know when > >> there is nothing more to process and then signal to the main thread to > >> stop camel and terminate the jvm. > >> > >> No hacks is needed just use the API there is already there. > >> > >> On Sun, Dec 15, 2013 at 6:57 PM, Romain Manni-Bucau > >> wrote: > >>> If you look camel architecture it is great but not usable for batches > >>> *out of the box*. What I find "sad" is the code needed to support thi= s > >>> (common) use case shouldn't be that important: > >>> > >>> CamelContext ctx =3D new ...(); > >>> ctx.setSingleShort(true); // or singleExecution(); maybe > >>> > >>> This would set the same boolean on the consumers which would not wait > >>> to get data if nothing is available anymore and would stop the route. > >>> Once all routes are stopped the context would be stopped too. > >>> > >>> This way it would be easy to write cron-ned mains with camel without > app hacks. > >>> > >>> Romain Manni-Bucau > >>> Twitter: @rmannibucau > >>> Blog: http://rmannibucau.wordpress.com/ > >>> LinkedIn: http://fr.linkedin.com/in/rmannibucau > >>> Github: https://github.com/rmannibucau > >>> > >>> > >>> > >>> 2013/12/15 John D. Ament : > >>>> Romain, > >>>> > >>>> What do you mean? > >>>> > >>>> On Sat, Dec 14, 2013 at 4:00 PM, Romain Manni-Bucau > >>>> wrote: > >>>>> Hmm, so if I understand you camel will not solve it. I find it sad > cause > >>>>> camel pipeline and the numerous components are 2 tempting things fo= r > >>>>> batches but the fact to be able to process what is here when > starting and > >>>>> dont wait another messge is no more is present is mandatory to be > usable. > >>>>> > >>>>> I know it is hackable but I dont think it is clean if not in camel > itself. > >>>>> Context should get an option propagated to consumer for it imo. > >>>>> Le 14 d=E9c. 2013 16:32, "kraythe ." a =E9crit = : > >>>>> > >>>>>> Indeed. Though you could use it to start up and shut down, nothing > stopping > >>>>>> you. I would not opt for that choice if I had some sort of > deployment > >>>>>> system where I could keep the routes running. > >>>>>> > >>>>>> *Robert Simmons Jr. MSc. - Lead Java Architect @ EA* > >>>>>> *Author of: Hardcore Java (2003) and Maintainable Java (2012)* > >>>>>> *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39 > >>>>>> * > >>>>>> > >>>>>> > >>>>>> On Sat, Dec 14, 2013 at 9:09 AM, John D. Ament < > john.d.ament@gmail.com > >>>>>>> wrote: > >>>>>> > >>>>>>> Why not use a polling consumer? > >>>>>>> > >>>>>>> On Sat, Dec 14, 2013 at 6:25 AM, Romain Manni-Bucau > >>>>>>> wrote: > >>>>>>>> Hi > >>>>>>>> > >>>>>>>> any opinion on how to make consumers consume all what is possibl= e > when > >>>>>>>> program is running then shutdown the route once processed? > >>>>>>>> > >>>>>>>> It is basically needed for BatchEE camel extension ( > >>>>>>>> > >>>>>>> > >>>>>> > https://git-wip-us.apache.org/repos/asf?p=3Dincubator-batchee.git;a=3Dblo= b;f=3Dextensions/camel/src/main/java/org/apache/batchee/camel/CamelItemRead= er.java;h=3Dbf4d289a8fea4a18f783353c3cb25d1aa9050018;hb=3DHEAD > >>>>>>>> ) + I wondered it for some batches I wrote some months ago witho= ut > >>>>>>>> camel because the infra needed for it was too heavy (route polic= y > + > >>>>>>>> few other things) compared to the gain. > >>>>>>>> > >>>>>>>> ATM batchee relies on timeout but surely not the best way to do. > >>>>>>>> > >>>>>>>> Romain Manni-Bucau > >>>>>>>> Twitter: @rmannibucau > >>>>>>>> Blog: http://rmannibucau.wordpress.com/ > >>>>>>>> LinkedIn: http://fr.linkedin.com/in/rmannibucau > >>>>>>>> Github: https://github.com/rmannibucau > >>>>>>> > >>>>>> > >> > >> > >> > >> -- > >> Claus Ibsen > >> ----------------- > >> Red Hat, Inc. > >> Email: cibsen@redhat.com > >> Twitter: davsclaus > >> Blog: http://davsclaus.com > >> Author of Camel in Action: http://www.manning.com/ibsen > >> Make your Camel applications look hawt, try: http://hawt.io > > --20cf307ca5186d7e3604edaa4c2b--