-
1. Re: Extract camel header as String
davsclaus Jan 4, 2012 9:04 AM (in response to rchallapalli)The DSL is for building a model of the route as a kind of design time coding.
So the header in the DSL will return an Expression which is used as the model to describe what header to get.
Camel then takes the route model and turns that into a runtime route, where messages gets processed using Processor's.
So you need to use the method call expression instead to set the header value, instead of a constant (which is a constant).
.setHeader("foo").method(MyUtil.class, "getMessagePattern"))
Then you can use the Camel bean parameter binding to tell Camel to pass in the headers you want at runtime. For example using the @Header annotation
See details at
http://camel.apache.org/bean-binding.html
And the Camel in Action book chapter, is all about using beans with Camel.
-
2. Re: Extract camel header as String
rchallapalli Jan 4, 2012 10:43 AM (in response to davsclaus)Thanks Claus. Got it!