Hi Nuwan,

In call mediator if OUT_ONLY is true it will clone the message and will
send that new message context to the backend. If there are other mediators
after call mediator mediation will continue with the original message
context. This is happening as call mediator is a non blocking sender (It
will not wait).

But if you don't want cloning you will have to use call mediator in
*blocking* mode. Then original message context will be passed and it will
wait till request send out to the backend before starting mediating
subsequent mediators.

Thank You,


On Wed, Mar 9, 2016 at 5:32 PM, Nuwan Wimalasekara <[email protected]> wrote:

> Hi
>
> Call mediator is not submitting the request body to backend service if
> OUT_ONLY is true. When the TargetHandler try to send the message body by
> reading the Buffer_source, It already got cleared.
>
> The problem is that inside the call mediator, messageContext is cloned.
> Then the buffer is not created in Pipe class. so the buffer has zero length
> content.
> Is there any reason to clone the message if OUT_ONLY is true inside the
> call mediator?
>
> if we remove cloning the message and proceed with the incomming message
> context, the issue is resolved.
>
>
> boolean outOnlyMessage =
> "true".equals(synInCtx.getProperty(SynapseConstants.OUT_ONLY));
>
>         // Prepare the outgoing message context
>         MessageContext synOutCtx = null;
>         if (outOnlyMessage) {
>             try {
>                 *synOutCtx = MessageHelper.cloneMessageContext(synInCtx);*
>             } catch (AxisFault axisFault) {
>                 handleException("Error occurred while cloning msg
> context", axisFault, synInCtx);
>             }
>         } else {
>             synOutCtx = synInCtx;
>         }
>
>
> Proxy configuration introduce issue.
>
>       <inSequence>
>          <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
>          <property name="OUT_ONLY" value="true"/>
>          <call>
>             <endpoint>
>                <address uri="
> http://localhost:9000/services/SimpleStockQuoteService"/>
>             </endpoint>
>          </call>
>       </inSequence>
>
> [1] https://wso2.org/jira/browse/ESBJAVA-4469
>
> Thanks,
> Nuwanw
>
> --
> Nuwan Wimalasekara
> Senior Software Engineer - Test Automation
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> phone: +94 71 668 4620
>
>
>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Viraj Senevirathne
Software Engineer; WSO2, Inc.

Mobile : +94 71 958 0269
Email : [email protected]
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to