synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph Caristi (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SYNAPSE-1108) ProxyServiceMessageReceiver mediates message without default fault sequence
Date Wed, 19 Jun 2019 20:16:00 GMT

     [ https://issues.apache.org/jira/browse/SYNAPSE-1108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Joseph Caristi updated SYNAPSE-1108:
------------------------------------
    Description: 
With Synapse deployed as a war, we have defined the "main" and "fault" sequences in synapse.xml. 
The main sequence uses the xquery mediator to format a response.  If we introduce an error
in the xquery definition, the xquery mediator fails, but the default "fault" sequence is not
called.  This is because when the following code from ProxyServiceMessageReceiver executes,
the Synapse MessageContext fault stack is empty:
{code:java}
} else if (proxy.getTargetInLineInSequence() != null) {
 traceOrDebug(traceOn, "Using the anonymous " +
 "in-sequence of the proxy service for mediation");
 inSequenceResult = proxy.getTargetInLineInSequence().mediate(synCtx);
}{code}
 If we change the code to the following, it works:
  
{code:java}
} else if (proxy.getTargetInLineInSequence() != null) {
    traceOrDebug(traceOn, "Using the anonymous " +
        "in-sequence of the proxy service for mediation");     
    
    if (synCtx.getFaultStack().isEmpty()) {
        // set default fault handler
        synCtx.pushFaultHandler(new MediatorFaultHandler(synCtx.getFaultSequence()));
    }     

    inSequenceResult = proxy.getTargetInLineInSequence().mediate(synCtx);
}{code}
 

  was:
With Synapse deployed as a war, we have defined the "main" and "fault" sequences in synapse.xml. 
The main sequence uses the xquery mediator to format a response.  If we introduce an error
in the xquery definition, the xquery mediator fails, but the default "fault" sequence is not
called.  This is because when the following code from ProxyServiceMessageReceiver executes,
the Synapse MessageContext fault stack is empty:
{code:java}
} else if (proxy.getTargetInLineInSequence() != null) {
 traceOrDebug(traceOn, "Using the anonymous " +
 "in-sequence of the proxy service for mediation");
 inSequenceResult = proxy.getTargetInLineInSequence().mediate(synCtx);
}{code}
 If we change the code to the following, it works:
 
{code:java}
} else if (proxy.getTargetInLineInSequence() != null) {
    traceOrDebug(traceOn, "Using the anonymous " +
        "in-sequence of the proxy service for mediation");     
    
    if (synCtx.getFaultStack().isEmpty()) {
        // set default fault handler
        synCtx.pushFaultHandler(new MediatorFaultHandler(synCtx.getFaultSequence()));
    }     inSequenceResult = proxy.getTargetInLineInSequence().mediate(synCtx);
}{code}
 


> ProxyServiceMessageReceiver mediates message without default fault sequence
> ---------------------------------------------------------------------------
>
>                 Key: SYNAPSE-1108
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-1108
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 3.0.1
>         Environment: WebLogic 12.2.1.3 war file
>            Reporter: Joseph Caristi
>            Assignee: Isuru Udana Loku Narangoda
>            Priority: Major
>             Fix For: FUTURE
>
>
> With Synapse deployed as a war, we have defined the "main" and "fault" sequences in synapse.xml. 
The main sequence uses the xquery mediator to format a response.  If we introduce an error
in the xquery definition, the xquery mediator fails, but the default "fault" sequence is not
called.  This is because when the following code from ProxyServiceMessageReceiver executes,
the Synapse MessageContext fault stack is empty:
> {code:java}
> } else if (proxy.getTargetInLineInSequence() != null) {
>  traceOrDebug(traceOn, "Using the anonymous " +
>  "in-sequence of the proxy service for mediation");
>  inSequenceResult = proxy.getTargetInLineInSequence().mediate(synCtx);
> }{code}
>  If we change the code to the following, it works:
>   
> {code:java}
> } else if (proxy.getTargetInLineInSequence() != null) {
>     traceOrDebug(traceOn, "Using the anonymous " +
>         "in-sequence of the proxy service for mediation");     
>     
>     if (synCtx.getFaultStack().isEmpty()) {
>         // set default fault handler
>         synCtx.pushFaultHandler(new MediatorFaultHandler(synCtx.getFaultSequence()));
>     }     
>     inSequenceResult = proxy.getTargetInLineInSequence().mediate(synCtx);
> }{code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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


Mime
View raw message