Author: buildbot Date: Thu Mar 5 07:18:05 2015 New Revision: 942395 Log: Production update by buildbot for camel
Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/scheduler.html Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/scheduler.html ============================================================================== --- websites/production/camel/content/scheduler.html (original) +++ websites/production/camel/content/scheduler.html Thu Mar 5 07:18:05 2015 @@ -88,7 +88,7 @@ <div class="wiki-content maincontent"><h2 id="Scheduler-SchedulerComponent">Scheduler Component</h2><p><strong>Available as of Camel 2.15</strong></p><p>The <strong>scheduler:</strong> component is used to generate message exchanges when a scheduler fires. This component is similar to the  <a shape="rect" href="timer.html">Timer</a> component, but it offers more functionality in terms of scheduling. Also this component uses JDK <code>ScheduledExecutorService</code>. Where as the timer uses a JDK <code>Timer</code>.</p><p>You can only consume events from this endpoint.</p><h3 id="Scheduler-URIformat">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[scheduler:name[?options] ]]></script> -</div></div><p>Where <code>name</code> is the name of the scheduler, which is created and shared across endpoints. So if you use the same name for all your timer endpoints, only one scheduler thread pool and thread will be used - but you can configure the thread pool to allow more concurrent threads.</p><p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p><p><strong>Note:</strong> The IN body of the generated exchange is <code>null</code>. So <code>exchange.getIn().getBody()</code> returns <code>null</code>.</p><h3 id="Scheduler-Options">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceT d">initialDelay</td><td colspan="1" rowspan="1" class="confluenceTd">1000</td><td colspan="1" rowspan="1" class="confluenceTd">Milliseconds before the first poll starts</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>period</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>1000</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If greater than 0, generate periodic events every <code>period</code> milliseconds.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>delay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>500</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Milliseconds before the next poll</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span style="font-family: monospace;">timeUnit</span></p></td><td colspan="1" rowspan="1" class="confluenceTd">MILLISECONDS</td><td colspan="1" rowspan="1" class="confluenceTd"><span style="col or: rgb(0,0,0);">time unit for </span><code>initialDelay</code><span style="color: rgb(0,0,0);"> and </span><code>delay</code><span style="color: rgb(0,0,0);"> options.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">useFixedDelay</td><td colspan="1" rowspan="1" class="confluenceTd">true</td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">Controls if fixed delay or fixed rate is used. See </span><a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html" rel="nofollow">ScheduledExecutorService</a><span style="color: rgb(0,0,0);"> in JDK for details.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">pollStrategy</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">A pluggable </span><code>org.apache.camel.Polli ngConsumerPollingStrategy</code><span style="color: rgb(0,0,0);"> allowing you to provide your custom implementation to control error handling usually occurred during the </span><code>poll</code><span style="color: rgb(0,0,0);"> operation </span><strong>before</strong><span style="color: rgb(0,0,0);"> an </span><a shape="rect" class="external-link" href="http://camel.apache.org/exchange.html">Exchange</a><span style="color: rgb(0,0,0);"> 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 </span><code>WARN</code><span style="color: rgb(0,0,0);"> level and ignore it.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">runLoggingLevel</td><td colspan="1" rowspan="1" class="confluenceTd">TRACE</td><td colsp an="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">sendEmptyMessageWhenIdle</td><td colspan="1" rowspan="1" class="confluenceTd">false</td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">greedy</td><td colspan="1" rowspan="1" class="confluenceTd">false</td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">scheduler</td><td colspan ="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">Allow to plugin a custom </span><code>org.apache.camel.spi.ScheduledPollConsumerScheduler</code><span style="color: rgb(0,0,0);"> to use as the scheduler for firing when the polling consumer runs. The default implementation uses the</span><code>ScheduledExecutorService</code><span style="color: rgb(0,0,0);"> and there is a </span><a shape="rect" class="external-link" href="http://camel.apache.org/quartz2.html">Quartz2</a><span style="color: rgb(0,0,0);">, and </span><a shape="rect" class="external-link" href="http://camel.apache.org/spring.html">Spring</a><span style="color: rgb(0,0,0);"> based which supports CRON expressions. </span><strong>Notice:</strong><span style="color: rgb(0,0,0);"> If using a custom scheduler then the options for </span><code>initialDelay</code><span style="color: rgb(0,0,0);">,  </span><code>useFixedDelay</code><span style="color: rgb(0,0,0);">, </span><code>timeUnit</code><span style="color: rgb(0,0,0);">, and</span><code>scheduledExecutorService</code><span style="color: rgb(0,0,0);"> may not be in use. Use the text </span><code>quartz2</code><span style="color: rgb(0,0,0);"> to refer to use the </span><a shape="rect" class="external-link" href="http://camel.apache.org/quartz2.html">Quartz2</a><span style="color: rgb(0,0,0);"> scheduler; and use the text </span><code>spring</code><span style="color: rgb(0,0,0);"> to use the </span><a shape="rect" class="external-link" href="http://camel.apache.org/spring.html">Spring</a><span style="color: rgb(0,0,0);"> based; and use the text </span><code>#myScheduler</code><span style="color: rgb(0,0,0);"> to refer to a custom scheduler by its id in the </span><a shape="rect" class="external-link" href="http://camel.apache.org/registry.html">Registry</a><s pan style="color: rgb(0,0,0);">. See </span><a shape="rect" class="external-link" href="http://camel.apache.org/quartz2.html">Quartz2</a><span style="color: rgb(0,0,0);"> page for an example.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">schedulerProperties.xxx</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">To configure additional properties when using a custom </span><code>scheduler</code><span style="color: rgb(0,0,0);"> or any of the </span><a shape="rect" class="external-link" href="http://camel.apache.org/quartz2.html">Quartz2</a><span style="color: rgb(0,0,0);">, </span><a shape="rect" class="external-link" href="http://camel.apache.org/spring.html">Spring</a> <span style="color: rgb(0,0,0);">based scheduler.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">backoffMultiplier</td><td colspan="1" rowspan="1" c lass="confluenceTd">0</td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then </span><code>backoffIdleThreshold</code><span style="color: rgb(0,0,0);"> and/or </span><code>backoffErrorThreshold</code><span style="color: rgb(0,0,0);"> must also be configured.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">backoffIdleThreshold</td><td colspan="1" rowspan="1" class="confluenceTd">0</td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">The number of subsequent idle polls that should happen before the </span><code>backoffMultipler</code><span style="color: rgb(0,0,0);"> should kick-in</span></td></tr><tr><td colspan="1" row span="1" class="confluenceTd">backoffErrorThreshold</td><td colspan="1" rowspan="1" class="confluenceTd">0</td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">The number of subsequent error polls (failed due some error) that should happen before the </span><code>backoffMultipler</code><span style="color: rgb(0,0,0);"> should kick-in.</span></td></tr></tbody></table></div></div><h3 id="Scheduler-Moreinformation">More information</h3><p>This component is a scheduler <a shape="rect" class="external-link" href="http://camel.apache.org/polling-consumer.html" style="line-height: 1.4285715;">Polling Consumer</a> where you can find more information about the options above, and examples at the <a shape="rect" class="external-link" href="http://camel.apache.org/polling-consumer.html">Polling Consumer</a> page.</p><h3 id="Scheduler-ExchangeProperties">Exchange Properties</h3><p>When the timer is fired, it adds the following information as proper ties to the <code>Exchange</code>:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Exchange.TIMER_NAME</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The value of the <code>name</code> option.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Exchange.TIMER_FIRED_TIME</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Date</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The time when the consumer fired.</p></td></tr></tbody></table></div></div><p> </p><h3 id="Scheduler-Sample">Sample</h3><p>To set up a route that generates an event every 60 seconds:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Where <code>name</code> is the name of the scheduler, which is created and shared across endpoints. So if you use the same name for all your timer endpoints, only one scheduler thread pool and thread will be used - but you can configure the thread pool to allow more concurrent threads.</p><p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p><p><strong>Note:</strong> The IN body of the generated exchange is <code>null</code>. So <code>exchange.getIn().getBody()</code> returns <code>null</code>.</p><h3 id="Scheduler-Options">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceT d"><code>initialDelay</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>1000</code></td><td colspan="1" rowspan="1" class="confluenceTd">Milliseconds before the first poll starts</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>period</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>1000</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If greater than 0, generate periodic events every <code>period</code> milliseconds.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>delay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>500</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Milliseconds before the next poll</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span style="font-family: monospace;">timeUnit</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>MILLISECONDS</code></td><td colspan="1" rowspan="1 " class="confluenceTd"><span style="color: rgb(0,0,0);">time unit for </span><code>initialDelay</code><span style="color: rgb(0,0,0);"> and </span><code>delay</code><span style="color: rgb(0,0,0);"> options.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>useFixedDelay</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>true</code></td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">Controls if fixed delay or fixed rate is used. See </span><a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html" rel="nofollow">ScheduledExecutorService</a><span style="color: rgb(0,0,0);"> in JDK for details.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>pollStrategy</code></td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><span s tyle="color: rgb(0,0,0);">A pluggable </span><code>org.apache.camel.PollingConsumerPollingStrategy</code><span style="color: rgb(0,0,0);"> allowing you to provide your custom implementation to control error handling usually occurred during the </span><code>poll</code><span style="color: rgb(0,0,0);"> operation </span><strong>before</strong><span style="color: rgb(0,0,0);"> an </span><a shape="rect" class="external-link" href="http://camel.apache.org/exchange.html">Exchange</a><span style="color: rgb(0,0,0);"> 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 </span><code>WARN</code><span style="color: rgb(0,0,0);"> level and ignore it.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>runL oggingLevel</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>TRACE</code></td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>sendEmptyMessageWhenIdle</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>greedy</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">If greedy is enabled, then the ScheduledPollConsumer will run imme diately again, if the previous run polled 1 or more messages.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>scheduler</code></td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">Allow to plugin a custom </span><code>org.apache.camel.spi.ScheduledPollConsumerScheduler</code><span style="color: rgb(0,0,0);"> to use as the scheduler for firing when the polling consumer runs. The default implementation uses the</span><code>ScheduledExecutorService</code><span style="color: rgb(0,0,0);"> and there is a </span><a shape="rect" class="external-link" href="http://camel.apache.org/quartz2.html">Quartz2</a><span style="color: rgb(0,0,0);">, and </span><a shape="rect" class="external-link" href="http://camel.apache.org/spring.html">Spring</a><span style="color: rgb(0,0,0);"> based which supports CRON expressions. </span><strong>Notice:</str ong><span style="color: rgb(0,0,0);"> If using a custom scheduler then the options for </span><code>initialDelay</code><span style="color: rgb(0,0,0);">, </span><code>useFixedDelay</code><span style="color: rgb(0,0,0);">, </span><code>timeUnit</code><span style="color: rgb(0,0,0);">, and</span><code>scheduledExecutorService</code><span style="color: rgb(0,0,0);"> may not be in use. Use the text </span><code>quartz2</code><span style="color: rgb(0,0,0);"> to refer to use the </span><a shape="rect" class="external-link" href="http://camel.apache.org/quartz2.html">Quartz2</a><span style="color: rgb(0,0,0);"> scheduler; and use the text </span><code>spring</code><span style="color: rgb(0,0,0);"> to use the </span><a shape="rect" class="external-link" href="http://camel.apache.org/spring.html">Spring</a><span style="color: rgb(0,0,0);"> based; and use the text </span><code>#myScheduler</code><span style="color: rgb(0,0 ,0);"> to refer to a custom scheduler by its id in the </span><a shape="rect" class="external-link" href="http://camel.apache.org/registry.html">Registry</a><span style="color: rgb(0,0,0);">. See </span><a shape="rect" class="external-link" href="http://camel.apache.org/quartz2.html">Quartz2</a><span style="color: rgb(0,0,0);"> page for an example.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>schedulerProperties.xxx</code></td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">To configure additional properties when using a custom </span><code>scheduler</code><span style="color: rgb(0,0,0);"> or any of the </span><a shape="rect" class="external-link" href="http://camel.apache.org/quartz2.html">Quartz2</a><span style="color: rgb(0,0,0);">, </span><a shape="rect" class="external-link" href="http://camel.apache.org/spring.html" >Spring</a> <span style="color: rgb(0,0,0);">based >scheduler.</span></td></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><code>backoffMultiplier</code></td><td colspan="1" >rowspan="1" class="confluenceTd"><code>0</code></td><td colspan="1" >rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">To let the >scheduled polling consumer backoff if there has been a number of subsequent >idles/errors in a row. The multiplier is then the number of polls that will >be skipped before the next actual attempt is happening again. When this >option is in use then </span><code>backoffIdleThreshold</code><span >style="color: >rgb(0,0,0);"> and/or </span><code>backoffErrorThreshold</code><span >style="color: rgb(0,0,0);"> must also be >configured.</span></td></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><code>backoffIdleThreshold</code></td><td colspan="1" >rowspan="1" class="confluenceTd"><code>0</code></td><td colspan="1" >rowspan="1" class="confluenceTd" ><span style="color: rgb(0,0,0);">The number of subsequent idle polls that >should happen before the </span><code>backoffMultipler</code><span >style="color: rgb(0,0,0);"> should kick-in</span></td></tr><tr><td >colspan="1" rowspan="1" >class="confluenceTd"><code>backoffErrorThreshold</code></td><td colspan="1" >rowspan="1" class="confluenceTd"><code>0</code></td><td colspan="1" >rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">The number >of subsequent error polls (failed due some error) that should happen before >the </span><code>backoffMultipler</code><span style="color: >rgb(0,0,0);"> should >kick-in.</span></td></tr></tbody></table></div></div><h3 >id="Scheduler-Moreinformation">More information</h3><p>This component is a >scheduler <a shape="rect" class="external-link" >href="http://camel.apache.org/polling-consumer.html" style="line-height: >1.4285715;">Polling Consumer</a> where you can find more information >about the options above, and examples at the <a shape="rect" class="external-link" href="http://camel.apache.org/polling-consumer.html">Polling Consumer</a> page.</p><h3 id="Scheduler-ExchangeProperties">Exchange Properties</h3><p>When the timer is fired, it adds the following information as properties to the <code>Exchange</code>:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Exchange.TIMER_NAME</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The value of the <code>name</code> option.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Exchange.TIMER_FIRED_TIME</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Date</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The time when the consumer fired.</p></td></tr></tbody></table></div></div><p> </p><h3 id="Scheduler-Sample">Sample</h3><p>To set up a route that generates an event every 60 seconds:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("scheduler://foo?period=60s").to("bean:myBean?method=someMethodName"); ]]></script> </div></div><p> </p><p>The above route will generate an event and then invoke the <code>someMethodName</code> method on the bean called <code>myBean</code> in the <a shape="rect" href="registry.html">Registry</a> such as JNDI or <a shape="rect" href="spring.html">Spring</a>.</p><p>And the route in Spring DSL:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">