camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > Polling Consumer
Date Thu, 13 Jan 2011 11:59:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/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/Polling+Consumer">Polling
Consumer</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~davsclaus">Claus
Ibsen</a>
    </h4>
        <br/>
                         <h4>Changes (6)</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" >* Scheduled Polling Components <br>**
[ScheduledPollConsumer|http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/impl/ScheduledPollConsumer.html]
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">**
[Atom] <br></td></tr>
            <tr><td class="diff-unchanged" >** [File|File2] <br>** [FTP|FTP2]
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">**
[iBatis] <br></td></tr>
            <tr><td class="diff-unchanged" >** [JPA] <br>** [Mail] <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">**
[iBatis]] <br></td></tr>
            <tr><td class="diff-unchanged" >** [Quartz] <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">**
[SNMP] <br>** [SQS] <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h3. ScheduledPollConsumer
Options <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >- commit <br>-- {{void commit(Consumer
consumer, Endpoint endpoint)}} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">-
commit (*Camel 2.6*) <br>-- {{void commit(Consumer consumer, Endpoint endpoint, int
polledMessages)}} <br></td></tr>
            <tr><td class="diff-unchanged" >- rollback <br>-- {{boolean
rollback(Consumer consumer, Endpoint endpoint, int retryCounter, Exception e) throws Exception}}
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >In *Camel 2.3* onwards the begin method
returns a boolean which indicates whether or not to skipping polling. So you can implement
your custom logic and return {{false}} if you do not want to poll this time. <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">In
*Camel 2.6* onwards the commit method has an additional parameter containing the number of
message that was actually polled. For example if there was no messages polled, the value would
be zero, and you can react accordingly. <br> <br></td></tr>
            <tr><td class="diff-unchanged" >The most interesting is the {{rollback}}
as it allows you do handle the caused exception and decide what to do.  <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h3><a name="PollingConsumer-PollingConsumer"></a>Polling Consumer</h3>

<p>Camel supports implementing the <a href="http://www.enterpriseintegrationpatterns.com/PollingConsumer.html"
class="external-link" rel="nofollow">Polling Consumer</a> from the <a href="/confluence/display/CAMEL/Enterprise+Integration+Patterns"
title="Enterprise Integration Patterns">EIP patterns</a> using the <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/PollingConsumer.html"
class="external-link" rel="nofollow">PollingConsumer</a> interface which can be created
via the <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Endpoint.html#createPollingConsumer()"
class="external-link" rel="nofollow">Endpoint.createPollingConsumer()</a> method.</p>

<p><span class="image-wrap" style=""><img src="http://www.enterpriseintegrationpatterns.com/img/PollingConsumerSolution.gif"
style="border: 0px solid black" /></span></p>

<p>So in your Java code you can do</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
Endpoint endpoint = context.getEndpoint(<span class="code-quote">"activemq:my.queue"</span>);
PollingConsumer consumer = endpoint.createPollingConsumer();
Exchange exchange = consumer.receive();
</pre>
</div></div>

<p>Notice in Camel 2.0 we have introduced the <tt>ConsumerTemplate</tt>.</p>

<p>There are 3 main polling methods on <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/PollingConsumer.html"
class="external-link" rel="nofollow">PollingConsumer</a></p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Method name </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/PollingConsumer.html#receive()"
class="external-link" rel="nofollow">receive()</a> </td>
<td class='confluenceTd'> Waits until a message is available and then returns it; potentially
blocking forever </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/PollingConsumer.html#receive(long)"
class="external-link" rel="nofollow">receive(long)</a> </td>
<td class='confluenceTd'> Attempts to receive a message exchange, waiting up to the
given timeout and returning null if no message exchange could be received within the time
available </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/PollingConsumer.html#receiveNoWait()"
class="external-link" rel="nofollow">receiveNoWait()</a> </td>
<td class='confluenceTd'> Attempts to receive a message exchange immediately without
waiting and returning null if a message exchange is not available yet </td>
</tr>
</tbody></table>
</div>


<h3><a name="PollingConsumer-ConsumerTemplate"></a>ConsumerTemplate</h3>
<p><b>Available as of Camel 2.0</b></p>

