What is the difference between setting the header Content-Type through Exchange.CONTENT_TYPE and usually Content-Type?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

What is the difference between setting the header Content-Type through Exchange.CONTENT_TYPE and usually Content-Type?

Mikhail Lukyanov
Hello everyone!

I can set header Content-Type so




*<setHeader headerName="Exchange.CONTENT_TYPE">
<constant>application/json</constant></setHeader>*
and so



*<setHeader headerName="Content-Type">
<constant>application/json</constant></setHeader>*

What is the difference between these two approaches? What approach can be a
problem?

--
*With best regards, Lukyanov Mikhail*
*Tel: **+7-909-69-71-547*
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between setting the header Content-Type through Exchange.CONTENT_TYPE and usually Content-Type?

Claus Ibsen-2
Hi

They are the same. The Exchange.XXX is a constant for the header
names, for example to use type safe names in Java code.
Camel will replace the Exchange.XXX with the value, eg Content-Type in
this case.

On Tue, May 19, 2020 at 4:15 PM Mikhail Lukyanov <[hidden email]> wrote:

>
> Hello everyone!
>
> I can set header Content-Type so
>
>
>
>
> *<setHeader headerName="Exchange.CONTENT_TYPE">
> <constant>application/json</constant></setHeader>*
> and so
>
>
>
> *<setHeader headerName="Content-Type">
> <constant>application/json</constant></setHeader>*
>
> What is the difference between these two approaches? What approach can be a
> problem?
>
> --
> *With best regards, Lukyanov Mikhail*
> *Tel: **+7-909-69-71-547*



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: What is the difference between setting the header Content-Type through Exchange.CONTENT_TYPE and usually Content-Type?

Mikhail Lukyanov
Thanks for the information, I thought the replacement works only for the
http component, but checked with activemq, a message with the correct
header also arrived in the queue.

вт, 19 мая 2020 г., 17:45 Claus Ibsen <[hidden email]>:

> Hi
>
> They are the same. The Exchange.XXX is a constant for the header
> names, for example to use type safe names in Java code.
> Camel will replace the Exchange.XXX with the value, eg Content-Type in
> this case.
>
> On Tue, May 19, 2020 at 4:15 PM Mikhail Lukyanov <[hidden email]>
> wrote:
> >
> > Hello everyone!
> >
> > I can set header Content-Type so
> >
> >
> >
> >
> > *<setHeader headerName="Exchange.CONTENT_TYPE">
> > <constant>application/json</constant></setHeader>*
> > and so
> >
> >
> >
> > *<setHeader headerName="Content-Type">
> > <constant>application/json</constant></setHeader>*
> >
> > What is the difference between these two approaches? What approach can
> be a
> > problem?
> >
> > --
> > *With best regards, Lukyanov Mikhail*
> > *Tel: **+7-909-69-71-547*
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>