You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Romain Manni-Bucau (JIRA)" <ji...@apache.org> on 2019/02/06 16:44:00 UTC
[jira] [Updated] (CXF-7964) Ensure CXF JAXRS stack (client/server)
can be used for roundtrips
[ https://issues.apache.org/jira/browse/CXF-7964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Romain Manni-Bucau updated CXF-7964:
------------------------------------
Description:
Today (3.3.0), if you use a Client to get a response and copy it to return in an endpoint (http proxy pattern) like that:
{code}
private Response passthrough(final Response source) {
final Response.ResponseBuilder builder = Response.status(source.getStatus());
source.getStringHeaders().entrySet().stream()
.forEach(e -> builder.header(e.getKey(), String.join(",", e.getValue())));
final InputStream forwardedData = source.readEntity(InputStream.class);
return builder.entity(forwardedData).build();
}
{code}
A client calling that endpoint will freeze cause of the forwarded input stream.
Edit: the server endpoint returns a CompletionStage (tomcat 9.0.14 and cxf 3.3.0), I didn't take time yet to investigate if it is coming from the completion stage or not, I just know in some older 3.2 it was the stream which was not properly closed.
was:
Today (3.3.0), if you use a Client to get a response and copy it to return in an endpoint (http proxy pattern) like that:
{code}
private Response passthrough(final Response source) {
final Response.ResponseBuilder builder = Response.status(source.getStatus());
source.getStringHeaders().entrySet().stream()
.forEach(e -> builder.header(e.getKey(), String.join(",", e.getValue())));
final InputStream forwardedData = source.readEntity(InputStream.class);
return builder.entity(forwardedData).build();
}
{code}
A client calling that endpoint will freeze cause of the forwarded input stream.
> Ensure CXF JAXRS stack (client/server) can be used for roundtrips
> -----------------------------------------------------------------
>
> Key: CXF-7964
> URL: https://issues.apache.org/jira/browse/CXF-7964
> Project: CXF
> Issue Type: Bug
> Reporter: Romain Manni-Bucau
> Priority: Major
>
> Today (3.3.0), if you use a Client to get a response and copy it to return in an endpoint (http proxy pattern) like that:
> {code}
> private Response passthrough(final Response source) {
> final Response.ResponseBuilder builder = Response.status(source.getStatus());
> source.getStringHeaders().entrySet().stream()
> .forEach(e -> builder.header(e.getKey(), String.join(",", e.getValue())));
> final InputStream forwardedData = source.readEntity(InputStream.class);
> return builder.entity(forwardedData).build();
> }
> {code}
> A client calling that endpoint will freeze cause of the forwarded input stream.
> Edit: the server endpoint returns a CompletionStage (tomcat 9.0.14 and cxf 3.3.0), I didn't take time yet to investigate if it is coming from the completion stage or not, I just know in some older 3.2 it was the stream which was not properly closed.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)