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 7B822230E for ; Tue, 3 May 2011 22:26:47 +0000 (UTC) Received: (qmail 7198 invoked by uid 500); 3 May 2011 22:26:47 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 7165 invoked by uid 500); 3 May 2011 22:26:47 -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 7157 invoked by uid 99); 3 May 2011 22:26:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 May 2011 22:26:47 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dwhytock@gmail.com designates 209.85.160.45 as permitted sender) Received: from [209.85.160.45] (HELO mail-pw0-f45.google.com) (209.85.160.45) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 May 2011 22:26:42 +0000 Received: by pwi6 with SMTP id 6so296815pwi.32 for ; Tue, 03 May 2011 15:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=nkU0QYNhstPSxQ/D2PoZK2OBtMBP+2cCSmpbpWmhMqY=; b=S8vJVYdckUnst72jbeKKHPVOjAlRfoa5d8jK1zLDKZMh50NPBnzjm+APm+JTLd2xj4 BAm3aRLh7SlPMZUx+iDJPu4ONOv7pvqG/6bidKNzoTf9jLV+nJmZBT8lj7XoKZhwKsoT MmfczYexqf0dvDTSajPuV9D8lWLPJ95UCCSvg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=DSBIBTBC3IcKpS12r7KjV7dqc5Vw5n5Np8Lpg+ckZMf4BVyP8o3db1NeJXvFVRFDdA Z4Viz7N5G8psxlw7iM3T9CxQi90sWeUpiSUjpTa4lIm/ZuyQbcRpiCRo0yJx2ZnycyhJ p9t1tp8zaZzNrkfOpEri4labVPEeDpKHbsCUs= MIME-Version: 1.0 Received: by 10.68.39.168 with SMTP id q8mr495080pbk.118.1304461581125; Tue, 03 May 2011 15:26:21 -0700 (PDT) Received: by 10.68.63.65 with HTTP; Tue, 3 May 2011 15:26:21 -0700 (PDT) In-Reply-To: <91783E5730D6DD4AB5B1B518437F54911A6196@de-ex013.groupinfra.com> References: <91783E5730D6DD4AB5B1B518437F54911A6196@de-ex013.groupinfra.com> Date: Tue, 3 May 2011 18:26:21 -0400 Message-ID: Subject: Re: Problem designing a camel route for an OSGi system. From: Donald Whytock To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I get multiple routes in OSGi by having a service that provides a singleton CamelContext. Bundles consume the same CamelContext and create on it whatever routes they need. Though I do this in Java, not Spring, so this might not be what you're looking for. Don On Tue, May 3, 2011 at 5:18 PM, Klug, Johannes w= rote: > > I'm having some troubles with this as well. Could someone enlighten us wh= at the best way would be to get multiple routes into a single OSGi applicat= ion? > > > -----Original Message----- > From: Mark Doyle [mailto:markjohndoyle@googlemail.com] > Sent: Sun 5/1/2011 10:02 PM > To: users@camel.apache.org > Subject: Problem designing a camel route for an OSGi system. > > I have the spring file below. It simply creates a couple of beans > which are used in a camel route. The camel route is obviously > configured in the context section. One of the beans is actually an > OSGi service (id camelParameterProvider) which means it's used by > multiple service consumer bundles (In this case there are many eclipse > views using it to get data). Unfortunately this means all service > consumers share the same bean which has the same route! (I assume the > same camel context?) This would be fine but I want to filter the > incoming data using the parameterFilterer bean. The filtering part > works fine except that all the views are sharing the same service > provider bean so when one filters the route all the other consumers > only receive the filtered messages too. > > One way I explored to solve this was to use the bundle scope for the > bean. Unfortunately the camel route references only a bean uri (the > "to" part of the route) so no messages are routed. I guess camel has > no way to know which instance of the bean to route to (and why would > it). > > Is this a symptom of a bad design or is there a way around this. > Perhaps creating a bean that provides the OGSi service AND is a > routebuilder then trying to use that with bundle or prototype scope... > > P.S. I'm not sure if this is a Camel, Spring, or OSGi issue! =A0:) > > I created a diagram here that may explain the overall view better: > http://dl.dropbox.com/u/10007025/hbird/pictures/hummingbird%20gui%20param= eter%20retrieval.png > > Spring file: > > =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0class=3D"org.hbird.rcpgui.camelparameterpr= ovider.ParameterNameFilterer"> > =A0 =A0 =A0 =A0 > > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0class=3D"org.hbird.rcpgui.camelparameterpr= ovider.CamelParameterProvider" > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0autowire=3D"autodetect"> > =A0 =A0 =A0 =A0 > > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0snip! > =A0 =A0 =A0 =A0 > > =A0 =A0 =A0 =A0 xmlns=3D"http://camel.apache.org/schema/spring"> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > > > > > Think green - keep it on the screen. > > This e-mail and any attachment is for authorised use by the intended reci= pient(s) only. It may contain proprietary material, confidential informatio= n and/or be subject to legal privilege. It should not be copied, disclosed = to, retained or used by, any other party. If you are not an intended recipi= ent then please promptly delete this e-mail and any attachment and all copi= es and inform the sender. Thank you. > >