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-SDB
Date Wed, 20 Mar 2013 17:08: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-SDB">AWS-SDB</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~muellerc">Christian
Mueller</a>
    </h4>
        <br/>
                         <h4>Changes (7)</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">AmazonSimpleDB<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-changed-lines" >If you need more control over
the <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{{AmazonSimpleDBClient}}</span>
<span class="diff-added-words"style="background-color: #dfd;">{{AmazonSimpleDB}} instance</span>
configuration you can create your own instance and refer to it from the URI: <br></td></tr>
            <tr><td class="diff-unchanged" >{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-sdb://domainName?amazonSDBClient=#amazonSDBClient&quot;);</span>
<span class="diff-added-words"style="background-color: #dfd;">.to(&quot;aws-sdb://domainName?amazonSDBClient=#client&quot;);</span>
<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br></td></tr>
            <tr><td class="diff-changed-lines" >The <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{{#amazonSDBClient}}</span>
<span class="diff-added-words"style="background-color: #dfd;">{{#client}}</span>
refers to a <span class="diff-changed-words">{{AmazonSimpleDB<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">Client</span>}}</span>
in the [Registry]. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>For example if your Camel
Application is running behind a firewall: <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >clientConfiguration.setProxyHost(&quot;http://myProxyHost&quot;);
<br>clientConfiguration.setProxyPort(8080); <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
<br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">AmazonSimpleDBClient
amazonSDBClient</span> <span class="diff-added-words"style="background-color: #dfd;">AmazonSimpleDB
client</span> = new AmazonSimpleDBClient(awsCredentials, clientConfiguration); <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
<br>registry.bind(&quot;client&quot;, client); <br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="AWS-SDB-SDBComponent"></a>SDB Component</h2>
<p><b>Available as of Camel 2.8.4</b></p>

<p>The sdb component supports storing and retrieving data from/to <a href="http://aws.amazon.com/sdb"
class="external-link" rel="nofollow">Amazon's SDB</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 SDB. More information are available at <a href="http://aws.amazon.com/sdb" class="external-link"
rel="nofollow">Amazon SDB</a>.</td></tr></table></div>

<h3><a name="AWS-SDB-URIFormat"></a>URI Format</h3>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
aws-sdb:<span class="code-comment">//domainName[?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-SDB-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'>amazonSDBClient </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> Reference to a <tt>com.amazonaws.services.simpledb.AmazonSimpleDB</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'>amazonSdbEndpoint </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> The region with which the AWS-SDB client wants to work with.
</td>
</tr>
<tr>
<td class='confluenceTd'>domainName </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> The name of the domain currently worked with. </td>
</tr>
<tr>
<td class='confluenceTd'>maxNumberOfDomains </td>
<td class='confluenceTd'> <tt>100</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> The maximum number of domain names you want returned. The
range is 1 * to 100. </td>
</tr>
<tr>
<td class='confluenceTd'>consistentRead </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> Determines whether or not strong consistency should be enforced
when data is read.</td>
</tr>
<tr>
<td class='confluenceTd'>operation</td>
<td class='confluenceTd'> <tt>PutAttributes</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> Valid values are BatchDeleteAttributes, BatchPutAttributes,
DeleteAttributes, DeleteDomain, DomainMetadata, GetAttributes, ListDomains, PutAttributes,
Select.</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
SDB component options</b><br />You have to provide the amazonSDBClient 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/sdb" class="external-link"
rel="nofollow">Amazon's SDB</a>.</td></tr></table></div>

<h3><a name="AWS-SDB-Usage"></a>Usage</h3>
<h4><a name="AWS-SDB-MessageheadersevaluatedbytheSDBproducer"></a>Message
headers evaluated by the SDB 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>CamelAwsSdbAttributes</tt> </td>
<td class='confluenceTd'> <tt>Collection&lt;Attribute&gt;</tt> </td>
<td class='confluenceTd'> List of attributes to be acted upon. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbAttributeNames</tt> </td>
<td class='confluenceTd'> <tt>Collection&lt;String&gt;</tt> </td>
<td class='confluenceTd'> The names of the attributes to be retrieved. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbConsistentRead</tt> </td>
<td class='confluenceTd'> <tt>Boolean</tt> </td>
<td class='confluenceTd'> Determines whether or not strong consistency should be enforced
when data is read. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbDeletableItems</tt> </td>
<td class='confluenceTd'> <tt>Collection&lt;DeletableItem&gt;</tt>
</td>
<td class='confluenceTd'> A list of items on which to perform the delete operation in
a batch. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbDomainName</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The name of the domain currently worked with. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbItemName</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The unique key for this item </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbMaxNumberOfDomains</tt> </td>
<td class='confluenceTd'> <tt>Integer</tt> </td>
<td class='confluenceTd'> The maximum number of domain names you want returned. The
range is 1 * to 100. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbNextToken</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> A string specifying where to start the next list of domain/item
names. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbOperation</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> To override the operation from the URI options. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbReplaceableAttributes</tt> </td>
<td class='confluenceTd'> <tt>Collection&lt;ReplaceableAttribute&gt;</tt>
</td>
<td class='confluenceTd'> List of attributes to put in an Item. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbReplaceableItems</tt> </td>
<td class='confluenceTd'> <tt>Collection&lt;ReplaceableItem&gt;</tt>
</td>
<td class='confluenceTd'> A list of items to put in a Domain. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbSelectExpression</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The expression used to query the domain. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbUpdateCondition</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The update condition which, if specified, determines whether
the specified attributes will be updated/deleted or not. </td>
</tr>
</tbody></table>
</div>
</div>

<h4><a name="AWS-SDB-MessageheaderssetduringDomainMetadataoperation"></a>Message
headers set during DomainMetadata operation</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>CamelAwsSdbTimestamp</tt> </td>
<td class='confluenceTd'> <tt>Integer</tt> </td>
<td class='confluenceTd'> The data and time when metadata was calculated, in Epoch (UNIX)
seconds. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbItemCount</tt> </td>
<td class='confluenceTd'> <tt>Integer</tt> </td>
<td class='confluenceTd'> The number of all items in the domain. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbAttributeNameCount</tt> </td>
<td class='confluenceTd'> <tt>Integer</tt> </td>
<td class='confluenceTd'> The number of unique attribute names in the domain. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbAttributeValueCount</tt> </td>
<td class='confluenceTd'> <tt>Integer</tt> </td>
<td class='confluenceTd'> The number of all attribute name/value pairs in the domain.
</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbAttributeNameSize</tt> </td>
<td class='confluenceTd'> <tt>Long</tt> </td>
<td class='confluenceTd'> The total size of all unique attribute names in the domain,
in bytes. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbAttributeValueSize</tt> </td>
<td class='confluenceTd'> <tt>Long</tt> </td>
<td class='confluenceTd'> The total size of all attribute values in the domain, in bytes.
</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbItemNameSize</tt> </td>
<td class='confluenceTd'> <tt>Long</tt> </td>
<td class='confluenceTd'> The total size of all item names in the domain, in bytes.
</td>
</tr>
</tbody></table>
</div>
</div>

<h4><a name="AWS-SDB-MessageheaderssetduringGetAttributesoperation"></a>Message
headers set during GetAttributes operation</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>CamelAwsSdbAttributes</tt> </td>
<td class='confluenceTd'> <tt>List&lt;Attribute&gt;</tt> </td>
<td class='confluenceTd'> The list of attributes returned by the operation. </td>
</tr>
</tbody></table>
</div>
</div>

<h4><a name="AWS-SDB-MessageheaderssetduringListDomainsoperation"></a>Message
headers set during ListDomains operation</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>CamelAwsSdbDomainNames</tt> </td>
<td class='confluenceTd'> <tt>List&lt;String&gt;</tt> </td>
<td class='confluenceTd'> A list of domain names that match the expression. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbNextToken</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> An opaque token indicating that there are more domains than
the specified MaxNumberOfDomains still available. </td>
</tr>
</tbody></table>
</div>
</div>

<h4><a name="AWS-SDB-MessageheaderssetduringSelectoperation"></a>Message
headers set during Select operation</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>CamelAwsSdbItems</tt> </td>
<td class='confluenceTd'> <tt>List&lt;Item&gt;</tt> </td>
<td class='confluenceTd'> A list of items that match the select expression. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsSdbNextToken</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> An opaque token indicating that more items than MaxNumberOfItems
were matched, the response size exceeded 1 megabyte, or the execution time exceeded 5 seconds.
</td>
</tr>
</tbody></table>
</div>
</div>

<h4><a name="AWS-SDB-AdvancedAmazonSimpleDBconfiguration"></a>Advanced AmazonSimpleDB
configuration</h4>
<p>If you need more control over the <tt>AmazonSimpleDB</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-sdb:<span class="code-comment">//domainName?amazonSDBClient=#client"</span>);</span>
</pre>
</div></div>
<p>The <tt>#client</tt> refers to a <tt>AmazonSimpleDB</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);

AmazonSimpleDB client = <span class="code-keyword">new</span> AmazonSimpleDBClient(awsCredentials,
clientConfiguration);

registry.bind(<span class="code-quote">"client"</span>, client);
</pre>
</div></div>

<h3><a name="AWS-SDB-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-SDB-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-SDB">View Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=27834041&revisedVersion=3&originalVersion=2">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/AWS-SDB?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message