camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bilgin Ibryam (Confluence)" <conflue...@apache.org>
Subject [CONF] Apache Camel > AWS-CW
Date Mon, 01 Jul 2013 13:17:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/en/2176/1/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>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~bibryam">Bilgin
Ibryam</a>
    </h4>
        <br/>
                         <h4>Changes (1)</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" >| {{CamelAwsCwMetricNamespace}} |
{{String}} | The Amazon CW metric namespace. | <br>| {{CamelAwsCwMetricTimestamp}} |
{{Date}} | The Amazon CW metric timestamp. | <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">|
{{CamelAwsCwMetricDimensionName}} | {{String}} | *Camel 2.12:* The Amazon CW metric dimension
name. | <br>| {{CamelAwsCwMetricDimensionValue}} | {{String}} | *Camel 2.12:* The Amazon
CW metric dimension value. | <br>| {{CamelAwsCwMetricDimensions}} | {{Map&lt;String,
String&gt;}} | *Camel 2.12:* A map of dimension names and dimension values. | <br></td></tr>
            <tr><td class="diff-unchanged" >{div} <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-CW-CWComponent"></a>CW Component</h2>
<p>*Available as of Camel 2.11</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="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
aws-cw://namespace[?options]
</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.AmazonCloudWatch</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>
<tr>
<td class='confluenceTd'> <tt>CamelAwsCwMetricDimensionName</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> <b>Camel 2.12:</b> The Amazon CW metric dimension
name. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsCwMetricDimensionValue</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> <b>Camel 2.12:</b> The Amazon CW metric dimension
value. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelAwsCwMetricDimensions</tt> </td>
<td class='confluenceTd'> <tt>Map&lt;String, String&gt;</tt> </td>
<td class='confluenceTd'> <b>Camel 2.12:</b> A map of dimension names and
dimension values. </td>
</tr>
</tbody></table>
</div>
</div>

<h4><a name="AWS-CW-AdvancedAmazonCloudWatchconfiguration"></a>Advanced
AmazonCloudWatch configuration</h4>
<p>If you need more control over the <tt>AmazonCloudWatch</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="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
from("direct:start")
.to("aws-cw://namepsace?amazonCwClient=#client");
</pre>
</div></div>
<p>The <tt>#client</tt> refers to a <tt>AmazonCloudWatch</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="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
AWSCredentials awsCredentials = new BasicAWSCredentials("myAccessKey", "mySecretKey");
ClientConfiguration clientConfiguration = new ClientConfiguration();
clientConfiguration.setProxyHost("http://myProxyHost");
clientConfiguration.setProxyPort(8080);

AmazonCloudWatch client = new AmazonCloudWatchClient(awsCredentials, clientConfiguration);

registry.bind("client", client);
</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="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
&lt;dependency&gt;
    &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
    &lt;artifactId&gt;camel-aws&lt;/artifactId&gt;
    &lt;version&gt;${camel-version}&lt;/version&gt;
&lt;/dependency&gt;
</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;" class="grey">
                        <a href="https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=CAMEL">Stop
watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://cwiki.apache.org/confluence/users/editmyemailsettings.action">Change
email 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/pages/diffpagesbyversion.action?pageId=30744491&revisedVersion=4&originalVersion=3">View
Changes</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