camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > AWS-SES
Date Mon, 19 Dec 2011 12:58:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/AWS-SES">AWS-SES</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://cwiki.apache.org/confluence/display/~bibryam">Bilgin
Ibryam</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h2><a name="AWS-SES-SESComponent"></a>SES Component</h2>
<p><b>Available as of Camel 2.8</b></p>

<p>The ses component supports sending emails with <a href="http://aws.amazon.com/ses"
class="external-link" rel="nofollow">Amazon's SES</a> service.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>Prerequisites</b><br
/>You must have a valid Amazon Web Services developer account, and be signed up to use
Amazon SES. More information are available at <a href="http://aws.amazon.com/ses" class="external-link"
rel="nofollow">Amazon SES</a>.</td></tr></table></div>

<h3><a name="AWS-SES-URIFormat"></a>URI Format</h3>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
aws-ses:<span class="code-comment">//from[?options]</span>
</pre>
</div></div>
<p>You can append query options to the URI in the following format, ?options=value&amp;option2=value&amp;...</p>

<h3><a name="AWS-SES-URIOptions"></a>URI Options</h3>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Default Value </th>
<th class='confluenceTh'> Context </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'>amazonSESClient </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> Reference to a <tt>com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClient</tt>
in the <a href="/confluence/display/CAMEL/Registry" title="Registry">Registry</a>.
</td>
</tr>
<tr>
<td class='confluenceTd'>accessKey </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> Amazon AWS Access Key </td>
</tr>
<tr>
<td class='confluenceTd'>secretKey </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> Amazon AWS Secret Key </td>
</tr>
<tr>
<td class='confluenceTd'>amazonSESEndpoint </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> The region with which the AWS-SES client wants to work with.
TODO</td>
</tr>
<tr>
<td class='confluenceTd'>subject </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> The subject which is used if the message header 'CamelAwsSesSubject'
is not present. </td>
</tr>
<tr>
<td class='confluenceTd'>to </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> List of destination email address. Can be overriden with 'CamelAwsSesTo'
header. </td>
</tr>
<tr>
<td class='confluenceTd'>returnPath </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> The email address to which bounce notifications are to be
forwarded, override it using 'CamelAwsSesReturnPath' header. </td>
</tr>
<tr>
<td class='confluenceTd'>replyToAddresses</td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> The reply-to email address(es) for the message, override it
using 'CamelAwsSesReplyToAddresses' header.</td>
</tr>
</tbody></table>
</div>


<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>Required
SES component options</b><br />You have to provide the amazonSESClient in the
<a href="/confluence/display/CAMEL/Registry" title="Registry">Registry</a> or
your accessKey and secretKey to access the <a href="http://aws.amazon.com/ses" class="external-link"
rel="nofollow">Amazon's SES</a>.</td></tr></table></div>

<h3><a name="AWS-SES-Usage"></a>Usage</h3>
<h4><a name="AWS-SES-MessageheadersevaluatedbytheSESproducer"></a>Message
headers evaluated by the SES producer</h4>
<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Header </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSesFrom</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The sender's email address. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSesTo</tt> </td>
<td class='confluenceTd'> <tt>List</tt> </td>
<td class='confluenceTd'> The destination(s) for this email. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSesSubject</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The subject of the message. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSesReplyToAddresses</tt> </td>
<td class='confluenceTd'> <tt>List</tt> </td>
<td class='confluenceTd'> The reply-to email address(es) for the message. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSesReturnPath</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The email address to which bounce notifications are to be
forwarded. </td>
</tr>
</tbody></table>
</div>
</div>

<h4><a name="AWS-SES-MessageheaderssetbytheSESproducer"></a>Message headers
set by the SES producer</h4>
<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Header </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSesMessageId</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The Amazon SES message ID. </td>
</tr>
</tbody></table>
</div>
</div>

<h4><a name="AWS-SES-AdvancedAmazonSimpleEmailServiceClientconfiguration"></a>Advanced
AmazonSimpleEmailServiceClient configuration</h4>
<p>If you need more control over the <tt>AmazonSimpleEmailServiceClient</tt>
configuration you can create your own instance and refer to it from the URI:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"direct:start"</span>)
.to(<span class="code-quote">"aws-ses:<span class="code-comment">//example@example.com?amazonSESClient=#amazonSESClient"</span>);</span>
</pre>
</div></div>
<p>The <tt>#amazonSESClient</tt> refers to a <tt>AmazonSimpleEmailServiceClient</tt>
in the <a href="/confluence/display/CAMEL/Registry" title="Registry">Registry</a>.</p>

<p>For example if your Camel Application is running behind a firewall:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
AWSCredentials awsCredentials = <span class="code-keyword">new</span> BasicAWSCredentials(<span
class="code-quote">"myAccessKey"</span>, <span class="code-quote">"mySecretKey"</span>);
ClientConfiguration clientConfiguration = <span class="code-keyword">new</span>
ClientConfiguration();
clientConfiguration.setProxyHost(<span class="code-quote">"http:<span class="code-comment">//myProxyHost"</span>);
</span>clientConfiguration.setProxyPort(8080);
AmazonSimpleEmailServiceClient amazonSESClient = <span class="code-keyword">new</span>
AmazonSimpleEmailServiceClient(awsCredentials, clientConfiguration);
</pre>
</div></div>

<h3><a name="AWS-SES-Dependencies"></a>Dependencies</h3>
<p>Maven users will need to add the following dependency to their pom.xml.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>pom.xml</b></div><div class="codeContent
panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;dependency&gt;</span>
    <span class="code-tag">&lt;groupId&gt;</span>org.apache.camel<span
class="code-tag">&lt;/groupId&gt;</span>
    <span class="code-tag">&lt;artifactId&gt;</span>camel-aws<span
class="code-tag">&lt;/artifactId&gt;</span>
    <span class="code-tag">&lt;version&gt;</span>${camel-version}<span
class="code-tag">&lt;/version&gt;</span>
<span class="code-tag">&lt;/dependency&gt;</span>
</pre>
</div></div>

<p>where <tt>${camel-version</tt>} must be replaced by the actual version
of Camel (2.8 or higher).</p>

<h3><a name="AWS-SES-SeeAlso"></a>See Also</h3>
<ul>
	<li><a href="/confluence/display/CAMEL/Configuring+Camel" title="Configuring Camel">Configuring
Camel</a></li>
	<li><a href="/confluence/display/CAMEL/Component" title="Component">Component</a></li>
	<li><a href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a></li>
	<li><a href="/confluence/display/CAMEL/Getting+Started" title="Getting Started">Getting
Started</a></li>
</ul>

<ul class="alternate" type="square">
	<li><a href="/confluence/display/CAMEL/AWS" title="AWS">AWS Component</a></li>
</ul>

    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>
       <a href="https://cwiki.apache.org/confluence/display/CAMEL/AWS-SES">View Online</a>
              |
       <a href="https://cwiki.apache.org/confluence/display/CAMEL/AWS-SES?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message