<p>The <tt>ConsumerTemplate</tt> is a template much like Spring's JmsTemplate
or JdbcTemplate supporting the <a href="/confluence/display/CAMEL/Polling+Consumer" title="Polling
Consumer">Polling Consumer</a> EIP. With the template you can consume <a href="/confluence/display/CAMEL/Exchange"
title="Exchange">Exchange</a>s from an <a href="/confluence/display/CAMEL/Endpoint"
title="Endpoint">Endpoint</a>.</p>

<p>The template supports the 3 operations above, but also including convenient methods
for returning the body, etc <tt>consumeBody</tt>.<br/>
The example from above using ConsumerTemplate is:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
Exchange exchange = consumerTemplate.receive(<span class="code-quote">"activemq:my.queue"</span>);
</pre>
</div></div>
<p>Or to extract and get the body you can do:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-object">Object</span> body = consumerTemplate.receiveBody(<span
class="code-quote">"activemq:my.queue"</span>);
</pre>
</div></div>
<p>And you can provide the body type as a parameter and have it returned as the type:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-object">String</span> body = consumerTemplate.receiveBody(<span
class="code-quote">"activemq:my.queue"</span>, <span class="code-object">String</span>.class);
</pre>
</div></div>
<p>You get hold of a <tt>ConsumerTemplate</tt> from the <tt>CamelContext</tt>
with the <tt>createConsumerTemplate</tt> operation:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
ConsumerTemplate consumer = context.createConsumerTemplate();
</pre>
</div></div>

<h4><a name="PollingConsumer-UsingConsumerTemplatewithSpringDSL"></a>Using
ConsumerTemplate with Spring DSL</h4>
<p>With the Spring DSL we can declare the consumer in the CamelContext with the <b>consumerTemplate</b>
tag, just like the ProducerTemplate. The example below illustrates this:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;camelContext xmlns=<span
class="code-quote">"http://camel.apache.org/schema/spring"</span>&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- define a producer
template --&gt;</span></span>
    <span class="code-tag">&lt;template id=<span class="code-quote">"producer"</span>/&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- define a consumer
template --&gt;</span></span>
    <span class="code-tag">&lt;consumerTemplate id=<span class="code-quote">"consumer"</span>/&gt;</span>
    
    <span class="code-tag">&lt;route&gt;</span>
        <span class="code-tag">&lt;from uri=<span class="code-quote">"seda:foo"</span>/&gt;</span>
        <span class="code-tag">&lt;to id=<span class="code-quote">"result"</span>
uri=<span class="code-quote">"mock:result"</span>/&gt;</span>
    <span class="code-tag">&lt;/route&gt;</span>
<span class="code-tag">&lt;/camelContext&gt;</span>
</pre>
</div></div>

<p>Then we can get leverage Spring to inject the <tt>ConsumerTemplate</tt>
in our java class. The code below is part of an unit test but it shows how the consumer and
producer can work together. </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">@ContextConfiguration
<span class="code-keyword">public</span> class SpringConsumerTemplateTest <span
class="code-keyword">extends</span> AbstractJUnit38SpringContextTests {

    @Autowired
    <span class="code-keyword">private</span> ProducerTemplate producer;

    @Autowired
    <span class="code-keyword">private</span> ConsumerTemplate consumer;

    @EndpointInject(ref = <span class="code-quote">"result"</span>)
    <span class="code-keyword">private</span> MockEndpoint mock;

    <span class="code-keyword">public</span> void testConsumeTemplate() <span
class="code-keyword">throws</span> Exception {
        <span class="code-comment">// we expect Hello World received in our mock endpoint
</span>        mock.expectedBodiesReceived(<span class="code-quote">"Hello World"</span>);

        <span class="code-comment">// we use the producer template to send a message
to the seda:start endpoint
</span>        producer.sendBody(<span class="code-quote">"seda:start"</span>,
<span class="code-quote">"Hello World"</span>);

        <span class="code-comment">// we consume the body from seda:start
</span>        <span class="code-object">String</span> body = consumer.receiveBody(<span
class="code-quote">"seda:start"</span>, <span class="code-object">String</span>.class);
        assertEquals(<span class="code-quote">"Hello World"</span>, body);

        <span class="code-comment">// and then we send the body again to seda:foo so
it will be routed to the mock
</span>        <span class="code-comment">// endpoint so our unit test can complete
</span>        producer.sendBody(<span class="code-quote">"seda:foo"</span>,
body);

