Hi

No headerName is a string attribute and cannot be dynamic. You can use
a property placeholder though but its only resolved once during route
creation.

Currently its only the constants from Exchange that are supported such
as Exchange.FILE_NAME.



On Thu, Jul 9, 2015 at 8:02 PM, MC <2320...@gmail.com> wrote:
> Hi Claus,
>
> I replied to this question a couple of days ago with a similar question, but
> I am not sure why it is not showing up. Thats why I posting it again. I
> apologize if it is duplicate.
>
> Is it possible to use a random Java Constant or enum in headerName of
> <setHeader> in spring dsl. I tied with simple and spel expressions with no
> success. Below are the things I tried with.
>
> <setHeader
> headerName="#{T(org.apache.camel.component.cxf.common.message.CxfConstants).OPERATION_NAME}">
>
> <simple>${enum:org.apache.camel.component.cxf.common.message.CxfConstants.DISPATCH_DEFAULT_OPERATION_NAMESPACE}</simple>
> </setHeader>
> <setHeader
> headerName="$simple{type:org.apache.camel.component.cxf.common.message.CxfConstants.OPERATION_NAME}">
>
> <simple>${enum:org.apache.camel.component.cxf.common.message.CxfConstants.DISPATCH_DEFAULT_OPERATION_NAMESPACE}</simple>
> </setHeader>
> <setHeader
> headerName="${type:org.apache.camel.component.cxf.common.message.CxfConstants.OPERATION_NAME}">
>
> <simple>${enum:org.apache.camel.component.cxf.common.message.CxfConstants.DISPATCH_DEFAULT_OPERATION_NAMESPACE}</simple>
> </setHeader>
>
> Value is resolved, but expressions in headerName are not.
>
> Thanks in advance.
> MC
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Problem-from-Java-DSL-to-Spring-DSL-tp5732558p5769067.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to