|
RSS has been edited by Jonathan Anstey (Dec 03, 2008). Content:RSS ComponentThe rss: component is used for polling RSS feeds. Camel will default poll the feed every 60th seconds. Note: The component currently only supports polling (consuming) feeds. New in Camel 2.0 URI formatrss:rssUri Where rssUri is the URI to the RSS feed to poll.
Exchange data typesCamel will set the in body on the returned Exchange with a ROME SyndFeed. Depending on the splitEntries flag Camel will either return a SyndFeed with one SyndEntry or a List of SyndEntrys.
Camel will also set the entire SyndFeed object on the in header: exchange.in.header("org.apache.camel.component.rss.feed", feed)
RSS DataformatThe RSS component ships with an RSS dataformat that can be used to convert between String (as XML) and ROME RSS model objects.
A route using this would look something like this: from("rss:file:src/test/data/rss20.xml?splitEntries=false&consumer.delay=100").marshal().rss().to("mock:marshal"); The idea is to be able 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: // only entries with Camel in the title will get through the filter from("rss:file:src/test/data/rss20.xml?splitEntries=true&consumer.delay=100").marshal().rss(). filter().xpath("//item/title[contains(.,'Camel')]").to("mock:result"); See Also |
Unsubscribe or edit your notifications preferences
