RSS Component
Available as of Camel 2.0
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:
Code Block | ||||
---|---|---|---|---|
| ||||
<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 | ||
---|---|---|
| ||
Camel-rss uses ROME 1.0 and below. This library has class loading issues in OSGi environment. We submitted issue 142 to ROME. |
...
. |
...
URI format
Code Block |
---|
rss:rssUri |
...
Property | Default | Description |
---|---|---|
| | If |
| | Use in combination with the |
| | Camel 2.5: 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 is set to true. |
| | Use in combination with the |
| | Specifies whether to add the ROME |
| | If |
| | Delay in milliseconds between each poll. |
| | Milliseconds before polling starts. |
| | Set to |
...
Wiki Markup |
---|
{snippet:id=ex|lang=java|url=camel/trunk/components/camel-rss/src/test/java/org/apache/camel/dataformat/rss/RssFilterWithXPathTest.java} |
Merging multiple incoming feeds
To merge multiple incoming feeds into a single feed, you can apply the custom aggregator, AggregationCollection
, provided with camel-rss. For example:
Wiki Markup |
---|
{snippet:id=ex|lang=java|url=camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssCustomAggregatorTest.java} |
...
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 Bean Integration to implement your own conditions. For instance, a filter equivalent to the XPath example above would be:
...