camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > DNS
Date Tue, 01 Mar 2011 07:03:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2036/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/DNS">DNS</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~davsclaus">Claus
Ibsen</a>
    </h4>
        <br/>
                         <h4>Changes (10)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-unchanged" >h2. DNS <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">*Available
as of Camel 2.7* <br></td></tr>
            <tr><td class="diff-unchanged" > <br>This is an additional component
for Camel to run DNS queries, using DNSJava. The component is a thin layer on top of [DNSJava|http://www.xbill.org/dnsjava/].
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >- dig, to run DNS queries <br>
<br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">TODO:
dependency <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Maven
users will need to add the following dependency to their {{pom.xml}} for this component: <br>{code:xml}
<br>&lt;dependency&gt; <br>    &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
<br>    &lt;artifactId&gt;camel-dns&lt;/artifactId&gt; <br>  
 &lt;version&gt;x.x.x&lt;/version&gt; <br>    &lt;!-- use the same
version as your Camel core version --&gt; <br>&lt;/dependency&gt; <br>{code}
<br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h3.
URI format <br> <br>The URI scheme for a DNS component is as follows <br>
<br>{code} <br>dns://operation <br>{code} <br> <br>This component
only supports producers. <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h3. Options <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h3. Headers <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">
</span> <span class="diff-added-words"style="background-color: #dfd;">{div:class=confluenceTableSmall}</span>
<br></td></tr>
            <tr><td class="diff-unchanged" >|| Header || Type || Operations ||
Description || <br>| dns.domain | String | ip | The domain name. Mandatory. | <br>|
dns.name | String | lookup | The name to lookup. Mandatory. | <br></td></tr>
            <tr><td class="diff-changed-lines" >| dns.type | <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">String</span>
<span class="diff-added-words"style="background-color: #dfd;">-</span> |  lookup,
dig | The type of the lookup. Should match the values of {{org.xbill.dns.Type}}. Optional.
| <br></td></tr>
            <tr><td class="diff-changed-lines" >| dns.class | <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">String</span>
<span class="diff-added-words"style="background-color: #dfd;">-</span> | lookup,
dig| he DNS class of the lookup. Should match the values of {{org.xbill.dns.DClass}}. Optional.
| <br></td></tr>
            <tr><td class="diff-unchanged" >| dns.query | String | dig | The query
itself. Mandatory. | <br>| dns.server | String | dig | The server in particular for
the query. If none is given, the default one specified by the OS will be used. Optional. |
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{div}
<br></td></tr>
            <tr><td class="diff-unchanged" > <br>h3. Examples <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3.
See Also <br>XXX <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{include:Endpoint
See Also} <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="DNS-DNS"></a>DNS</h2>
<p><b>Available as of Camel 2.7</b></p>

<p>This is an additional component for Camel to run DNS queries, using DNSJava. The
component is a thin layer on top of <a href="http://www.xbill.org/dnsjava/" class="external-link"
rel="nofollow">DNSJava</a>.<br/>
The component offers the following operations:</p>
<ul class="alternate" type="square">
	<li>ip, to resolve a domain by its ip</li>
	<li>lookup, to lookup information about the domain</li>
	<li>dig, to run DNS queries</li>
</ul>


<p>Maven users will need to add the following dependency to their <tt>pom.xml</tt>
for this component:</p>
<div class="code panel" style="border-width: 1px;"><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-dns<span
class="code-tag">&lt;/artifactId&gt;</span>
    <span class="code-tag">&lt;version&gt;</span>x.x.x<span class="code-tag">&lt;/version&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- use the same
version as your Camel core version --&gt;</span></span>
<span class="code-tag">&lt;/dependency&gt;</span>
</pre>
</div></div>

<h3><a name="DNS-URIformat"></a>URI format</h3>

<p>The URI scheme for a DNS component is as follows</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
dns:<span class="code-comment">//operation</span>
</pre>
</div></div>

<p>This component only supports producers.</p>

<h3><a name="DNS-Options"></a>Options</h3>

<p>None.</p>

<h3><a name="DNS-Headers"></a>Headers</h3>

<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'> Operations </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> dns.domain </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> ip </td>
<td class='confluenceTd'> The domain name. Mandatory. </td>
</tr>
<tr>
<td class='confluenceTd'> dns.name </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> lookup </td>
<td class='confluenceTd'> The name to lookup. Mandatory. </td>
</tr>
<tr>
<td class='confluenceTd'> dns.type </td>
<td class='confluenceTd'><ul class="alternate" type="square">
	<li></li>
</ul>
</td>
<td class='confluenceTd'>  lookup, dig </td>
<td class='confluenceTd'> The type of the lookup. Should match the values of <tt>org.xbill.dns.Type</tt>.
Optional. </td>
</tr>
<tr>
<td class='confluenceTd'> dns.class </td>
<td class='confluenceTd'><ul class="alternate" type="square">
	<li></li>
</ul>
</td>
<td class='confluenceTd'> lookup, dig</td>
<td class='confluenceTd'> he DNS class of the lookup. Should match the values of <tt>org.xbill.dns.DClass</tt>.
Optional. </td>
</tr>
<tr>
<td class='confluenceTd'> dns.query </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> dig </td>
<td class='confluenceTd'> The query itself. Mandatory. </td>
</tr>
<tr>
<td class='confluenceTd'> dns.server </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> dig </td>
<td class='confluenceTd'> The server in particular for the query. If none is given,
the default one specified by the OS will be used. Optional. </td>
</tr>
</tbody></table>
</div>
</div>

<h3><a name="DNS-Examples"></a>Examples</h3>

<h4><a name="DNS-IPlookup"></a>IP lookup</h4>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
        <span class="code-tag">&lt;route id=<span class="code-quote">"IPCheck"</span>&gt;</span>
            <span class="code-tag">&lt;from uri=<span class="code-quote">"direct:start"</span>/&gt;</span>
            <span class="code-tag">&lt;to uri=<span class="code-quote">"dns:ip"</span>/&gt;</span>
        <span class="code-tag">&lt;/route&gt;</span>
</pre>
</div></div>

<p>This looks up a domain's IP. For example, www.example.com resolves to 192.0.32.10.<br/>
The IP address to lookup must be provided in the header with key <tt>"dns.domain"</tt>.</p>

<h4><a name="DNS-DNSlookup"></a>DNS lookup</h4>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
        <span class="code-tag">&lt;route id=<span class="code-quote">"IPCheck"</span>&gt;</span>
            <span class="code-tag">&lt;from uri=<span class="code-quote">"direct:start"</span>/&gt;</span>
            <span class="code-tag">&lt;to uri=<span class="code-quote">"dns:lookup"</span>/&gt;</span>
        <span class="code-tag">&lt;/route&gt;</span>
</pre>
</div></div>

<p>This returns a set of DNS records associated with a domain.<br/>
The name to lookup must be provided in the header with key <tt>"dns.name"</tt>.</p>

<h4><a name="DNS-DNSDig"></a>DNS Dig</h4>
<p>Dig is a Unix command-line utility to run DNS queries.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
        <span class="code-tag">&lt;route id=<span class="code-quote">"IPCheck"</span>&gt;</span>
            <span class="code-tag">&lt;from uri=<span class="code-quote">"direct:start"</span>/&gt;</span>
            <span class="code-tag">&lt;to uri=<span class="code-quote">"dns:dig"</span>/&gt;</span>
        <span class="code-tag">&lt;/route&gt;</span>
</pre>
</div></div>

<p>The query must be provided in the header with key <tt>"dns.query"</tt>.</p>


<h3><a name="DNS-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>

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

Mime
View raw message