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

Vanjikumaran Sivajothy updated SYNAPSE-1035:
--------------------------------------------
    Attachment: SYNAPSE-1035_NOKEEPALIVE.diff

Apply the patch to dishonor the keep alive connection with client. 

After applying the patch with {{NO_KEEPALIVE}} property {{true}} in the 
response path, I was able to fix this issue.

*CURL Request*
{code}
curl -v -H "Keep-Alive: 60" -H "Connection: keep-alive" --header "Content-Type: 
text/xml;charset=UTF-8" --header "SOAPAction:urn:getQuote" --data @request.xml 
http://localhost:8281/services/StockQuoteProxy
{code}

Keep-alive connection dropped in the response received.

*Request Response*
{code}
*   Trying ::1...
* Connected to localhost (::1) port 8281 (#0)
> POST /services/StockQuoteProxy HTTP/1.1
> Host: localhost:8281
> User-Agent: curl/7.43.0
> Accept: */*
> Keep-Alive: 60
> Connection: keep-alive
> Content-Type: text/xml;charset=UTF-8
> SOAPAction:urn:getQuote
> Content-Length: 470
> 
* upload completely sent off: 470 out of 470 bytes
< HTTP/1.1 200 OK
< Content-Type: text/xml; charset=UTF-8
< Connection: Close
< Date: Wed, 01 Jun 2016 22:40:38 GMT
< Server: Synapse-PT-HttpComponents-NIO
< Transfer-Encoding: chunked
< 
* Closing connection 0
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";><soapenv:Header 
xmlns:wsa="http://www.w3.org/2005/08/addressing";><wsa:Action>urn:getQuoteResponse</wsa:Action><wsa:RelatesTo>urn:uuid:aff28543-56ba-4aef-982a-f74a685d777d</wsa:RelatesTo></soapenv:Header><soapenv:Body><ns:getQuoteResponse
 xmlns:ns="http://services.samples";><ns:return 
xmlns:ax21="http://services.samples/xsd"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="ax21:GetQuoteResponse"><ax21:change>4.262384447155837</ax21:change><ax21:earnings>12.526936694930999</ax21:earnings><ax21:high>101.50860399829375</ax21:high><ax21:last>98.86122008058626</ax21:last><ax21:lastTradeTimestamp>Wed
 Jun 01 15:40:38 PDT 
2016</ax21:lastTradeTimestamp><ax21:low>-96.65751997363499</ax21:low><ax21:marketCap>3.660620570128851E7</ax21:marketCap><ax21:name>IBM
 
Company</ax21:name><ax21:open>-98.68198837067341</ax21:open><ax21:peRatio>-19.624848380279087</ax21:peRatio><ax21:percentageChange>3.800504834150182</ax21:percentageChange><ax21:prevClose>112.1531121038275</ax21:prevClose><ax21:symbol>IBM</ax21:symbol><ax21:volume>15924</ax21:volume></ns:return></ns:getQuoteResponse></soapenv:Body></soapenv:Envelope>
{code}

> NO_KEEPALIVE is not working in the response path 
> -------------------------------------------------
>
>                 Key: SYNAPSE-1035
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-1035
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>            Reporter: Vanjikumaran Sivajothy
>            Assignee: Hiranya Jayathilaka
>         Attachments: SYNAPSE-1035_NOKEEPALIVE.diff
>
>
> *Synapse config*
> I have created a simple proxy and NO_KEEPALIVE to dishonor the keep-alive 
> connection in response path.
> {code}
> <definitions xmlns="http://ws.apache.org/ns/synapse";>
>     <proxy name="StockQuoteProxy">
>         <target>
>             <endpoint>
>                 <address 
> uri="http://localhost:9000/services/SimpleStockQuoteService"/>
>             </endpoint>
>             <outSequence>
>                 <property name="NO_KEEPALIVE" value="true" scope="axis2"/>
>                 <send/>
>             </outSequence>
>         </target>
>         <publishWSDL 
> uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
>     </proxy>
> </definitions>
> {code}
> Invoke the proxy service with keep-alive connection via curl as mentioned 
> below
> *CURL Command*
> {code}
> curl -v -H "Keep-Alive: 60" -H "Connection: keep-alive" --header 
> "Content-Type: text/xml;charset=UTF-8" --header "SOAPAction:urn:getQuote" 
> --data '<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";><soapenv:Header 
> xmlns:wsa="http://www.w3.org/2005/08/addressing";><wsa:MessageID>urn:uuid:aff28543-56ba-4aef-982a-f74a685d777d</wsa:MessageID><wsa:Action>urn:getQuote</wsa:Action></soapenv:Header><soapenv:Body><m0:getQuote
>  
> xmlns:m0="http://services.samples";><m0:request><m0:symbol>IBM</m0:symbol></m0:request></m0:getQuote></soapenv:Body></soapenv:Envelope>
>  ' http://localhost:8281/services/StockQuoteProxy
> {code}
> Since I have mentioned NO_KEEPALIVE in the response path, I expect synapse to 
> behave same as request path with NO_KEEPALIVE property, 
> However it is not honored in the response received 
> *Request and Response*
> {code}
> *   Trying ::1...
> * Connected to localhost (::1) port 8281 (#0)
> > POST /services/StockQuoteProxy HTTP/1.1
> > Host: localhost:8281
> > User-Agent: curl/7.43.0
> > Accept: */*
> > Keep-Alive: 60
> > Connection: keep-alive
> > Content-Type: text/xml;charset=UTF-8
> > SOAPAction:urn:getQuote
> > Content-Length: 470
> > 
> * upload completely sent off: 470 out of 470 bytes
> < HTTP/1.1 200 OK
> < Content-Type: text/xml; charset=UTF-8
> < Date: Wed, 01 Jun 2016 22:23:05 GMT
> < Server: Synapse-PT-HttpComponents-NIO
> < Transfer-Encoding: chunked
> < Connection: keep-alive
> < 
> * Connection #0 to host localhost left intact
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";><soapenv:Header 
> xmlns:wsa="http://www.w3.org/2005/08/addressing";><wsa:Action>urn:getQuoteResponse</wsa:Action><wsa:RelatesTo>urn:uuid:aff28543-56ba-4aef-982a-f74a685d777d</wsa:RelatesTo></soapenv:Header><soapenv:Body><ns:getQuoteResponse
>  xmlns:ns="http://services.samples";><ns:return 
> xmlns:ax21="http://services.samples/xsd"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:type="ax21:GetQuoteResponse"><ax21:change>4.04663880583828</ax21:change><ax21:earnings>13.950904640756914</ax21:earnings><ax21:high>68.15602355709272</ax21:high><ax21:last>65.6361659744428</ax21:last><ax21:lastTradeTimestamp>Wed
>  Jun 01 15:23:05 PDT 
> 2016</ax21:lastTradeTimestamp><ax21:low>-65.21358674919206</ax21:low><ax21:marketCap>5.733522132541257E7</ax21:marketCap><ax21:name>IBM
>  
> Company</ax21:name><ax21:open>67.94986444057913</ax21:open><ax21:peRatio>-18.141038233742336</ax21:peRatio><ax21:percentageChange>-6.479310294897818</ax21:percentageChange><ax21:prevClose>-62.45477715467396</ax21:prevClose><ax21:symbol>IBM</ax21:symbol><ax21:volume>15986</ax21:volume></ns:return></ns:getQuoteResponse></soapenv:Body></soapenv:Envelope>LM-SFA-00871979:axis2Client
>  vsivajothy$ 
> {code}



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

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

Reply via email to