Re: Email Error on Route Exception

2014-05-23 Thread Claus Ibsen
On Fri, May 23, 2014 at 4:27 PM, Matt Raible wrote: > That worked - thanks! > > .setHeader("subject", simple("Message Broker Error ({{ESB_ENV}}) - > ${exception.class.simpleName}")) > .transform(simple("${exception.message}\n\nStacktrace > Details:\n\n${exception.stacktrace}")) > .to("freemarker

Re: Email Error on Route Exception

2014-05-23 Thread Matt Raible
That worked - thanks! .setHeader("subject", simple("Message Broker Error ({{ESB_ENV}}) - ${exception.class.simpleName}")) .transform(simple("${exception.message}\n\nStacktrace Details:\n\n${exception.stacktrace}")) .to("freemarker:/templates/mail/error.ftl") .to("smtp://{{mail.host}}?contentType

Re: Email Error on Route Exception

2014-05-23 Thread Claus Ibsen
You can set the subject as a header, then the smtp will use that Something like this (not wrote the code in this email) .setHeader("subject", simple("Message Broker Error ${exception.getClassName()}")) On Fri, May 23, 2014 at 3:45 PM, Matt Raible wrote: > I was able to figure out how to set head

Re: Email Error on Route Exception

2014-05-23 Thread Matt Raible
I was able to figure out how to set headers and retrieve those variables in the FreeMarker template. However, I'm still unable to access them in the SMTP endpoint. Also, if I set the "exception", I can't call ${exception.stacktrace} in FreeMarker like I can in a simple transform. Here's what I h

Re: Email Error on Route Exception

2014-05-22 Thread Claus Ibsen
Hi Yeah a good idea is to check the unit tests for camel-freemarker for examples. Also take a note that Camel stores various information from the Exchange etc. and provides that to freemarker in the process method. https://github.com/apache/camel/blob/master/components/camel-freemarker/src/main/j

Re: Email Error on Route Exception

2014-05-22 Thread Charles Moulliard
Matt, You ca retrieve using ${body} and ${headers.} within the freemarker template ( https://github.com/apache/camel/blob/master/components/camel-freemarker/src/test/resources/org/apache/camel/component/freemarker/letterWithoutHeader.ftl#L21) the content of your body or headers/properties like

Re: Email Error on Route Exception

2014-05-22 Thread Matt Raible
I figured out a solution for this. First of all, I changed my route to be a Spring bean so dependency injection would work: @Component public class FooRoute extends RouteBuilder { } Then I changed my Camel configuration to use Spring annotations and @ComponentScan. I also configured things so p

Email Error on Route Exception

2014-05-22 Thread Matt Raible
Hello all, I'm getting up to speed on Apache Camel and trying to replace a "message flow" that was originally written for IBM Message Broker 6.1. The flow involves receiving input from a SOAP service, looking up a value in a database, and returning that to the client (again, via SOAP). I have a ro