Return-Path: Delivered-To: apmail-synapse-dev-archive@www.apache.org Received: (qmail 91408 invoked from network); 28 Apr 2010 16:57:55 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Apr 2010 16:57:55 -0000 Received: (qmail 48563 invoked by uid 500); 28 Apr 2010 16:57:54 -0000 Delivered-To: apmail-synapse-dev-archive@synapse.apache.org Received: (qmail 48523 invoked by uid 500); 28 Apr 2010 16:57:54 -0000 Mailing-List: contact dev-help@synapse.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@synapse.apache.org Delivered-To: mailing list dev@synapse.apache.org Received: (qmail 48516 invoked by uid 99); 28 Apr 2010 16:57:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Apr 2010 16:57:54 +0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=AWL,FREEMAIL_FROM,HTML_MESSAGE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ruwan.linton@gmail.com designates 74.125.83.170 as permitted sender) Received: from [74.125.83.170] (HELO mail-pv0-f170.google.com) (74.125.83.170) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Apr 2010 16:57:49 +0000 Received: by pvc22 with SMTP id 22so270363pvc.15 for ; Wed, 28 Apr 2010 09:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=wUDec0+VKNb46/3OVvjq62UHthyn5Yndg4CtYY2Q07Y=; b=OWDNtkbrsQDPMTtL56CB0l0PmAGhuMciDTE9iTLeuoK3YTUNpaCbWPdpUrhpoNF5qo FD2gx0rk1q/iXF2z7O04R6x+QY+pkMKOgkkaxfqAbyJ03/2wQpTgWzvMjyKpFk7KHa/q 5fhlOt1UkpiQSFxF9EqkodVG92htGjwWFHBk0= 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; b=RtQBdjVael3el7K+84jVyKzKOGMZJmbkH/Dx5C1IYpW0GWZK6qYu7VXsMHnzYCWSeK OQ6B7DQf3zgfDhj8o9GAcbQd6sCnJv9gswuvS82U8lfQrHraHxr7Dxk8bPtmjoPK5EmV nCZXEF7emsILaS4UExeJVXW+ggAEJGmPiNohk= MIME-Version: 1.0 Received: by 10.143.154.28 with SMTP id g28mr4193326wfo.70.1272473849015; Wed, 28 Apr 2010 09:57:29 -0700 (PDT) Received: by 10.229.12.207 with HTTP; Wed, 28 Apr 2010 09:57:28 -0700 (PDT) In-Reply-To: References: Date: Wed, 28 Apr 2010 22:27:28 +0530 Message-ID: Subject: Re: Synapse ignores registered fault handler if an exception thrown in out sequence of a proxy From: Ruwan Linton To: dev@synapse.apache.org Content-Type: multipart/alternative; boundary=001636e0b726c1af2504854ee7fe --001636e0b726c1af2504854ee7fe Content-Type: text/plain; charset=ISO-8859-1 Rajika, This patch has an issue, where it pops the fault handler from the fault stack, ideally you should get the proxy from the synapse configuration and get the fault sequence from that and push into the fault stack of inMsgCtx. Otherwise, if there has been some other fault handler pushed, it will be set as the fault handler which is wrong. Thanks, Ruwan On Wed, Apr 28, 2010 at 7:29 PM, Rajika Kumarasiri wrote: > Assume the following synapse configuration. > > > > > > > > > > > uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/> > > > > > > > It seems that the synapse ignores executing the fault handler > 'myFaultHandler' when an exception is thrown in outSequence of the proxy > definition. > By looking at the code I can see that the registered fault handler only > take effect in inSequence, reason is the registered fault handler only added > only into out message context. But when we define a fault handler for the > proxy it should handle both exceptions occurs in in sequence and out > sequence. > I fixed the problem by sharing the defined fault handler in, in message > context as well ( I have attached the diff). If you agree with the solution > I can provide this as patch. > > > Rajika > -- > http://rajikak.blogspot.com/ > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org > For additional commands, e-mail: dev-help@synapse.apache.org > -- Ruwan Linton Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb WSO2 Inc.; http://wso2.org email: ruwan@wso2.com; cell: +94 77 341 3097 blog: http://ruwansblog.blogspot.com --001636e0b726c1af2504854ee7fe Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Rajika,

This patch has an issue, where it pops the fault handler fro= m the fault stack, ideally you should get the proxy from the synapse config= uration and get the fault sequence from that and push into the fault stack = of inMsgCtx.

Otherwise, if there has been some other fault handler pushed, it will b= e set as the fault handler which is wrong.

Thanks,
Ruwan

<= div class=3D"gmail_quote">On Wed, Apr 28, 2010 at 7:29 PM, Rajika Kumarasir= i <rajika@wso2.com<= /a>> wrote:
Assume the follow= ing synapse configuration.

<proxy name=3D"StockQuoteProxy&q= uot;>
=A0=A0=A0=A0=A0=A0=A0 <target faultSequence=3D"myFaultHandler"= >
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <inSequence>
=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <!-- in sequence goes here -->
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 </inSequence>
=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 <outSequence>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 <!-- out sequence goes here -->
=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 </outSequence>
=A0=A0=A0=A0=A0=A0=A0 </target>
=A0= =A0=A0=A0=A0=A0=A0 <publishWSDL uri=3D"file:repository/conf/sample/= resources/proxy/sample_proxy_1.wsdl"/>
=A0</proxy>

<sequence name=3D"myFaultHandler">=
=A0=A0=A0 <!-- fault sequence -->
</sequence>

It seems that the synapse ignores executing the fault handler = 'myFaultHandler' when an exception is thrown in outSequence of the = proxy definition.
By looking at the code I can see that the registered fault handler only tak= e effect in inSequence, reason is the registered fault handler only added o= nly into out message context. But when we define a fault handler for the pr= oxy it should handle both exceptions occurs in in sequence and out sequence= .
I fixed the problem by sharing the defined fault handler in, in message con= text as well ( I have attached the diff). If you agree with the solution I = can provide this as patch.


Rajika
-- =
http://rajikak.b= logspot.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org



--
Ruwan Linton
Technical Lead & Product Manager; WSO2= ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: ruwan@wso2.com; cell: +94 77 341 3097
bl= og: http://ruwansblog.blogspot.c= om
--001636e0b726c1af2504854ee7fe--