        <span class="code-comment">// <span class="code-keyword">assert</span>
mock received the body
</span>        mock.assertIsSatisfied();
    }

}
</pre>
</div></div>

<h4><a name="PollingConsumer-Timerbasedpollingconsumer"></a>Timer based
polling consumer</h4>
<p>In this sample we use a <a href="/confluence/display/CAMEL/Timer" title="Timer">Timer</a>
to schedule a route to be started every 5th second and invoke our bean <b>MyCoolBean</b>
where we implement the business logic for the <a href="/confluence/display/CAMEL/Polling+Consumer"
title="Polling Consumer">Polling Consumer</a>. Here we want to consume all messages
from a JMS queue, process the message and send them to the next queue.</p>

<p>First we setup our route as:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">MyCoolBean cool = <span class="code-keyword">new</span>
MyCoolBean();
cool.setProducer(template);
cool.setConsumer(consumer);

from(<span class="code-quote">"timer:<span class="code-comment">//foo?period=5000"</span>).bean(cool,
<span class="code-quote">"someBusinessLogic"</span>);
</span>
from(<span class="code-quote">"activemq:queue.foo"</span>).to(<span class="code-quote">"mock:result"</span>);
</pre>
</div></div>

<p>And then we have out logic in our bean:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"><span class="code-keyword">public</span> <span
class="code-keyword">static</span> class MyCoolBean {

    <span class="code-keyword">private</span> <span class="code-object">int</span>
count;
    <span class="code-keyword">private</span> ConsumerTemplate consumer;
    <span class="code-keyword">private</span> ProducerTemplate producer;

    <span class="code-keyword">public</span> void setConsumer(ConsumerTemplate
consumer) {
        <span class="code-keyword">this</span>.consumer = consumer;
    }

    <span class="code-keyword">public</span> void setProducer(ProducerTemplate
producer) {
        <span class="code-keyword">this</span>.producer = producer;
    }

    <span class="code-keyword">public</span> void someBusinessLogic() {
        <span class="code-comment">// loop to empty queue
</span>        <span class="code-keyword">while</span> (<span class="code-keyword">true</span>)
{
            <span class="code-comment">// receive the message from the queue, wait at
most 3 sec
</span>            <span class="code-object">String</span> msg = consumer.receiveBody(<span
class="code-quote">"activemq:queue.inbox"</span>, 3000, <span class="code-object">String</span>.class);
            <span class="code-keyword">if</span> (msg == <span class="code-keyword">null</span>)
{
                <span class="code-comment">// no more messages in queue
</span>                <span class="code-keyword">break</span>;
            }

            <span class="code-comment">// <span class="code-keyword">do</span>
something with body
</span>            msg = <span class="code-quote">"Hello "</span> + msg;

            <span class="code-comment">// send it to the next queue
</span>            producer.sendBodyAndHeader(<span class="code-quote">"activemq:queue.foo"</span>,
msg, <span class="code-quote">"number"</span>, count++);
        }
    }
}
</pre>
</div></div>


<h3><a name="PollingConsumer-ScheduledPollComponents"></a>Scheduled Poll
Components</h3>

<p>Quite a few inbound Camel endpoints use a scheduled poll pattern to receive messages
and push them through the Camel processing routes. That is to say externally from the client
the endpoint appears to use an <a href="/confluence/display/CAMEL/Event+Driven+Consumer"
title="Event Driven Consumer">Event Driven Consumer</a> but internally a scheduled
poll is used to monitor some kind of state or resource and then fire message exchanges. </p>

<p>Since this a such a common pattern, polling components can extend the <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/impl/ScheduledPollConsumer.html"
class="external-link" rel="nofollow">ScheduledPollConsumer</a> base class which makes
it simpler to implement this pattern.</p>

<p>There is also the <a href="/confluence/display/CAMEL/Quartz" title="Quartz">Quartz
Component</a> which provides scheduled delivery of messages using the Quartz enterprise
scheduler.</p>

<p>For more details see:</p>

<ul>
	<li><a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/PollingConsumer.html"
class="external-link" rel="nofollow">PollingConsumer</a></li>
	<li>Scheduled Polling Components
	<ul>
		<li><a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/impl/ScheduledPollConsumer.html"
