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-CW
Date Mon, 10 Dec 2012 17: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-CW">AWS-CW</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-CW-CWComponent"></a>CW Component</h2>
<p><b>Available as of Camel 2.10</b></p>

<p>The CW component allows messages to be sent to an <a href="http://aws.amazon.com/cloudwatch/"
class="external-link" rel="nofollow">Amazon CloudWatch</a> metrics. The implementation
of the Amazon API is provided by the&nbsp;<a href="http://aws.amazon.com/sdkforjava/"
class="external-link" rel="nofollow">AWS SDK</a>.</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 CloudWatch. More information are available at <a href="http://aws.amazon.com/cloudwatch/"
class="external-link" rel="nofollow">Amazon CloudWatch</a>.</td></tr></table></div>

<h3><a name="AWS-CW-URIFormat"></a>URI Format</h3>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
aws-cw:<span class="code-comment">//namespace[?options]</span>
</pre>
</div></div>
<p>The metrics will be created if they don't already exists.<br/>
You can append query options to the URI in the following format, <tt>?options=value&amp;option2=value&amp;...</tt></p>

<h3><a name="AWS-CW-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'>amazonCwClient </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> Reference to a <tt>com.amazonaws.services.cloudwatch.AmazonCloudWatchClient</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'>name </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> The metric name which is used if the message header 'CamelAwsCwMetricName'
is not present. </td>
</tr>
<tr>
<td class='confluenceTd'>value </td>
<td class='confluenceTd'> <tt>1.0</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> The metric value which is used if the message header 'CamelAwsCwMetricValue'
is not present. </td>
</tr>
<tr>
<td class='confluenceTd'>unit </td>
<td class='confluenceTd'> <tt>Count</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> The metric unit which is used if the message header 'CamelAwsCwMetricUnit'
is not present. </td>
</tr>
<tr>
<td class='confluenceTd'>namespace </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> The metric namespace which is used if the message header 'CamelAwsCwMetricNamespace'
is not present. </td>
</tr>
<tr>
<td class='confluenceTd'>timestamp </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> The metric timestamp which is used if the message header 'CamelAwsCwMetricTimestamp'
is not present. </td>
</tr>
<tr>
<td class='confluenceTd'>amazonCwEndpoint </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> The region with which the AWS-CW client wants to work with.
</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
CW component options</b><br />You have to provide the amazonCwClient 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/cloudwatch/" class="external-link"
rel="nofollow">Amazon's CloudWatch</a>.</td></tr></table></div>

<h3><a name="AWS-CW-Usage"></a>Usage</h3>
<h4><a name="AWS-CW-MessageheadersevaluatedbytheCWproducer"></a>Message
headers evaluated by the CW 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>CamelAwsCwMetricName</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The Amazon CW metric name. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsCwMetricValue</tt> </td>
<td class='confluenceTd'> <tt>Double</tt> </td>
<td class='confluenceTd'> The Amazon CW metric value. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsCwMetricUnit</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The Amazon CW metric unit. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsCwMetricNamespace</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The Amazon CW metric namespace. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsCwMetricTimestamp</tt> </td>
<td class='confluenceTd'> <tt>Date</tt> </td>
<td class='confluenceTd'> The Amazon CW metric timestamp. </td>
</tr>
</tbody></table>
</div>
</div>

<h4><a name="AWS-CW-AdvancedAmazonCloudWatchClientconfiguration"></a>Advanced
AmazonCloudWatchClient configuration</h4>
<p>If you need more control over the <tt>AmazonCloudWatchClient</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-cw:<span class="code-comment">//namepsace?amazonCwClient=#amazonCwClient"</span>);</span>
</pre>
</div></div>
<p>The <tt>#amazonCwClient</tt> refers to a <tt>AmazonCloudWatchClient</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);
AmazonCloudWatchClient amazonCwClient = <span class="code-keyword">new</span>
AmazonCloudWatchClient(awsCredentials, clientConfiguration);
</pre>
</div></div>

<h3><a name="AWS-CW-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.10 or higher).</p>

<h3><a name="AWS-CW-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-CW">View Online</a>
              |
       <a href="https://cwiki.apache.org/confluence/display/CAMEL/AWS-CW?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message