You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Hiranya Jayathilaka (JIRA)" <ji...@apache.org> on 2016/05/30 07:36:12 UTC

[jira] [Comment Edited] (SYNAPSE-1023) DISABLE_CHUNKING property is not honored in the response path of PT

    [ https://issues.apache.org/jira/browse/SYNAPSE-1023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15306337#comment-15306337 ] 

Hiranya Jayathilaka edited comment on SYNAPSE-1023 at 5/30/16 7:35 AM:
-----------------------------------------------------------------------

I'm having issues with this patch. First I had to modify it a bit so that it can be applied to the latest trunk head. Once I got it applied I noticed that it doesn't work in some cases. The test case you have provided (with a proxy service) works fine. But if I try the same with an API, it fails. Try the following configuration.

{code}
<api name="TestAPI" context="/test">
    <resource methods="POST" url-mapping="/content_length_out">
        <inSequence>
            <send>
                <endpoint key="echo"/>
            </send>
        </inSequence>
        <outSequence>
            <property name="DISABLE_CHUNKING" value="true" scope="axis2"/>
            <send/>
        </outSequence>
    </resource>
</api>
{code}

This results in the following error:

{noformat}
2016-05-30 00:28:57,499 [-] [PassThroughMessageProcessor-6] ERROR PassThroughHttpSender Failed to submit the response
org.apache.axis2.AxisFault: A header representing a Message Addressing Property is not valid and the message cannot be processed
	at org.apache.synapse.transport.passthru.SourceResponse.processChunkingOptions(SourceResponse.java:212)
	at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:513)
	at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:310)
	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431)
	at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:154)
	at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:275)
	at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:84)
	at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:68)
	at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
	at org.apache.synapse.rest.Resource.process(Resource.java:298)
	at org.apache.synapse.rest.API.process(API.java:301)
	at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:77)
	at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:51)
	at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:182)
	at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:444)
	at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:221)
	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:169)
	at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:227)
	at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:173)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:695)
2016-05-30 00:28:57,503 [-] [PassThroughMessageProcessor-6] ERROR Axis2Sender Unexpected error sending message back
org.apache.axis2.AxisFault: Failed to submit the response
	at org.apache.synapse.transport.passthru.PassThroughHttpSender.handleException(PassThroughHttpSender.java:641)
	at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:312)
	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431)
	at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:154)
{noformat}


was (Author: hiranya):
I'm having issues with this patch. First I had to modify it a bit so that it can be applied to the latest trunk head. Once I got it applied I noticed that it doesn't work in some cases. The test case you have provided (with a proxy service) works fine. But if I try the same with an API, it fails. Try the following configuration.

{code}
<api name="TestAPI" context="/test">
    <resource methods="POST" url-mapping="/content_length_out">
        <inSequence>
            <send>
                <endpoint key="echo"/>
            </send>
        </inSequence>
        <outSequence>
            <property name="DISABLE_CHUNKING" value="true" scope="axis2"/>
            <send/>
        </outSequence>
    </resource>
</api>
{code}

This results in the following error:

{{noformat}}
2016-05-30 00:28:57,499 [-] [PassThroughMessageProcessor-6] ERROR PassThroughHttpSender Failed to submit the response
org.apache.axis2.AxisFault: A header representing a Message Addressing Property is not valid and the message cannot be processed
	at org.apache.synapse.transport.passthru.SourceResponse.processChunkingOptions(SourceResponse.java:212)
	at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:513)
	at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:310)
	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431)
	at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:154)
	at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:275)
	at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:84)
	at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:68)
	at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
	at org.apache.synapse.rest.Resource.process(Resource.java:298)
	at org.apache.synapse.rest.API.process(API.java:301)
	at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:77)
	at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:51)
	at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:182)
	at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:444)
	at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:221)
	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:169)
	at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:227)
	at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:173)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:695)
2016-05-30 00:28:57,503 [-] [PassThroughMessageProcessor-6] ERROR Axis2Sender Unexpected error sending message back
org.apache.axis2.AxisFault: Failed to submit the response
	at org.apache.synapse.transport.passthru.PassThroughHttpSender.handleException(PassThroughHttpSender.java:641)
	at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:312)
	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431)
	at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:154)
{{noformat}}

> DISABLE_CHUNKING property is not honored in the response path of PT
> -------------------------------------------------------------------
>
>                 Key: SYNAPSE-1023
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-1023
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core, Transports
>            Reporter: Vanjikumaran Sivajothy
>            Assignee: Hiranya Jayathilaka
>            Priority: Blocker
>         Attachments: SYNAPSE-1023-updated.diff, SYNAPSE-1023.diff
>
>
> {code}
> <proxy name="StockQuoteProxy">
>         <target>
>              <inSequence>
>                 <send>
>                  <endpoint>
>                         <address uri="http://localhost:8080/RESTfulExample/rest/hello/data"/>
>                     </endpoint>
>                 </send>
>              </inSequence>
>              <outSequence>
>                 <property name="DISABLE_CHUNKING" value="true" scope="axis2"/>
>                 <send/>
>             </outSequence>
>         </target>
>     </proxy>
> {code}
>  
> I have mentioned the disable chunking in response path and it is not honored, please check the curl request.
> {code}
> curl -v -XPOST -H "Content-type: application/json" -d '{"Hello": "World"}' 'http://localhost:8280/services/StockQuoteProxy'
> *   Trying ::1...
> * Connected to localhost (::1) port 8280 (#0)
> > POST /services/StockQuoteProxy HTTP/1.1
> > Host: localhost:8280
> > User-Agent: curl/7.43.0
> > Accept: */*
> > Content-type: application/json
> > Content-Length: 18
> > 
> * upload completely sent off: 18 out of 18 bytes
> < HTTP/1.1 201 Created
> < Server: Apache-Coyote/1.1
> < Date: Sat, 28 May 2016 22:54:29 GMT
> < Transfer-Encoding: chunked
> < 
> * Connection #0 to host localhost left intact
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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