Return-Path: Delivered-To: apmail-activemq-camel-dev-archive@locus.apache.org Received: (qmail 95655 invoked from network); 7 Oct 2007 21:39:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Oct 2007 21:39:02 -0000 Received: (qmail 59423 invoked by uid 500); 7 Oct 2007 21:38:50 -0000 Delivered-To: apmail-activemq-camel-dev-archive@activemq.apache.org Received: (qmail 59400 invoked by uid 500); 7 Oct 2007 21:38:50 -0000 Mailing-List: contact camel-dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-dev@activemq.apache.org Received: (qmail 59391 invoked by uid 99); 7 Oct 2007 21:38:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Oct 2007 14:38:50 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of email.wtam@gmail.com designates 64.233.166.179 as permitted sender) Received: from [64.233.166.179] (HELO py-out-1112.google.com) (64.233.166.179) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Oct 2007 21:38:53 +0000 Received: by py-out-1112.google.com with SMTP id p76so2091862pyb for ; Sun, 07 Oct 2007 14:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=0vskpfO681BdWx/Q+UrqJfgyhUMxMlU1HdbnTt0ZmkI=; b=dTx4CycEWfzNgkA7qKm0RxOdU15sQLOoEFwnAhM/GVWR6Tzw7NQiIPIacA3bdk+SVaATjqMVMOqPk1Z5fPOhXbQf3mjjoJv8nMFtsaabEAb89HDpiZBsBA2OkiPiNASn8eK2YeyHHaGuQUSon61Uv9CexB7sy8xLPZaWW2LzN8A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=c/oDGGdEb0sQxCFye+VaAi6D/c55byZxGJFDPu+JNOnXV4/2pmkdrQdaPSEeUrUx7PicODTREA2b69sTh9m6s2E4plp7m4pEIdChRa1jTK1E7fFwq11uJ+o4Dy7YFFuaPPI7FEMHLgPHK0XqXcuek7u2ajWx4KOXztTvMbPPf/c= Received: by 10.65.253.6 with SMTP id f6mr22668635qbs.1191793111940; Sun, 07 Oct 2007 14:38:31 -0700 (PDT) Received: by 10.65.193.13 with HTTP; Sun, 7 Oct 2007 14:38:31 -0700 (PDT) Message-ID: Date: Sun, 7 Oct 2007 17:38:31 -0400 From: "William Tam" To: camel-dev@activemq.apache.org Subject: Re: a few comments on SedaComponent In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org > > > > BTW, I think if the callback passes me the processed exchange, there > > would be super nice. I probably care more about out message (if any) > > than whether it has been done synchronously or not. > > > > Since the caller of the asyc process call passes in the exchange, he > can pass that same exchange to the call back via either injection or > via final local reference. Something like: > > final Exchange exch = ... > processor.process(exch, new AsyncCallback() { > public void done(boolean sync) { > System.out.println( exch.getOut() ); > } > }); > Actually, this technique does not work for any component producer that makes a copy of the exchange. For example, the seda producer makes a copy of an exchange and endqueue the copy. public boolean process(Exchange exchange, AsyncCallback callback) { queue.add(exchange.copy()); callback.done(true); return true; } Then, the seda consumer thread could update (in, out, fault) messages in the copied exchange but any update can not be seen in the orginal exchange (as in your example).