camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raúl Kripalani (JIRA) <>
Subject [jira] [Commented] (CAMEL-7246) [cxfrs] SimpleConsumer returns wrong Content-Type
Date Fri, 13 Jun 2014 11:29:03 GMT


Raúl Kripalani commented on CAMEL-7246:

Hi [~ay],

The issue lies here:

The Simple Binding propagates the message headers from Camel into the JAX-RS Response headers.
However, since headers are not contextualised (as I explained above) and they are just "mished-mashed",
the Content-Type from the original requests ends up being propagated back in the response.

The CXF stack then uses this Content-Type to pick the MessageBodyWriter and ends up serialising
the response in the same wireformat as the request, even if the client demanded a different
one with "Accept".

In my opinion there is no black or white solution, nor easy solution. We want to allow users
to set headers in their routes that are sent back to the client, yet this facility is colliding
with Camel's way of dumping all headers in the same place.

For an easy solution out, we could add a parameter to SimpleConsumer: headerPropagationPolicy,
with the following values:
* none => never propagate any headers.
* propagate => apply header filter strategy (today's behaviour).

This parameter allows some level of tuning, and, most importantly, makes the user aware upfront
that if they want to propagate at least 1 header, they will have to configure a header filter

[~amarkevich], for now you can solve this issue simply by removing the Content-Type header
before the end of the route.


> [cxfrs] SimpleConsumer returns wrong Content-Type
> -------------------------------------------------
>                 Key: CAMEL-7246
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.12.2
>            Reporter: Alexey Markevich
>         Attachments:
> Looks like Content-Type is taken from request

This message was sent by Atlassian JIRA

View raw message