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 Wed, 20 Mar 2013 17:16: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>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~muellerc">Christian
Mueller</a>
    </h4>
        <br/>
                         <h4>Changes (2)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{div} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >h4. Advanced <span class="diff-changed-words">AmazonSimpleEmailService<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">Client</span></span>
configuration <br></td></tr>
            <tr><td class="diff-unchanged" >If you need more control over the
{{AmazonSimpleEmailService}} instance configuration you can create your own instance and refer
to it from the URI: <br>{code} <br>from(&quot;direct:start&quot;) <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">.to(&quot;aws-ses://example@example.com?amazonSESClient=#amazonSESClient&quot;);</span>
<span class="diff-added-words"style="background-color: #dfd;">.to(&quot;aws-ses://example@example.com?amazonSESClient=#client&quot;);</span>
<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br>The {{#client}} refers
to a {{AmazonSimpleEmailService}} in the [Registry]. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="AWS-SES-SESComponent"></a>SES Component</h2>
<p><b>Available as of Camel 2.8.4</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.AmazonSimpleEmailService</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.
</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'> List of 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&lt;String&gt;</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&lt;String&gt;</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-AdvancedAmazonSimpleEmailServiceconfiguration"></a>Advanced
AmazonSimpleEmailService configuration</h4>
<p>If you need more control over the <tt>AmazonSimpleEmailService</tt> instance
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=#client"</span>);</span>
</pre>
</div></div>
<p>The <tt>#client</tt> refers to a <tt>AmazonSimpleEmailService</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);
AmazonSimpleEmailService client = <span class="code-keyword">new</span> AmazonSimpleEmailServiceClient(awsCredentials,
clientConfiguration);

registry.bind(<span class="code-quote">"client"</span>, client);
</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.4 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/pages/diffpagesbyversion.action?pageId=27833868&revisedVersion=4&originalVersion=3">View
Changes</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