You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "John Yin (Jira)" <ji...@apache.org> on 2024/07/17 20:36:00 UTC

[jira] [Comment Edited] (CXF-8629) AsyncHTTPConduit (hc5) should support chunked request / response

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

John Yin edited comment on CXF-8629 at 7/17/24 8:35 PM:
--------------------------------------------------------

I run into a similar problem but not sure whether it is caused by the same thing.  Here is the information about mine and please let me know if it is not related to this issue.  I am using CXF 4.0.4 - HTTP Client 5.  In the conduit, AllowChunking="false".

In the simple app, it uses Camel to call CXF:
{quote}from("direct:foo")
.to("cxfrs:bean:rsClientForCustomer?headerFilterStrategy=#ebaFilterStrategy")
.log("in foo after calling CXF")
{quote}
This generated the following log.  The entries for ID: 1 were recorded by my test client.  The entries for ID: 2 were recorded by my test server.  As you can see, the server responded once, but the client processed the response twice, once with payload, once without the payload.  It is also interesting to note that the two client log entries of the response contain *Transfer-Encoding=[chunked],* even though the chunking is not allowed in conduit.
{quote}2024-07-17 15:11:14.358 [Camel (camel-1) thread #31 - timer://testRoute] LoggingOutInterceptor - Outbound Message
---------------------------
*ID: 1     (client sent request)*
Address: [http://localhost:9105/customer/listener]
Http-Method: POST
Content-Type: application/json
Headers: {Accept=[*/*], Content-Type=[application/json], Content-Language=[en_US], Connection=[Keep-Alive]}
Payload: 
{     "test": "test"}
                        
--------------------------------------
2024-07-17 15:11:14.601 [qtp89784984-111] LoggingInInterceptor - Inbound Message
----------------------------
*ID: 2     (server received request)*
Address: [http://localhost:9105/customer/listener]
Encoding: UTF-8
Http-Method: POST
Content-Type: application/json
Headers: {Accept=[*/*], connection=[keep-alive], Content-Language=[en_US], Content-Length=[48], content-type=[application/json], Host=[localhost:9105], User-Agent=[Apache CXF 4.0.4]}
Payload: 
{     "test": "test"}
                                                
2024-07-17 15:11:14.649 [qtp89784984-111] LoggingOutInterceptor - Outbound Message
---------------------------
*ID: 2      (server sent response)*
Response-Code: 200
Content-Type: application/json
Headers: {Accept=[*/*], User-Agent=[Apache CXF 4.0.4], connection=[keep-alive], Host=[localhost:9105], Content-Language=[en_US], eb_received_route_for=[customer], Content-Type=[application/json], Date=[Wed, 17 Jul 2024 19:11:14 GMT]}
Payload: \{"result":"Ok"}
--------------------------------------
2024-07-17 15:11:14.667 [default-workqueue-1] LoggingInInterceptor - Inbound Message
----------------------------
*ID: 1      (client processed response with payload)*
Response-Code: 200
Encoding: ISO-8859-1
Content-Type: application/json
Headers: {Accept=[*/*], Connection=[keep-alive], Content-Language=[en_US], Content-Type=[application/json], Date=[Wed, 17 Jul 2024 19:11:14 GMT], eb_received_route_for=[customer], Host=[localhost:9105], Server=[Jetty(11.0.20)], Transfer-Encoding=[chunked], User-Agent=[Apache CXF 4.0.4]}
Payload: \{"result":"Ok"}
--------------------------------------
2024-07-17 15:11:14.667 [default-workqueue-2] LoggingInInterceptor - Inbound Message
----------------------------
*ID: 1      (client processed response again, without payload)*
Response-Code: 200
Encoding: ISO-8859-1
Content-Type: application/json
Headers: {Accept=[*/*], Connection=[keep-alive], Content-Language=[en_US], Content-Type=[application/json], Date=[Wed, 17 Jul 2024 19:11:14 GMT], eb_received_route_for=[customer], Host=[localhost:9105], Server=[Jetty(11.0.20)], Transfer-Encoding=[chunked], User-Agent=[Apache CXF 4.0.4]}
--------------------------------------
2024-07-17 15:11:14.669 [default-workqueue-2] route19 - in foo after calling CXF
2024-07-17 15:11:14.669 [default-workqueue-1] route19 - in foo after calling CXF
{quote}


was (Author: bocamel):
I run into a similar problem but not sure whether it is caused by the same thing.  Here is the information about mine and please let me know if it is not related to this issue.  I am using CXF 4.0.4 - HTTP Client 5.  In the conduit, AllowChunking="false".

In the simple app, it uses Camel to call CXF:
{quote}from("direct:foo")
.to("cxfrs:bean:rsClientForCustomer?headerFilterStrategy=#ebaFilterStrategy")
.log("in foo after calling CXF"){quote}
This generated the following log.  The entries for ID: 1 were recorded by my test client.  The entries for ID: 2 were recorded by my test server.  As you can see, the server responded once, but the client processed the response twice, once with payload, once without the payload.  It is also interesting to note that the two client log entries of the response contain *Transfer-Encoding=[chunked],* even though the chunking is not allowed in conduit.
{quote}2024-07-17 15:11:14.358 [Camel (camel-1) thread #31 - timer://testRoute] LoggingOutInterceptor - Outbound Message
---------------------------
*ID: 1     (client sent request)*
Address: http://localhost:9105/customer/listener
Http-Method: POST
Content-Type: application/json
Headers: \{Accept=[*/*], Content-Type=[application/json], Content-Language=[en_US], Connection=[Keep-Alive]}
Payload: 
{
    "test": "test"
}
                        
--------------------------------------
2024-07-17 15:11:14.601 [qtp89784984-111] LoggingInInterceptor - Inbound Message
----------------------------
*ID: 2     (server received request)*
Address: http://localhost:9105/customer/listener
Encoding: UTF-8
Http-Method: POST
Content-Type: application/json
Headers: \{Accept=[*/*], connection=[keep-alive], Content-Language=[en_US], Content-Length=[48], content-type=[application/json], Host=[localhost:9105], User-Agent=[Apache CXF 4.0.4]}
Payload: 
{
    "test": "test"
}
                                                
2024-07-17 15:11:14.649 [qtp89784984-111] LoggingOutInterceptor - Outbound Message
---------------------------
*ID: 2      (server sent response)*
Response-Code: 200
Content-Type: application/json
Headers: \{Accept=[*/*], User-Agent=[Apache CXF 4.0.4], connection=[keep-alive], Host=[localhost:9105], Content-Language=[en_US], eb_received_route_for=[customer], Content-Type=[application/json], Date=[Wed, 17 Jul 2024 19:11:14 GMT]}
Payload: \{"result":"Ok"}
--------------------------------------
2024-07-17 15:11:14.667 [default-workqueue-1] LoggingInInterceptor - Inbound Message
----------------------------
*ID: 1      (client processed response with payload)*
Response-Code: 200
Encoding: ISO-8859-1
Content-Type: application/json
Headers: \{Accept=[*/*], Connection=[keep-alive], Content-Language=[en_US], Content-Type=[application/json], Date=[Wed, 17 Jul 2024 19:11:14 GMT], eb_received_route_for=[customer], Host=[localhost:9105], Server=[Jetty(11.0.20)], Transfer-Encoding=[chunked], User-Agent=[Apache CXF 4.0.4]}
Payload: \{"result":"Ok"}
--------------------------------------
2024-07-17 15:11:14.667 [default-workqueue-2] LoggingInInterceptor - Inbound Message
----------------------------
*ID: 1      (client processed response again, without payload)*
Response-Code: 200
Encoding: ISO-8859-1
Content-Type: application/json
Headers: \{Accept=[*/*], Connection=[keep-alive], Content-Language=[en_US], Content-Type=[application/json], Date=[Wed, 17 Jul 2024 19:11:14 GMT], eb_received_route_for=[customer], Host=[localhost:9105], Server=[Jetty(11.0.20)], Transfer-Encoding=[chunked], User-Agent=[Apache CXF 4.0.4]}
--------------------------------------
2024-07-17 15:11:14.669 [default-workqueue-2] route19 - in foo after calling CXF
2024-07-17 15:11:14.669 [default-workqueue-1] route19 - in foo after calling CXF
{quote}

> AsyncHTTPConduit (hc5) should support chunked request / response
> ----------------------------------------------------------------
>
>                 Key: CXF-8629
>                 URL: https://issues.apache.org/jira/browse/CXF-8629
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 3.5.0, 3.4.5
>            Reporter: Andriy Redko
>            Assignee: Andriy Redko
>            Priority: Major
>             Fix For: 3.5.10, 3.6.5, 4.0.6
>
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)