Author: buildbot Date: Mon Apr 27 07:20:02 2015 New Revision: 949317 Log: Production update by buildbot for camel
Modified: websites/production/camel/content/apns.html websites/production/camel/content/cache/main.pageCache Modified: websites/production/camel/content/apns.html ============================================================================== --- websites/production/camel/content/apns.html (original) +++ websites/production/camel/content/apns.html Mon Apr 27 07:20:02 2015 @@ -85,82 +85,22 @@ <tbody> <tr> <td valign="top" width="100%"> -<div class="wiki-content maincontent"><h2 id="APNS-ApnsComponent">Apns Component</h2> -<p><strong>Available as of Camel 2.8</strong></p> - -<p>The <strong>apns</strong> component is used for sending notifications to iOS devices. The apns components use <a shape="rect" class="external-link" href="https://github.com/notnoop/java-apns" rel="nofollow">javapns</a> library.<br clear="none"> -The component supports sending notifications to Apple Push Notification Servers (APNS) and consuming feedback from the servers.</p> - -<p>The consumer is configured with 3600 seconds for polling by default because it is a best practice to consume feedback stream from Apple Push Notification Servers only from time to time. For example: every 1 hour to avoid flooding the servers.</p> - -<p>The feedback stream gives informations about inactive devices. You only need to get this informations every some hours if your mobile application is not a heavily used one.</p> - -<p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ -<dependency> +<div class="wiki-content maincontent"><h2 id="APNS-ApnsComponent">Apns Component</h2><p><strong>Available as of Camel 2.8</strong></p><p>The <strong>apns</strong> component is used for sending notifications to iOS devices. The apns components use <a shape="rect" class="external-link" href="https://github.com/notnoop/java-apns" rel="nofollow">javapns</a> library.<br clear="none"> The component supports sending notifications to Apple Push Notification Servers (APNS) and consuming feedback from the servers.</p><p>The consumer is configured with 3600 seconds for polling by default because it is a best practice to consume feedback stream from Apple Push Notification Servers only from time to time. For example: every 1 hour to avoid flooding the servers.</p><p>The feedback stream gives informations about inactive devices. You only need to get this informations every some hours if your mobile application is not a heavily used one.</p><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-apns</artifactId> <version>x.x.x</version> <!-- use the same version as your Camel core version --> </dependency> ]]></script> -</div></div> - -<h3 id="APNS-URIformat">URI format</h3> - -<p>To send notifications:</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[ -apns:notify[?options] +</div></div><h3 id="APNS-URIformat">URI format</h3><p>To send notifications:</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[apns:notify[?options] ]]></script> -</div></div> - -<p>To consume feedback:</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[ -apns:consumer[?options] +</div></div><p>To consume feedback:</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[apns:consumer[?options] ]]></script> -</div></div> - -<h3 id="APNS-Options">Options</h3> - -<h4 id="APNS-Producer">Producer</h4> - -<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Property </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>tokens</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <br clear="none" class="atl-forced-newline"> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Empty by default. Configure this property in case you want to statically declare tokens related to devices you want to notify. Tokens are separated by comma. </p></td></tr></tbody></table></div> - - -<h4 id="APNS-Consumer">Consumer</h4> - -<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Property </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>delay</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>3600</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Delay in seconds between each poll. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>initialDelay</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>10</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Seconds before polling starts. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>timeUnit</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>SECONDS</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Time Unit for polling. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>userFixedDelay</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>true</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> If <code>true</code>, use fixed delay between pools, otherwise fixed rate is used. See <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> in JDK for details. </p></td></tr></tbody></table></div> - - -<p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p> - -<h4 id="APNS-Component">Component</h4> - -<p>The <code>ApnsComponent</code> must be configured with a <code>com.notnoop.apns.ApnsService</code>. The service can be created and configured using the <code>org.apache.camel.component.apns.factory.ApnsServiceFactory</code>. See further below for an example. And as well in the <a shape="rect" class="external-link" href="https://svn.apache.org/repos/asf/camel/trunk/components/camel-apns/">test source code</a>.</p> - -<h3 id="APNS-Exchangedataformat">Exchange data format</h3> - -<p>When Camel will fetch feedback data corresponding to inactive devices, it will retrieve a List of InactiveDevice objects. Each InactiveDevice object of the retrieved list will be setted as the In body, and then processed by the consumer endpoint.</p> - - -<h3 id="APNS-MessageHeaders">Message Headers</h3> - -<p>Camel Apns uses these headers.</p> -<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Property </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CamelApnsTokens</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Empty by default. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CamelApnsMessageType</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>STRING, PAYLOAD</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> In case you choose PAYLOAD for the message type, then the message will be considered as a APNS payload and sent as is. In case you choose STRING, message will be converted as a APNS payload </p></td></tr></tbody></table> </div> - - -<h3 id="APNS-Samples">Samples</h3> - -<h4 id="APNS-CamelXmlroute">Camel Xml route</h4> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ -<beans xmlns="http://www.springframework.org/schema/beans" +</div></div><h3 id="APNS-Options">Options</h3><h4 id="APNS-Producer">Producer</h4><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Property</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>tokens</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Empty by default. Configure this property in case you want to statically declare tokens related to devices you want to notify. Tokens are separated by comma.</p></td></tr></tbody></table></div><h4 id="APNS-Consumer">Consumer</h4><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Property</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th> <th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>delay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>3600</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Delay in seconds between each poll.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>initialDelay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>10</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Seconds before polling starts.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>timeUnit</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>SECONDS</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Time Unit for polling.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>userFixedDelay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"> <p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If <code>true</code>, use fixed delay between pools, otherwise fixed rate is used. See <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> in JDK for details.</p></td></tr></tbody></table></div><p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p><h4 id="APNS-Component">Component</h4><p>The <code>ApnsComponent</code> must be configured with a <code>com.notnoop.apns.ApnsService</code>. The service can be created and configured using the <code>org.apache.camel.component.apns.factory.ApnsServiceFactory</code>. See further below for an example. And as well in the <a shape="rect" class="external-link" href="https://svn.apache.org/repos/asf/camel/trunk/components/camel-apns/">test source code</a>.</p><h3 id="APNS-E xchangedataformat">Exchange data format</h3><p>When Camel will fetch feedback data corresponding to inactive devices, it will retrieve a List of InactiveDevice objects. Each InactiveDevice object of the retrieved list will be setted as the In body, and then processed by the consumer endpoint.</p><h3 id="APNS-MessageHeaders">Message Headers</h3><p>Camel Apns uses these headers.</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Property</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelApnsTokens</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Empty by default.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelApnsMessageType</code></ p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>STRING, PAYLOAD, APNS_NOTIFICATION</code><span style="line-height: 1.4285715;"> </span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>In case you choose PAYLOAD for the message type, then the message will be considered as a APNS payload and sent as is. In case you choose STRING, message will be converted as a APNS payload. From <strong>Camel 2.16</strong> onwards APNS_NOTIFICATION is used for sending message body as com.notnoop.apns.ApnsNotification types.</p></td></tr></tbody></table></div><h3 id="APNS-Samples">Samples</h3><h4 id="APNS-CamelXmlroute">Camel Xml route</h4><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring" xsi:schemaLocation=" @@ -211,16 +151,8 @@ apns:consumer[?options] </beans> ]]></script> -</div></div> - - -<h4 id="APNS-CamelJavaroute">Camel Java route</h4> - -<h5 id="APNS-Createcamelcontextanddeclareapnscomponentprogrammatically">Create camel context and declare apns component programmatically</h5> - -<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[ - protected CamelContext createCamelContext() throws Exception { +</div></div><h4 id="APNS-CamelJavaroute">Camel Java route</h4><h5 id="APNS-Createcamelcontextanddeclareapnscomponentprogrammatically">Create camel context and declare apns component programmatically</h5><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[ protected CamelContext createCamelContext() throws Exception { CamelContext camelContext = super.createCamelContext(); ApnsServiceFactory apnsServiceFactory = new ApnsServiceFactory(); @@ -235,14 +167,8 @@ apns:consumer[?options] return camelContext; } ]]></script> -</div></div> - - -<h5 id="APNS-ApnsProducer-iOStargetdevicedynamicallyconfiguredviaheader:"CamelApnsTokens"">ApnsProducer - iOS target device dynamically configured via header: <code>"CamelApnsTokens"</code></h5> - -<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[ - protected RouteBuilder createRouteBuilder() throws Exception { +</div></div><h5 id="APNS-ApnsProducer-iOStargetdevicedynamicallyconfiguredviaheader:"CamelApnsTokens"">ApnsProducer - iOS target device dynamically configured via header: <code>"CamelApnsTokens"</code></h5><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[ protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { public void configure() throws Exception { from("direct:test") @@ -252,13 +178,8 @@ apns:consumer[?options] } } ]]></script> -</div></div> - -<h5 id="APNS-ApnsProducer-iOStargetdevicestaticallyconfiguredviauri">ApnsProducer - iOS target device statically configured via uri</h5> - -<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[ - protected RouteBuilder createRouteBuilder() throws Exception { +</div></div><h5 id="APNS-ApnsProducer-iOStargetdevicestaticallyconfiguredviauri">ApnsProducer - iOS target device statically configured via uri</h5><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[ protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { public void configure() throws Exception { from("direct:test"). @@ -267,22 +188,12 @@ apns:consumer[?options] }; } ]]></script> -</div></div> - - -<h5 id="APNS-ApnsConsumer">ApnsConsumer</h5> - -<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("apns:consumer?initialDelay=10&delay=3600&timeUnit=SECONDS") +</div></div><h5 id="APNS-ApnsConsumer">ApnsConsumer</h5><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("apns:consumer?initialDelay=10&delay=3600&timeUnit=SECONDS") .to("log:com.apache.camel.component.apns?showAll=true&multiline=true") .to("mock:result"); ]]></script> -</div></div> - - -<h3 id="APNS-SeeAlso">See Also</h3> -<ul><li><a shape="rect" class="external-link" href="http://camel.apache.org/component.html">Component</a></li><li><a shape="rect" class="external-link" href="http://camel.apache.org/endpoint.html">Endpoint</a></li><li><a shape="rect" class="external-link" href="http://blog.xebia.fr/2010/09/30/creer-un-composant-apache-camel-de-connexion-a-lapns-1-sur-3/" rel="nofollow">Blog about using APNS (in french)</a></li></ul></div> +</div></div><h3 id="APNS-SeeAlso">See Also</h3><ul><li><a shape="rect" class="external-link" href="http://camel.apache.org/component.html">Component</a></li><li><a shape="rect" class="external-link" href="http://camel.apache.org/endpoint.html">Endpoint</a></li><li><a shape="rect" class="external-link" href="http://blog.xebia.fr/2010/09/30/creer-un-composant-apache-camel-de-connexion-a-lapns-1-sur-3/" rel="nofollow">Blog about using APNS (in french)</a></li></ul></div> </td> <td valign="top"> <div class="navigation"> Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available.