You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "maggie (Jira)" <ji...@apache.org> on 2025/12/03 13:03:00 UTC

[jira] [Updated] (CXF-9186) CXF 4.1.4 returns HTTP 200 instead of the status set in the JAX‑RS Response object (e.g., 202) when used in a Camel exchange body is set in Camel exchange body

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

maggie updated CXF-9186:
------------------------
    Summary: CXF 4.1.4 returns HTTP 200 instead of the status set in the JAX‑RS Response object (e.g., 202) when used in a Camel exchange body is set in Camel exchange body  (was: CXF 4.1.4 returns HTTP 200 instead of the status set in the JAX‑RS Response object (e.g., 202) when used in a Camel exchange bodyis set in Camel exchange body)

> CXF 4.1.4 returns HTTP 200 instead of the status set in the JAX‑RS Response object (e.g., 202) when used in a Camel exchange body is set in Camel exchange body
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-9186
>                 URL: https://issues.apache.org/jira/browse/CXF-9186
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 4.1.4
>         Environment: * Apache CXF 4.1.3 (works as expected)
>  * Apache CXF 4.1.4 (regression observed)
>  * Camel integration with CXF JAX‑RS
>  * Java version: [21]
>  * OS: [windows 11 pro]
>            Reporter: maggie
>            Priority: Major
>
> When a JAX‑RS {{Response}} object with status 202 is placed into {{{}exchange.in.body{}}}, CXF 4.1.3 correctly propagates the HTTP 202 status to the client. In CXF 4.1.4, the same code path results in HTTP 200 being returned instead. This appears to be a regression in how CXF handles the {{Response}} object inside Camel exchanges.
> *Steps to Reproduce:*
>  # Create a Camel route that builds a JAX‑RS {{Response}} object:
> Response resp = Response.status(202).entity("Accepted").build()
> exchange.in.body = resp
>  # Send a request to the route.
>  # Observe the HTTP status code in the client response.
> *Expected Behavior:*
>  * HTTP 202 should be returned to the client, consistent with the {{{}Response.status(202){}}}.
> *Actual Behavior:*
>  * CXF 4.1.4 returns HTTP 200 instead of 202.
>  * CXF 4.1.3 correctly returns HTTP 202.
> *Impact:*
>  * Breaks applications relying on HTTP 202 for async acknowledgment or protocol compliance.
>  * Requires workaround (explicitly setting {{Exchange.HTTP_RESPONSE_CODE}} header) to restore expected behavior.
> *Workaround:*
> {{exchange.in.setHeader(Exchange.HTTP_RESPONSE_CODE, 202)}}
>  



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