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 Mon, 19 Mar 2012 10:10: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/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 (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" >- dig, to run DNS queries <br>
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{info:title=Requires
SUN JVM} <br>The DNSJava library requires to run on a SUN JVM. <br>If you use
Apache ServiceMix or Apache Karaf, you need to adjust the {{etc/jre.properties}} file, to
add {{sun.net.spi.nameservice}} to the list of Java platform packages exported. And the server
must be restarted before this change takes affect. <br>{info} <br> <br></td></tr>
            <tr><td class="diff-unchanged" >Maven users will need to add the following
dependency to their {{pom.xml}} for this component: <br>{code:xml} <br></td></tr>
            <tr><td class="diff-snipped" >...<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>


<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>Requires
SUN JVM</b><br />The DNSJava library requires to run on a SUN JVM.<br/>
If you use Apache ServiceMix or Apache Karaf, you need to adjust the <tt>etc/jre.properties</tt>
file, to add <tt>sun.net.spi.nameservice</tt> to the list of Java platform packages
exported. And the server must be restarted before this change takes affect.</td></tr></table></div>

<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=3&originalVersion=2">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