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 8B4E09CBB for ; Thu, 14 Jun 2012 11:27:21 +0000 (UTC) Received: (qmail 20125 invoked by uid 500); 14 Jun 2012 11:27:21 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 19943 invoked by uid 500); 14 Jun 2012 11:27:19 -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 19932 invoked by uid 99); 14 Jun 2012 11:27:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2012 11:27:18 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of hekonsek@gmail.com designates 209.85.160.173 as permitted sender) Received: from [209.85.160.173] (HELO mail-gh0-f173.google.com) (209.85.160.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2012 11:27:12 +0000 Received: by ghrr14 with SMTP id r14so1439848ghr.32 for ; Thu, 14 Jun 2012 04:26:52 -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=xQjiPFFfh5n50M1ZnGTGdsdCxgnUjJaipoLs5OPOaAQ=; b=RsJg3Wa+dYO9n+nMOssn+DBh9KkYgFiMfv/OwUw6Yx2A/luf3nKPunDvap9c/C7//2 a1hUgj9aoFeDEfEAqrWiELXzFwYegw2b73a22gD9XYQs42QLzMxmUbwK6OQq7VBFo94k 9e380Zlv1288u5f2ydSkMpn3FwnoIXIL4uZQHaZEUP9iyl0oa7qhBFbcja09DNgm7qHi GSukElOlPiVnjnPuEkFp/+hFlfCfwcSQ+cV8CsWjKqKmi0l3BIItAYnAz9tLwfqFwT6S NF+ucKBLV/RZs5RhutjYcW6QSDbkNFZ82z3LVNLgIF7Mn/nn+kA6zBGwi2nMu0d3R1DB swzg== MIME-Version: 1.0 Received: by 10.236.78.195 with SMTP id g43mr2020305yhe.62.1339673212248; Thu, 14 Jun 2012 04:26:52 -0700 (PDT) Received: by 10.236.207.196 with HTTP; Thu, 14 Jun 2012 04:26:52 -0700 (PDT) In-Reply-To: <1339669134990-5714477.post@n5.nabble.com> References: <1339669134990-5714477.post@n5.nabble.com> Date: Thu, 14 Jun 2012 13:26:52 +0200 Message-ID: Subject: Re: copy of Exchange during Multicast From: Henryk Konsek To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi, > Is there a way to make changes done to the > header visible in further processing? Yes. Actually modifications to the headers of the exchanged copied by multicast are available in the aggregator. In the example below GroupedExchangeAggregationStrategy will aggregate two exchanges copied by multicast. And each of the aggregated messages will got another header set on it (HEADER1 and HEADER2 respectively). ____________________________ CamelContext camelContext = new DefaultCamelContext(); camelContext.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from("direct:start").multicast(new GroupedExchangeAggregationStrategy()). to("direct:headerModifier1", "direct:headerModifier2"). end(). to("log:AGGREGATED"); from("direct:headerModifier1").process(new Processor() { @Override public void process(Exchange exchange) throws Exception { exchange.getIn().setHeader("KEY1", "VALUE1"); } }); from("direct:headerModifier2").process(new Processor() { @Override public void process(Exchange exchange) throws Exception { exchange.getIn().setHeader("KEY2", "VALUE2"); } }); } }); camelContext.start(); camelContext.createProducerTemplate().sendBody("direct:start", "TestMe!"); ____________________________ Kind regards. -- Henryk Konsek http://henryk-konsek.blogspot.com