You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Supun Kamburugamuva <su...@gmail.com> on 2010/12/01 07:44:57 UTC

Synapse Error handling in the SynapseCallbackReceiver class

The way errors are handled in the SynapseCallbackReceiver is pretty strange
to me. When an error happens at the transport sender this callback receiver
is invoked. But when it is invoked, it uses the incoming message context to
invoke the synapse configuration and send back the message. But there is a
message context originated from the transport itself. Synapse callback
doesn't use this message context for invoking the language.

This makes the life hard at the handling of faults in Synapse configuration.
To send the fault back to the user, user has to do things like removing the
To address and setting the RESPONSE to true.

I would like to re-factor this code to use the original message context
coming from the transport. WDYT?

Thanks,
Supun..

Re: Synapse Error handling in the SynapseCallbackReceiver class

Posted by Ruwan Linton <ru...@gmail.com>.
I am sorry Supun, I do not quite get what you try to say, (I know it might
be hard to explain) may be a patch would explain it, if it is not much work.

Thanks,
Ruwan

On Wed, Dec 1, 2010 at 12:14 PM, Supun Kamburugamuva <su...@gmail.com>wrote:

> The way errors are handled in the SynapseCallbackReceiver is pretty strange
> to me. When an error happens at the transport sender this callback receiver
> is invoked. But when it is invoked, it uses the incoming message context to
> invoke the synapse configuration and send back the message. But there is a
> message context originated from the transport itself. Synapse callback
> doesn't use this message context for invoking the language.
>
> This makes the life hard at the handling of faults in Synapse
> configuration. To send the fault back to the user, user has to do things
> like removing the To address and setting the RESPONSE to true.
>
> I would like to re-factor this code to use the original message context
> coming from the transport. WDYT?
>
> Thanks,
> Supun..
>
>


-- 
Ruwan Linton
Software Architect & Product Manager, WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org

Lean . Enterprise . Middleware

phone: +1 408 754 7388 ext 51789
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton

Re: Synapse Error handling in the SynapseCallbackReceiver class

Posted by Supun Kamburugamuva <su...@gmail.com>.
Sorry for the late reply.

Here I'm attaching a diff.

Thanks,
Supun..

On Fri, Dec 3, 2010 at 12:06 PM, Supun Kamburugamuva <su...@gmail.com> wrote:
>
>
> On Thu, Dec 2, 2010 at 12:16 AM, Hiranya Jayathilaka <hi...@gmail.com>
> wrote:
>>
>> Hi Supun,
>>
>> On Wed, Dec 1, 2010 at 12:14 PM, Supun Kamburugamuva <su...@gmail.com>
>> wrote:
>> > The way errors are handled in the SynapseCallbackReceiver is pretty
>> > strange
>> > to me. When an error happens at the transport sender this callback
>> > receiver
>> > is invoked. But when it is invoked, it uses the incoming message context
>> > to
>> > invoke the synapse configuration and send back the message. But there is
>> > a
>> > message context originated from the transport itself. Synapse callback
>> > doesn't use this message context for invoking the language.
>>
>> Does the transport always have a response message context in case of a
>> fault? What about in a situation like a connection failure?
>
> In all the failure cases including connection failures it creates a Fault
> Message context.
>
> I'm working on a patch and once I'm done I'll submit it for review.
>
> Thanks,
> Supun..
>>
>> Thanks,
>> Hiranya
>>
>> > This makes the life hard at the handling of faults in Synapse
>> > configuration.
>> > To send the fault back to the user, user has to do things like removing
>> > the
>> > To address and setting the RESPONSE to true.
>> > I would like to re-factor this code to use the original message context
>> > coming from the transport. WDYT?
>> > Thanks,
>> > Supun..
>> >
>> >
>>
>>
>>
>> --
>> Hiranya Jayathilaka
>> Senior Software Engineer;
>> WSO2 Inc.;  http://wso2.org
>> E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
>> Blog: http://techfeast-hiranya.blogspot.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>
>
>
> --
> Technical Lead, WSO2 Inc
> http://wso2.org
> supunk.blogspot.com
>
>
>



-- 
Technical Lead, WSO2 Inc
http://wso2.org
supunk.blogspot.com

Re: Synapse Error handling in the SynapseCallbackReceiver class

Posted by Supun Kamburugamuva <su...@gmail.com>.
On Thu, Dec 2, 2010 at 12:16 AM, Hiranya Jayathilaka
<hi...@gmail.com>wrote:

> Hi Supun,
>
> On Wed, Dec 1, 2010 at 12:14 PM, Supun Kamburugamuva <su...@gmail.com>
> wrote:
> > The way errors are handled in the SynapseCallbackReceiver is pretty
> strange
> > to me. When an error happens at the transport sender this callback
> receiver
> > is invoked. But when it is invoked, it uses the incoming message context
> to
> > invoke the synapse configuration and send back the message. But there is
> a
> > message context originated from the transport itself. Synapse callback
> > doesn't use this message context for invoking the language.
>
> Does the transport always have a response message context in case of a
> fault? What about in a situation like a connection failure?
>

In all the failure cases including connection failures it creates a Fault
Message context.

I'm working on a patch and once I'm done I'll submit it for review.

Thanks,
Supun..

>
> Thanks,
> Hiranya
>
> > This makes the life hard at the handling of faults in Synapse
> configuration.
> > To send the fault back to the user, user has to do things like removing
> the
> > To address and setting the RESPONSE to true.
> > I would like to re-factor this code to use the original message context
> > coming from the transport. WDYT?
> > Thanks,
> > Supun..
> >
> >
>
>
>
> --
> Hiranya Jayathilaka
> Senior Software Engineer;
> WSO2 Inc.;  http://wso2.org
> E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>


-- 
Technical Lead, WSO2 Inc
http://wso2.org
supunk.blogspot.com

Re: Synapse Error handling in the SynapseCallbackReceiver class

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
Hi Supun,

On Wed, Dec 1, 2010 at 12:14 PM, Supun Kamburugamuva <su...@gmail.com> wrote:
> The way errors are handled in the SynapseCallbackReceiver is pretty strange
> to me. When an error happens at the transport sender this callback receiver
> is invoked. But when it is invoked, it uses the incoming message context to
> invoke the synapse configuration and send back the message. But there is a
> message context originated from the transport itself. Synapse callback
> doesn't use this message context for invoking the language.

Does the transport always have a response message context in case of a
fault? What about in a situation like a connection failure?

Thanks,
Hiranya

> This makes the life hard at the handling of faults in Synapse configuration.
> To send the fault back to the user, user has to do things like removing the
> To address and setting the RESPONSE to true.
> I would like to re-factor this code to use the original message context
> coming from the transport. WDYT?
> Thanks,
> Supun..
>
>



-- 
Hiranya Jayathilaka
Senior Software Engineer;
WSO2 Inc.;  http://wso2.org
E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

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