Under the hood I'm using the ROME project. Its pretty much the standard Java framework for dealing with RSS feeds.
To consume from an RSS feed, just start your route like
from("rss:http://feeds.feedburner.com/JonAnsteysBlog")...
Then you can do all sorts of neat stuff like,
Filtering entries
Only entries with Camel in the title will get through this filter.
from("rss:feedUri?splitEntries=true").
filter().method("myFilterBean", "titleContainsCamel").
to("mock:result");
Merging multiple incoming feeds
Sometimes you may need to merge feeds from several different sources.
from("rss:feedUri").to("seda:temp");
from("rss:someOtherFeedUri").to("seda:temp");
from("seda:temp").aggregate(new AggregateRssFeedCollection()).
to("mock:result");
Marshal between XML and ROME objects
Here we perform the same filtering as above but instead marshal to XML and use XPath.
from("rss:feedUri?splitEntries=true").
marshal().rss().
filter().xpath("//item/title[contains(.,'Camel')]").
to("mock:result");
For more info, check out the wiki documentation.
2 comments:
Nice work Jon!
Yeah super work with this new component. And as a bonus the atom component got a brush up as well.
Post a Comment