class="external-link" rel="nofollow">ScheduledPollConsumer</a></li>
		<li><a href="/confluence/display/CAMEL/Atom" title="Atom">Atom</a></li>
		<li><a href="/confluence/display/CAMEL/File2" title="File2">File</a></li>
		<li><a href="/confluence/display/CAMEL/FTP2" title="FTP2">FTP</a></li>
		<li><a href="/confluence/display/CAMEL/iBATIS" title="iBATIS">iBATIS</a></li>
		<li><a href="/confluence/display/CAMEL/JPA" title="JPA">JPA</a></li>
		<li><a href="/confluence/display/CAMEL/Mail" title="Mail">Mail</a></li>
		<li><a href="/confluence/display/CAMEL/Quartz" title="Quartz">Quartz</a></li>
		<li><a href="/confluence/display/CAMEL/SNMP" title="SNMP">SNMP</a></li>
		<li><a href="/confluence/display/CAMEL/sqs" title="sqs">sqs</a></li>
	</ul>
	</li>
</ul>


<h3><a name="PollingConsumer-ScheduledPollConsumerOptions"></a>ScheduledPollConsumer
Options</h3>
<p>The ScheduledPollConsumer supports the following options:</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Option </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> pollStrategy </td>
<td class='confluenceTd'> <b>Camel 2.0:</b> A pluggable <tt>org.apache.camel.PollingConsumerPollStrategy</tt>
allowing you to provide your custom implementation to control error handling usually occurred
during the <tt>poll</tt> operation <b>before</b> an <a href="/confluence/display/CAMEL/Exchange"
title="Exchange">Exchange</a> have been created and being routed in Camel. In other
words the error occurred while the polling was gathering information, for instance access
to a file network failed so Camel cannot access it to scan for files. The default implementation
will log the caused exception at <tt>WARN</tt> level and ignore it. </td>
</tr>
</tbody></table>
</div>



<h3><a name="PollingConsumer-Abouterrorhandlingandscheduledpollingconsumers"></a>About
error handling and scheduled polling consumers</h3>
<p><a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/impl/ScheduledPollConsumer.html"
class="external-link" rel="nofollow">ScheduledPollConsumer</a> is scheduled based
and its <tt>run</tt> method is invoked periodically based on schedule settings.
But errors can also occur when a poll being executed. For instance if Camel should poll a
file network, and this network resource is not available then a <tt>java.io.IOException</tt>
could occur. As this error happens <b>before</b> any <a href="/confluence/display/CAMEL/Exchange"
title="Exchange">Exchange</a> has been created and prepared for routing, then the
regular <a href="/confluence/display/CAMEL/Error+handling+in+Camel" title="Error handling
in Camel">Error handling in Camel</a> does not apply. So what does the consumer do
then? Well the exception is propagated back to the <tt>run</tt> method where its
handled. Camel will by default log the exception at <tt>WARN</tt> level and then
ignore it. At next schedule the error could have been resolved and thus being able to poll
the endpoint successfully.</p>

<h4><a name="PollingConsumer-ControllingtheerrorhandlingusingPollingConsumerPollStrategy"></a>Controlling
the error handling using PollingConsumerPollStrategy</h4>
<p><b>Available as of Camel 2.0</b><br/>
<tt>org.apache.camel.PollingConsumerPollStrategy</tt> is a pluggable strategy
that you can configure on the <tt>ScheduledPollConsumer</tt>. The default implementation
<tt>org.apache.camel.impl.DefaultPollingConsumerPollStrategy</tt> will log the
caused exception at <tt>WARN</tt> level and then ignore this issue.</p>

<p>The strategy interface provides the following 3 methods</p>
<ul class="alternate" type="square">
	<li>begin
	<ul class="alternate" type="square">
		<li><tt>void begin(Consumer consumer, Endpoint endpoint)</tt></li>
	</ul>
	</li>
	<li>begin (<b>Camel 2.3</b>)
	<ul class="alternate" type="square">
		<li><tt>boolean begin(Consumer consumer, Endpoint endpoint)</tt></li>
	</ul>
	</li>
	<li>commit
	<ul class="alternate" type="square">
		<li><tt>void commit(Consumer consumer, Endpoint endpoint)</tt></li>
	</ul>
	</li>
	<li>commit (<b>Camel 2.6</b>)
	<ul class="alternate" type="square">
		<li><tt>void commit(Consumer consumer, Endpoint endpoint, int polledMessages)</tt></li>
	</ul>
	</li>
	<li>rollback
	<ul class="alternate" type="square">
		<li><tt>boolean rollback(Consumer consumer, Endpoint endpoint, int retryCounter,
Exception e) throws Exception</tt></li>
	</ul>
	</li>
