Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 73152 invoked from network); 19 Apr 2007 18:42:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Apr 2007 18:42:56 -0000 Received: (qmail 57735 invoked by uid 500); 19 Apr 2007 18:43:02 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 57528 invoked by uid 500); 19 Apr 2007 18:43:01 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 57519 invoked by uid 99); 19 Apr 2007 18:43:01 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Apr 2007 11:43:01 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of james.strachan@gmail.com designates 66.249.82.238 as permitted sender) Received: from [66.249.82.238] (HELO wx-out-0506.google.com) (66.249.82.238) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Apr 2007 11:42:54 -0700 Received: by wx-out-0506.google.com with SMTP id h29so705140wxd for ; Thu, 19 Apr 2007 11:42:34 -0700 (PDT) DKIM-Signature: a=rsa-sha1; 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; b=REpTpM5CnyZ8dVlC3iLHLoCTm6UKkVQOPPhLm0k2R/1EXoPzZ9A5eipVzvzrPoY+8+0hEcqRzE6eF9E7t7e+49CpcDjK5MTEwkZ/gVYuWmNzo/G0bgtskQZ497RAx32/uVTWeNgxWaP8gxVCbhvKk1IGaLIAHJUpdh3PRJ9DWjw= 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=W8FGfXbm/tqwDcI1kKdWGBv3a9YtM89BN5Q4lN6oE3kXpJyNskj+P9rJYjpxa2jc6SO5owML2xvc1qCUNBCSM+L17dpHSXLcTA+NmnyYcM8FJxOJWI4deRsbhWjSAlts9cGuI0D8X57PZgIgMUCowme5qPikV5lWuckZGP0mk1s= Received: by 10.90.29.18 with SMTP id c18mr2310251agc.1177008154009; Thu, 19 Apr 2007 11:42:34 -0700 (PDT) Received: by 10.90.105.4 with HTTP; Thu, 19 Apr 2007 11:42:33 -0700 (PDT) Message-ID: Date: Thu, 19 Apr 2007 19:42:33 +0100 From: "James Strachan" To: users@activemq.apache.org Subject: Re: [camel] How to user InterceptorProcessors In-Reply-To: <10078648.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <10078648.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org On 4/19/07, dr.jeff wrote: > > What is the intended usage of interceptors? e.g. using security or transaction interceptors. See the camel-jpa module for some examples (such as the Jpa based IdempotentConsumer test case which uses a default transaction interceptor. We could also use interceptors to do transformations too > Do I get the get the message from exchange.getIn() and, say, modify its > body? Sure if you like > Or should I somehow be putting the modifications into the exchange.getOut() > message? You can do either really. getOut() is only intended for request-response (InOut) exchange patterns and the out is usually written by the actual service. so you could modify the IN before the service is invoked, then modify the generated OUT after the service has been invoked if you like. e.g. class MyInterceptor extends ProcessorDelegate { ... void process(Exchange exchange) { // modify IN processNext(exchange); // modify OUT } -- James ------- http://macstrac.blogspot.com/