This seems like it should be simple, pardon the pun. I'm trying to log a header in camel within a spring DSL route. I've seen the answer for Java DSL but I've been searching in vain for how to make it work in spring DSL. I've tried:
<log message="ftping $simple{header.CamelFileName}"/>
and also:
<log message="ftping ${header.CamelFileName}"/>
and several other permutations/variations, but all of them simply log that text verbatim (i.e. they do not substitute the actual header name).
What am I missing?
update: here's a larger portion of my xml file:
<split>
<simple>${body}</simple>
<setHeader headerName="CamelFileName">
<simple>${body.batchNumber}.xml</simple>
</setHeader>
<log message="SLH - 5 -- marshalling an EFileBatch to XML" loggingLevel="DEBUG" />
<marshal>
<jaxb prettyPrint="true" contextPath="generated.gov.nmcourts.ecitation"
partClass="generated.gov.nmcourts.ecitation.NMCitationEFileBatch"
partNamespace="EFileBatch" />
</marshal>
<log message="SLH - 6 -- xslt transform to add schema location" loggingLevel="DEBUG" />
<to uri="{{addSchemaLocationXsltUri}}"/>
<log message="SLH - 7 -- ftp now initiating" loggingLevel="DEBUG" />
<log message="ftping ${headers.CamelFileName}"/>
<to uri="{{ftpOdysseyInputPath}}"/>
<log message="SLH - 8 -- ftp now complete" loggingLevel="DEBUG" />
</split>
Asked this question some time back, and realized that I eventually found the answer so should post it here in case someone else finds this thread in a search. This works:
<log message="ftping $simple{in.header.CamelFileName}" loggingLevel="DEBUG"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With