</ul>


<p>In <b>Camel 2.3</b> onwards the begin method returns a boolean which
indicates whether or not to skipping polling. So you can implement your custom logic and return
<tt>false</tt> if you do not want to poll this time.</p>

<p>In <b>Camel 2.6</b> onwards the commit method has an additional parameter
containing the number of message that was actually polled. For example if there was no messages
polled, the value would be zero, and you can react accordingly.</p>

<p>The most interesting is the <tt>rollback</tt> as it allows you do handle
the caused exception and decide what to do. </p>

<p>For instance if we want to provide a retry feature to a scheduled consumer we can
implement the <tt>PollingConsumerPollStrategy</tt> method and put the retry logic
in the <tt>rollback</tt> method. Lets just retry up till 3 times:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
    <span class="code-keyword">public</span> <span class="code-object">boolean</span>
rollback(Consumer consumer, Endpoint endpoint, <span class="code-object">int</span>
retryCounter, Exception e) <span class="code-keyword">throws</span> Exception
{
        <span class="code-keyword">if</span> (retryCounter &lt; 3) {
            <span class="code-comment">// <span class="code-keyword">return</span>
<span class="code-keyword">true</span> to tell Camel that it should retry the
poll immediately
</span>            <span class="code-keyword">return</span> <span class="code-keyword">true</span>;
        }
        <span class="code-comment">// okay we give up <span class="code-keyword">do</span>
not retry anymore
</span>        <span class="code-keyword">return</span> <span class="code-keyword">false</span>;
    }
</pre>
</div></div>

<p>Notice that we are given the <tt>Consumer</tt> as a parameter. We could
use this to <em>restart</em> the consumer as we can invoke stop and start:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
    <span class="code-comment">// error occurred lets restart the consumer, that could
maybe resolve the issue
</span>    consumer.stop();
    consumer.start();
</pre>
</div></div>

<p><b>Notice:</b> If you implement the <tt>begin</tt> operation
make sure to avoid throwing exceptions as in such a case the <tt>poll</tt> operation
is not invoked and Camel will invoke the <tt>rollback</tt> directly.</p>

<h4><a name="PollingConsumer-ConfiguringanEndpointtouse%7B%7BPollingConsumerPollStrategy%7D%7D"></a>Configuring
an <a href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a>
to use <tt>PollingConsumerPollStrategy</tt></h4>
<p>To configure an <a href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a>
to use a custom <tt>PollingConsumerPollStrategy</tt> you use the option <tt>pollStrategy</tt>.
For example in the file consumer below we want to use our custom strategy defined in the <a
href="/confluence/display/CAMEL/Registry" title="Registry">Registry</a> with the
bean id <tt>myPoll</tt>:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
    from(<span class="code-quote">"file:<span class="code-comment">//inbox/?pollStrategy=#myPoll"</span>).to(<span
class="code-quote">"activemq:queue:inbox"</span>)</span>
</pre>
</div></div>

<h4><a name="PollingConsumer-UsingThisPattern"></a>Using This Pattern</h4>

<p>If you would like to use this EIP Pattern then please read the <a href="/confluence/display/CAMEL/Getting+Started"
title="Getting Started">Getting Started</a>, you may also find the <a href="/confluence/display/CAMEL/Architecture"
title="Architecture">Architecture</a> useful particularly the description of <a
href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a> and <a
href="/confluence/display/CAMEL/URIs" title="URIs">URIs</a>. Then you could try out
some of the <a href="/confluence/display/CAMEL/Examples" title="Examples">Examples</a>
first before trying this pattern out.</p>

<h3><a name="PollingConsumer-SeeAlso"></a>See Also</h3>
<ul class="alternate" type="square">
	<li><a href="/confluence/display/CAMEL/POJO+Consuming" title="POJO Consuming">POJO
Consuming</a></li>
	<li><a href="/confluence/display/CAMEL/Batch+Consumer" title="Batch Consumer">Batch
Consumer</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/Polling+Consumer">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=52977&revisedVersion=21&originalVersion=20">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Polling+Consumer?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message