Distributed systems Programming Laboratory 3 – Java Messaging Service Introduction

October 21, 2017 | Penulis: Bereket Negash | Kategori: Java
Share Embed


Deskripsi

Distributed systems Programming
Laboratory 3 – Java Messaging Service
Introduction
In this laboratory session we are going to use Java Messaging Service (JMS) to develop a simple message board system. Users will post messages to available topics. Other users with permission to access these topics will be allowed to view these messages. We studied Queues in detail in our lecture class, but here you have to work using Topics. See their basic difference on slide # 23 of the lecture note. You need to refer to the internet too. Oracles JMS tutorial is a good starting point. Google it!
Work in groups of two or three. Please make sure that you use the grouping created in the first lab. You need to send a compressed version of your NetBeans project. The project's name and the folder's name must be ds-jms-lab-your-name. You also need to send a file called ds-jms-lab-your-name.sql. Running script file must create the database that will be used by the message board system. It also needs to contain DDL to create tables, and populate them with sample data.
The starting code for this laboratory session is distributed along with this file, get it from the ftp server or from our new lecture management system. Open the project on NetBeans. The code contains three files.
index.jsp – this page presents a text box that allows the user to enter some message, and a "Send The message" button.
MessageSender.java – this servlet is called when the user presses the "Send The message" button on index.jsp.
MessageReceiver.java – this servlet is called when the user clicks the "Get My Messages" link on index.jsp.
Due Date: Thursday, November 27, 2014 – A week from today.
Lab Activity
You will be graded based on the requirements listed below. File names, function names, project name, and the minimum set of functionalities provided must be according to these sets of requirements. Since I am making use of automatic testing tools, follow the requirements STRICTLY.
Requirements:
Modify index.jsp so that the message sender can select the destination topic, and additional parameters such as whether the message must be delivered, and how long it should stay in the topic (it's time to live) and the messages priority (Read JMS tutorials and be creative about the options available).
You need to retrieve all the available topics the administrator created from a database table called Topic.

As you can see from the code in index.jsp, when the "Send The message" is clicked a servlet called SendMessage which is found in servlets.SendMessage.java is executed. Modify SendMessage.java's doGet method so that it accepts all the new parameters from index.jsp and send the message to the selected topic.
Also make sure (probably by reading from a database) that this user has the write permission to this topic.

index.jsp also contains a "Get My Messages" link. Clicking on this link calls the ReceiveMessage servlet found in servlets.ReceiveMessage.java. Modify this files doGet method to:
Retrieve all the messages sent to all topics the user has subscribed for (and also ahs permission to access – this may need you to make use of database).
You need to display from which topic the message was retrieved from.
Receive method blocks until a message is received, just like socket's accept method. Figure out a way to make Asynchronous calls. And implement it to receive message

Lihat lebih banyak...

Komentar

Copyright © 2017 KULSLIDE Inc.