You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2016/05/19 11:22:24 UTC
camel git commit: Added camel-rss docs to Gitbook
Repository: camel
Updated Branches:
refs/heads/master 7cfced8b5 -> 2a79f9cef
Added camel-rss docs to Gitbook
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2a79f9ce
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2a79f9ce
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2a79f9ce
Branch: refs/heads/master
Commit: 2a79f9cefac301a8cd617adec6b47c5784f5dcf0
Parents: 7cfced8
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu May 19 13:20:57 2016 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu May 19 13:20:57 2016 +0200
----------------------------------------------------------------------
components/camel-rss/src/main/docs/rss.adoc | 167 +++++++++++++++++++++++
docs/user-manual/en/SUMMARY.md | 1 +
2 files changed, 168 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/2a79f9ce/components/camel-rss/src/main/docs/rss.adoc
----------------------------------------------------------------------
diff --git a/components/camel-rss/src/main/docs/rss.adoc b/components/camel-rss/src/main/docs/rss.adoc
new file mode 100644
index 0000000..cfe9630
--- /dev/null
+++ b/components/camel-rss/src/main/docs/rss.adoc
@@ -0,0 +1,167 @@
+[[RSS-RSSComponent]]
+RSS Component
+~~~~~~~~~~~~~
+
+The *rss:* component is used for polling RSS feeds. Camel will default
+poll the feed every 60th seconds.
+
+Maven users will need to add the following dependency to their `pom.xml`
+for this component:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-rss</artifactId>
+ <version>x.x.x</version>
+ <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
+
+*Note:* The component currently only supports polling (consuming) feeds.
+
+NOTE: Camel-rss internally uses a
+http://svn.apache.org/repos/asf/servicemix/smx4/bundles/trunk/rome-1.0/[patched
+version] of http://rometools.github.io/rome/[ROME] hosted on ServiceMix
+to solve some OSGi https://issues.apache.org/jira/browse/SMX4-510[class
+loading issues].
+
+[[RSS-URIformat]]
+URI format
+^^^^^^^^^^
+
+[source,java]
+----------
+rss:rssUri
+----------
+
+Where `rssUri` is the URI to the RSS feed to poll.
+
+You can append query options to the URI in the following format,
+`?option=value&option=value&...`
+
+[[RSS-Options]]
+Options
+^^^^^^^
+
+
+// component options: START
+The RSS component has no options.
+// component options: END
+
+
+
+// endpoint options: START
+The RSS component supports 28 endpoint options which are listed below:
+
+{% raw %}
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| feedUri | consumer | | String | *Required* The URI to the feed to poll.
+| bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
+| feedHeader | consumer | true | boolean | Sets whether to add the feed object as a header
+| filter | consumer | true | boolean | Sets whether to use filtering or not of the entries.
+| lastUpdate | consumer | | Date | Sets the timestamp to be used for filtering entries from the atom feeds. This options is only in conjunction with the splitEntries.
+| password | consumer | | String | Sets the password to be used for basic authentication when polling from a HTTP feed
+| sendEmptyMessageWhenIdle | consumer | false | boolean | If the polling consumer did not poll any files you can enable this option to send an empty message (no body) instead.
+| sortEntries | consumer | false | boolean | Sets whether to sort entries by published date. Only works when splitEntries = true.
+| splitEntries | consumer | true | boolean | Sets whether or not entries should be sent individually or whether the entire feed should be sent as a single message
+| throttleEntries | consumer | true | boolean | Sets whether all entries identified in a single feed poll should be delivered immediately. If true only one entry is processed per consumer.delay. Only applicable when splitEntries = true.
+| username | consumer | | String | Sets the username to be used for basic authentication when polling from a HTTP feed
+| exceptionHandler | consumer (advanced) | | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
+| pollStrategy | consumer (advanced) | | PollingConsumerPollStrategy | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.
+| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
+| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+| backoffErrorThreshold | scheduler | | int | The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.
+| backoffIdleThreshold | scheduler | | int | The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.
+| backoffMultiplier | scheduler | | int | 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 backoffIdleThreshold and/or backoffErrorThreshold must also be configured.
+| delay | scheduler | 500 | long | Milliseconds before the next poll. You can also specify time values using units such as 60s (60 seconds) 5m30s (5 minutes and 30 seconds) and 1h (1 hour).
+| greedy | scheduler | false | boolean | If greedy is enabled then the ScheduledPollConsumer will run immediately again if the previous run polled 1 or more messages.
+| initialDelay | scheduler | 1000 | long | Milliseconds before the first poll starts. You can also specify time values using units such as 60s (60 seconds) 5m30s (5 minutes and 30 seconds) and 1h (1 hour).
+| runLoggingLevel | scheduler | TRACE | LoggingLevel | The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.
+| scheduledExecutorService | scheduler | | ScheduledExecutorService | Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.
+| scheduler | scheduler | none | ScheduledPollConsumerScheduler | To use a cron scheduler from either camel-spring or camel-quartz2 component
+| schedulerProperties | scheduler | | Map | To configure additional properties when using a custom scheduler or any of the Quartz2 Spring based scheduler.
+| startScheduler | scheduler | true | boolean | Whether the scheduler should be auto started.
+| timeUnit | scheduler | MILLISECONDS | TimeUnit | Time unit for initialDelay and delay options.
+| useFixedDelay | scheduler | true | boolean | Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.
+|=======================================================================
+{% endraw %}
+// endpoint options: END
+
+
+[[RSS-Exchangedatatypes]]
+Exchange data types
+^^^^^^^^^^^^^^^^^^^
+
+Camel initializes the In body on the Exchange with a ROME `SyndFeed`.
+Depending on the value of the `splitEntries` flag, Camel returns either
+a `SyndFeed` with one `SyndEntry` or a `java.util.List` of `SyndEntrys`.
+
+[width="100%",cols="10%,10%,80%",options="header",]
+|=======================================================================
+|Option |Value |Behavior
+
+|`splitEntries` |`true` |A single entry from the current feed is set in the exchange.
+
+|`splitEntries` |`false` |The entire list of entries from the current feed is set in the exchange.
+|=======================================================================
+
+[[RSS-MessageHeaders]]
+Message Headers
+^^^^^^^^^^^^^^^
+
+[width="100%",cols="10%,90%",options="header",]
+|=======================================================================
+|Header |Description
+
+|`CamelRssFeed` |The entire `SyncFeed` object.
+|=======================================================================
+
+[[RSS-RSSDataformat]]
+RSS Dataformat
+^^^^^^^^^^^^^^
+
+The RSS component ships with an RSS dataformat that can be used to
+convert between String (as XML) and ROME RSS model objects.
+
+* marshal = from ROME `SyndFeed` to XML `String`
+* unmarshal = from XML `String` to ROME `SyndFeed`
+
+A route using this would look something like this:
+
+The purpose of this feature is to make it possible to use Camel's lovely
+built-in expressions for manipulating RSS messages. As shown below, an
+XPath expression can be used to filter the RSS message:
+
+
+TIP: *Query parameters*
+If the URL for the RSS feed uses query parameters, this component will
+understand them as well, for example if the feed uses `alt=rss`, then
+you can for example do
+`from("rss:http://someserver.com/feeds/posts/default?alt=rss&splitEntries=false&consumer.delay=1000").to("bean:rss");`
+
+[[RSS-Filteringentries]]
+Filtering entries
+^^^^^^^^^^^^^^^^^
+
+You can filter out entries quite easily using XPath, as shown in the
+data format section above. You can also exploit Camel's
+link:bean-integration.html[Bean Integration] to implement your own
+conditions. For instance, a filter equivalent to the XPath example above
+would be:
+
+The custom bean for this would be:
+
+[[RSS-SeeAlso]]
+See Also
+^^^^^^^^
+
+* link:configuring-camel.html[Configuring Camel]
+* link:component.html[Component]
+* link:endpoint.html[Endpoint]
+* link:getting-started.html[Getting Started]
+
+* link:atom.html[Atom]
+
http://git-wip-us.apache.org/repos/asf/camel/blob/2a79f9ce/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index 61c7c58..2dd9e51 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -225,6 +225,7 @@
* [Restlet](restlet.adoc)
* [RMI](rmi.adoc)
* [Routebox](routebox.adoc)
+ * [RSS](rss.adoc)
* [Scp](scp.adoc)
* [SJMS](sjms.adoc)
* [SJMS Batch](sjms-batch.adoc)