I am trying to write an Apache Camel route for sending email to myself, based on Part 4 of this tutorial:
https://camel.apache.org/tutorial-example-reportincident.html
from("file://target/subfolder")
.setHeader("subject", constant("new incident reported"))
.convertBodyTo(String.class)
// send the email
.to("smtp://myID@localhost?password=&to=myname@mycompany.com");
But I'm getting this, and no email in my inbox:
395 [main] DEBUG org.apache.camel.example.reportincident.
ReportIncidentRoutesTest - Routing Rules are:
[EventDrivenConsumerRoute[Endpoint[direct:start] ->
Delegate(Delegate(Pipeline[DeadLetterChannel[Delegate(setHeader(org.apache.
camel.file.name, BeanExpression[bean:org.apache.camel.example.reportincident.
FilenameGenerator@244aeb52 method: generateFilename])),
RecipientList[log:org.apache.camel.DeadLetterChannel?level=error]],
DeadLetterChannel[Delegate(sendTo(Endpoint[velocity:MailBody.vm])),
RecipientList[log:org.apache.camel.DeadLetterChannel?level=error]],
DeadLetterChannel[Delegate(sendTo(Endpoint[file://target/subfolder])),
RecipientList[log:org.apache.camel.DeadLetterChannel?level=error]]]))],
EventDrivenConsumerRoute[Endpoint[file://target/subfolder] ->
Delegate(Delegate(Pipeline[DeadLetterChannel[Delegate(setHeader(To,
myname@mycompany.com)), RecipientList[log:org.apache.camel.DeadLetterChannel?
level=error]], DeadLetterChannel[Delegate(setHeader(subject, new incident
reported)), RecipientList[log:org.apache.camel.DeadLetterChannel?level=error]],
DeadLetterChannel[Delegate(org.apache.camel.processor.
ConvertBodyProcessor@6e79839),
RecipientList[log:org.apache.camel.DeadLetterChannel?level=error]],
DeadLetterChannel[Delegate(sendTo(Endpoint[smtp://myID@localhost?
password=&to=myname@mycompany.com])),
RecipientList[log:org.apache.camel.DeadLetterChannel?level=error]]]))]]
I'm not sure why, or how I can fix this problem. I also seem to be getting these warnings when I run the test:
[WARNING] The POM for com.sun.xml.fastinfoset:FastInfoset:jar:1.2.2 is invalid,
transitive dependencies (if any) will not be available,
enable debug logging for more details
[WARNING] The POM for com.sun.xml.bind:jaxb-impl:jar:2.1.7 is invalid,
transitive dependencies (if any) will not be available,
enable debug logging for more details
[WARNING] The POM for com.sun.xml.bind:jaxb-xjc:jar:2.1.7 is invalid,
transitive dependencies (if any) will not be available,
enable debug logging for more details
...
606 [main] WARN org.apache.camel.impl.converter.DefaultTypeConverter -
Overriding type converter from: StaticMethodTypeConverter:
public static java.lang.String org.apache.camel.converter.IOConverter.
toString(javax.xml.transform.Source) throws javax.xml.transform.
TransformerException,java.io.IOException to: InstanceMethodTypeConverter: public
java.lang.String org.apache.camel.converter.jaxp.XmlConverter.toString
(javax.xml.transform.Source) throws javax.xml.transform.TransformerException