On Wed, Mar 4, 2009 at 10:55 PM, Claus Ibsen <claus.ib...@gmail.com> wrote: > There is a <setHeader> tag you can use to add the header, just like > the Java DSL below. > It might use a expression as subtype so you need to wrap it with > <constant> for string litterals > > Something like this: > <setHeader name="foo"><constant>Bar</constant></setHeader>
Thanks, Claus. I missed this element in the XSD. >> >> The problem with this flavor is the following error: >> >> org.apache.camel.RuntimeCamelException: Can't find the operation name >> in the message! >> >> To my knowledge, there is no way to add headers to a message exchange >> via the XML. If I'm wrong about this I'd appreciate some suggestions >> on how to get beyond the error. >> >> >> 2) Below is the same route using the Java API: >> >> public void configure() { >> from("file:src/data?noop=true").process(new Processor() { >> public void process(Exchange exchange) throws Exception { >> Message in = exchange.getIn(); >> in.setHeader("operationName", "sayHi"); >> } >> }). >> >> to("cxf:http://localhost:9002/HelloWorld?serviceClass=demo.spring.HelloWorld"); >> } >> >> The problem with this route is that Camel hangs on the following line >> indefinitely and I can't get it beyond it: >> >> ... >> INFO: Apache Camel 1.6.0 (CamelContext:camelContext) started >> Mar 4, 2009 2:01:06 PM org.apache.camel.util.MainSupport generateDot >> INFO: Generating DOT file for routes: >> /Users/bsnyder/Desktop/eclipse-3.4/workspace-amq-trunk/camel-example-two/target/site/cameldoc >> for: org.apache.camel.spring.springcamelcont...@dd6a83 with name: >> camelContext >> >> If anyone can tell me how to move beyond this then I could move on to >> the next issue. >> >> Incidentally, patched the org.apache.camel.spring.Main class to add >> the ability to disable the DOT file generation. But there is already a >> property in the RunMojo named dotEnabled but it's read-only. Why is >> this? > Strange, as according to this you should be able to disable it: > http://camel.apache.org/camel-dot-maven-goal.html I've now disabled this in the POM using the following configuration and it's still hanging in the same location: <reporting> <plugins> <plugin> <groupId>org.apache.camel</groupId> <artifactId>camel-maven-plugin</artifactId> <version>${camel-version}</version> <configuration> <!--executable>/Applications/Graphviz.app/Contents/MacOS/Graphviz</executable--> <useDot>false</useDot> </configuration> </plugin> </plugins> </reporting> > Maybe we should let it be disabled by default as most people will NOT > have Graphviz installed by default. That's not a bad idea, but there should be some logging that indicates the situation, i.e., Unable to locate the Graphviz executable, disabling DOT generation. >> >> Additionally, I've enabled debug logging on org.apache.camel and I'm >> still only seeing info level output, even after cleaning and >> rebuilding. > Have you added log4j to the classpath and log4j.properties in > src/main/resources? > > CXF is sadly using JDK Logging (This is really terrible IMHO, always > use JCL as all the other frameworks does) > > Willem Jiang wrote something somewhere how to get CXF to use log4j. Yeah, I'm aware of this as I added a tip to the CXF wiki some time ago: http://cwiki.apache.org/CXF20DOC/debugging.html#Debugging-UsingLog4jInsteadofjava.util.logging But this is not the issue. I'm no longer using the camel-cxf component and I still cannot see debug level logging. Bruce -- perl -e 'print unpack("u30","D0G)u8...@4vyy9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*" );' Apache ActiveMQ - http://activemq.apache.org/ Apache Camel - http://camel.apache.org/ Apache ServiceMix - http://servicemix.apache.org/ Blog: http://bruceblog.org/