Each lab will consist of a small problem and details of how to proceed. You need to submit labs to the TAs for grading--see submission instructions below. Generally, unless otherwise specified, you will have one week to complete each assigned lab.
See the syllabus for information on grading. Turning in lab assignments is required. Submit your assignments as a tarball to the subversion repository according to the directions on the syllabus page.
You
must
write these solutions in
Java leveraging both Camel and ActiveMQ.
Lab 7 Due: 5:00 pm, Monday, May 25, 2020
Problem
(Producing
Messages Derived from RSS Feeds to a Queue leveraging
xPath and Regular Expression Parsing):
In this lab, you will use Camel's DSL to create a Producer program that contains a Content Based Router [cf. .choice()] and consumes data from an RSS feed and extracts certain information from each feed and posts summary messages to a Queue.
What you need to implement:
You are to read Appendix A (in Camel in Action) on the Simple expression language ([CIA pp. 461ff.]) and the online description of the RSS component (http://camel.apache.org/rss.html) and Camel XPath (http://camel.apache.org/xpath.html) as well as Camel regular expression parsing and choice ([CIA 2.5, "Routing and EIPs" in particular] to create the following Producer with a Content Based Router. To take a working project you already have in Eclipse and transform it for use with RSS, simply add the following dependency directly to your project's pom.xml (which is still used by your Eclipse project):The producer will access and receive feeds from Google News (URL: String googleNewsURL = "https://news.google.com/?output=rss";). You will use the RSS Component to obtain this feed, for example: from("rss:" + googleNewsURL).... Once you are receiving the feed, you should set the body of the message using xpath() to the actual text message embedded inside the full xml text. For example, if you receive the following XML feed:<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-rss</artifactId> <version>${camel-version}</version> </dependency>
Submitting:
See above for specific items that need to be included in your
submission, including specific items in the README and the
project directory you submit. Submit your assignments to the
subversion repository in the pre-existing folder named "labN"
(where N is the homework number).