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 46CED7840 for ; Wed, 12 Oct 2011 09:08:32 +0000 (UTC) Received: (qmail 37455 invoked by uid 500); 12 Oct 2011 09:08:31 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 37369 invoked by uid 500); 12 Oct 2011 09:08:31 -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 37359 invoked by uid 99); 12 Oct 2011 09:08:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Oct 2011 09:08:31 +0000 X-ASF-Spam-Status: No, hits=1.8 required=5.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of cmoulliard@gmail.com designates 209.85.216.45 as permitted sender) Received: from [209.85.216.45] (HELO mail-qw0-f45.google.com) (209.85.216.45) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Oct 2011 09:08:25 +0000 Received: by qadb10 with SMTP id b10so461839qad.32 for ; Wed, 12 Oct 2011 02:08:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=xPUv+tiAhZ9q5ITx1MlvIXQb2FQXpT7kay68YIqvcRc=; b=YyG8AaayP11nJAXiX485RTZ6eBDdyM3UPtNXD0i4TwOZ6El7LNJp8YyJ2Tg0RU1LgH XISsNviDMqKEzeRS9o7JyQSnxt6nHq2mG7c0sUusS/aEnxLzwQCXbMVAydhrvw/N5tY+ qIEnCR4yv59AuWtMEwUgZApnGcxTxW8paEuEc= MIME-Version: 1.0 Received: by 10.68.35.1 with SMTP id d1mr52772465pbj.55.1318410483674; Wed, 12 Oct 2011 02:08:03 -0700 (PDT) Received: by 10.142.101.1 with HTTP; Wed, 12 Oct 2011 02:08:03 -0700 (PDT) In-Reply-To: References: <4E7C6224.70808@die-schneider.net> Date: Wed, 12 Oct 2011 11:08:03 +0200 Message-ID: Subject: Re: Best practices to communicate between Camel Contexts in different OSGi bundles From: Charles Moulliard To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org NMR is an in memory bus that you can use to send sync/async objects without the cost of the serialization. Endpoints (producers/consumers) are registered in the bus when Camel routes are started and are available for all the bundles ! Thread pools can be configured. NMR is not persistent compare to JMS On Wed, Oct 12, 2011 at 10:59 AM, Guillaume Nodet wrote: > Avoiding serialization is the most important one I think. > > On Wed, Oct 12, 2011 at 10:01, Christian M=FCller > wrote: > >> We use the camel jms/activemq component for this. >> >> @Charles: Could you please share the advantges of camel nmr over camel >> jms/activemq with us!? >> >> Best, >> Christian >> >> On Wed, Oct 12, 2011 at 8:36 AM, Charles Moulliard > >wrote: >> >> > Hi, >> > >> > On Karaf/Servicemix, the recommended approach to communicate between >> > camel routes deployed in separate bundles is to use camel-nmr >> > component >> > >> > Regards, >> > >> > Charles >> > >> > >> > >> > On Fri, Sep 23, 2011 at 12:40 PM, Christian Schneider >> > wrote: >> > > Hi =A0Andrei, >> > > >> > > how about using simple OSGi services? You can create a service >> reference >> > in >> > > your spring context and call it as a bean in a camel route. >> > > This has the advantage that the communication is not tied to camel. = So >> > the >> > > bundle implementing the service does not have to know about camel. >> > > >> > > Christian >> > > >> > > >> > > =A0Am 23.09.2011 09:46, schrieb Andrei Shakirin: >> > >> >> > >> Hi, >> > >> >> > >> I would like to ask what is the best practice to establish >> communication >> > >> between two Camel contexts deployed in a different bundles in OSGi >> > >> environment. >> > >> >> > >> Actually I see the following ways: >> > >> >> > >> A) VM component. >> > >> =A0 =A0 Declare and deploy different contexts and provide communica= tion >> > using >> > >> "vm:" >> > >> =A0 =A0Disadvantage: VM designed for async communication and create= s new >> > >> threads for consuming messages that not always desired. Addition >> > settings >> > >> for VM is necessary to get synchronious response. >> > >> >> > >> B) JMS component. >> > >> =A0 =A0 The same as (A) but uses JMS component >> > >> =A0 =A0Disadvantage: JMS produces overhead that is not always desir= ed. >> > >> >> > >> C) Share Camel Context as OSGi Service and provide communication us= ing >> > >> "direct:" >> > >> =A0 =A0 =A0Expose Camel Context as OSGi service, get it in other bu= ndles and >> > add >> > >> the routes. Use "direct:" for communication. >> > >> =A0 =A0 =A0Disadvantage: have no idea how use this approach with Sp= ring >> routes >> > >> configuration >> > >> >> > >> D) Expose routes as OSGi services >> > >> =A0 =A0 =A0 Each route is exposed as OSGi service and uses the >> > producerTemplate >> > >> to kick off the route when another bundle invokes on the service. >> > >> =A0 =A0 =A0Disadvantage: requires additional code to expose and inv= oke the >> > >> routes >> > >> >> > >> E) Share Spring context via "" >> > >> =A0 =A0 =A0 One bundle exports spring configuration as resource, an= other one >> > >> imports it in Spring configuration. Spring and Camel context are >> shared. >> > >> =A0 =A0 =A0Disadvantage: import resources is not the best OSGi prac= tice, >> > bundles >> > >> are staying coupled >> > >> >> > >> Do you prefer one of proposed ways or there is a different one? >> > >> >> > >> Regards, >> > >> Andrei. >> > >> >> > > >> > > >> > > -- >> > > -- >> > > Christian Schneider >> > > http://www.liquid-reality.de >> > > >> > > Open Source Architect >> > > Talend Application Integration Division http://www.talend.com >> > > >> > > >> > >> > > > > -- > ------------------------ > Guillaume Nodet > ------------------------ > Blog: http://gnodet.blogspot.com/ > ------------------------ > Open Source SOA > http://fusesource.com >