The soccer world cup is about to start, and people are more interested in getting sport news. Thus, we are planning to provide them with a way to receive the latest sport news by subscribing to our sport topic channel.
We found that there are 2 interesting topic channels from which we can receive news. Unfortunately, they contain news in all areas, not only sport news. Therefore we will need to filter the data we get from those topics by selecting only the sport news before sending it to our customers. Another problem is that we get the message from our subscriptions in different formats. Therefore, we will need to appy a transformation payload and define our custom data type in order to send the messages to our customers in a common format through our sport channel.
We have also some journalist that will work on writing news stories especially for us, and they need a way to send their articles to our system. Thus, we need to expose a service that they can easily interface with our system, such as http request or a webservice.
The test consist of creating an Mule Project that supports the scenario previously described. The application should contain at least the following service components:
1) News Broker: this service component will subscribe to the following topics:
news1
news2
The component should filter the message payload comming from their subscriptions and send it via point-to-point communication to the News Provider service component. The News Provider expect the message already filtered in a specific data type.
2) News Provider: this service receives messages from the News Broker or from an external invocation (for the journalists), and send it to the sport topic.
3) Bridge Service: this service component integrates another JMS bus provider (ActiveMQ) which will be accessible and shared for all the students. The Bridge service components subscribe to the sport topic in the local jms bus provider (running locally) and send the message to another JMS provider in a topic: sport_LASTNAME (where lastname is your lastname). At the end of the exam we expect to see your topic with the resultant messages.
Hint: If you define a data type for sending the message in the point-to-point communication, the class should implement the Serializable interface, override the toString method (here you define the output format), and use the following transformers for sending/recieving an object through JMS
<jms:object-to-jmsmessage-transformer
name="ObjectToJMSMessage" />
<jms:jmsmessage-to-object-transformer
name="JMSMessageToObject" />
News Topics
Attached you will find an executable jar (producer.jar) that will start sending messages to news1, news2 topics. Also, the source code is attached.
to run the java app:
$> java -jar tcp://localhost:61616
It will start sending the messages to news1 and news2 topics.
Message Format
Topic
news1
news2
Format
PROVIDER,AREA,MESSAGE
PROVIDER:AREA:MESSAGE
Possible values
PROVIDER
AREA
MESSAGE
news1 | news2
politic | sport | world | business
TEXT MESSAGE
Example of messages:
news1,politic,Politic news
news1,sport,Sport news
news2:business:Business news
news2:politic:Politic news
news2:sport:Another sport news
Expected output
Provider: news1
Message: Sport news
Provider: news2
Message: Another sport news
1) Filtering
2) Transformation
3) Point-to-point message delivery
4) Pub/Sub message delivery
5) Routing message over different transport protocols
6) Multiple jms provider integration (PLUS.. CHECK ON INTERNET HOW TO WORK WITH MORE THAN ONE JMS PROVIDER)
2 hours
Commit your project into the SVN by the time.
Hints
Do not forget to define the xml schema and namespace of the transports you are using.
Try to not spend time debugging your application before finishing your model.
Good Luck!