Samples - 6.3

Talend ESB Mediation Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend ESB

We start with a simple route that sends the messages received from a JMS queue as emails. The email account is the admin account on mymailserver.com.

from("jms://queue:subscription")
   .to("smtp://admin@mymailserver.com?password=secret");

In the next sample, we poll a mailbox for new emails once every minute. Notice that we use the special consumer option for setting the poll interval, consumer.delay, as 60000 milliseconds = 60 seconds.

from("imap://admin@mymailserver.com&password=secret
&unseen=true&consumer.delay=60000")
   .to("seda://mails");

In this sample we want to send a mail to multiple recipients.

// all the recipients of this mail are:
// To: camel@riders.org , easy@riders.org
// CC: me@you.org
// BCC: someone@somewhere.org
String recipients = "&To=camel@riders.org,easy@riders.org&
CC=me@you.org&BCC=someone@somewhere.org";

from("direct:a")
   .to("smtp://you@mymailserver.com?password=secret&From=you@apache.org" 
+ recipients);

Check the Apache Camel website for several more examples, including handling mail attachments and SSL configuration.