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 6980B10F17 for ; Mon, 24 Jun 2013 12:56:58 +0000 (UTC) Received: (qmail 24128 invoked by uid 500); 24 Jun 2013 12:56:57 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 24101 invoked by uid 500); 24 Jun 2013 12:56:57 -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 24093 invoked by uid 99); 24 Jun 2013 12:56:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jun 2013 12:56:56 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: encountered temporary error during SPF processing of domain of Jason.P.Barto@gmail.com) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jun 2013 12:56:52 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Ur6JX-00087T-CG for users@camel.apache.org; Mon, 24 Jun 2013 05:56:11 -0700 Date: Mon, 24 Jun 2013 05:56:11 -0700 (PDT) From: jpbarto To: users@camel.apache.org Message-ID: <1372078571374-5734664.post@n5.nabble.com> In-Reply-To: <1371769192824-5734498.post@n5.nabble.com> References: <1371547134689-5734283.post@n5.nabble.com> <1371631880036-5734346.post@n5.nabble.com> <1371769192824-5734498.post@n5.nabble.com> Subject: Re: Camel Integration Advice Needed MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Final Solution: I think I've found the solution I was looking for in the form of the XML 'routes' tag as mentioned previously. In addition to the traditional camel-context.xml I've also created two additional XML files (subscribe-template.xml and publish-template.xml). An example follows: In Java code, when I want to bind one component create a subscription I would execute the following: public void subscribe(final String topic) throws Exception { if (! subscribedConsumerRoutes.containsKey(topic)) { List routes = new ArrayList(); InputStream istream = getClass().getClassLoader().getResourceAsStream(subscriberTemplate); String template = IOUtils.toString(istream, "UTF-8").replace("$topic", topic); istream = IOUtils.toInputStream(template, "UTF-8"); RoutesDefinition routesDef = camelContext.loadRoutesDefinition(istream); camelContext.addRouteDefinitions(routesDef.getRoutes()); for (RouteDefinition route : routesDef.getRoutes()) { routes.add(camelContext.getRoute(route.getId())); } subscribedConsumerRoutes.put(topic, routes); } } The question now becomes how to modify an existing route to add new 'consumers' to the route. For example if a route looks like: How does one modify it to: I can't find a way to get a reference to a route's multicast service so how to best do this... perhaps with a DynamicRouter? -- View this message in context: http://camel.465427.n5.nabble.com/Camel-Integration-Advice-Needed-tp5734283p5734664.html Sent from the Camel - Users mailing list archive at Nabble.com.