Giter Club home page Giter Club logo

dictionary-service-rmi's Introduction

An Asynchronous RMI Dictionary Service

Overview

The following repository contains a relatively straight forward Apache Tomcat Web Application employing Java Servlets and JSP as well as a RMI Service for querying dictionary definitions. The web client presents a basic user interface in which a user can enter a search string and submit it to be processed by the application. The application has been setup to simulate a delay of requests being added to a queueing system. This effectively demonstrates the asynchronous communication. Message Queues are implemented using RabbitMQ and the system also employs multiple RMI Client threads.

The following diagram depicts the overall system architecture and flow of execution:

diagram

Prerequisites

Getting Started with RabbitMQ

If you are on OSX Homebrew makes it easy to install various dependencies and manage services with Brew Services such as RabbitMQ as well as various other dependencies such as databases - i.e. CouchDB or MySQL. To get started with RabbitMQ follow these instructions.

  1. Update HomeBrew
brew update
  1. Brew Install
brew install rabbitmq
  1. Start the RabbitMQ Server
brew services start rabbitmq

To get setup using RabbitMQ on Windows please follow the instructions on the RabbitMQ Installation Documentation. RabbitMQ offers a basic .exe installer that can be used to manage services - stopping, starting.

Setup

Running a Maven Install inside the directory will generate the target directory and the associated war file - (Web Application Archieve). However this isn't necessary as I've included the associated war file and also the RMI Server Application jar file in this repository to avoid complications with different system environments and dependencies.

To use the application simply:

  1. Clone this Respository
git clone https://github.com/damiannolan/dictionary-service-RMI.git
  1. Start RabbitMQ as previously mentioned above
  1. Start the RMI Server Application
java -cp ./dictionary-service.jar ie.gmit.sw.server.ServiceSetup
  1. Drag and Drop Dictionary-Service-Webapp.war into an Apache Tomcat Installation directory under the folder named webapps.

  2. Start your Tomcat Server and navigate to http://localhost:8080/Dictionary-Service-Webapp/

OSX

brew services start tomcat

Windows

-> C:\dev\tomcat\bin> startup.bat

Note

As previously mentioned running an Maven Install will also generate the war file and target directory as well as download and install the dependencies needed for the application. You can also import the project into Eclipse and use the Maven plugin associated.

Maven Install

mvn install

Import into Eclipse

Eclipse -> File -> Import -> Maven -> Existing Maven Projects

Codebase

The application employs two Java Servlets - DictionaryServlet and PollingServlet for handling requests made by the client and polling of the server for a response respectively. HTML form information is sent to a servlet that adds the client request to an InQueue which is then in turn pulled from the queue and dispatched to an RMI Client Worker thread. The worker thread handles processing of the request and communications with an RMI Dictionary Service in order to fetch a number of defintions. The response is then added to an OutQueue and returned to the client via a PollingServlet which employs short polling every 10 seconds.

Application source code is packaged under the name ie.gmit.sw and ie.gmit.sw.server.

RMI Dictionary Service

  • IDictionaryService
  • DictionaryService
  • ServiceSetup

Dictionary Web Application

  • DictionaryServlet
  • PollingServlet
  • Request / Response
  • InQueueService
  • OutQueueService
  • RMIClient

Example

example

dictionary-service-rmi's People

Contributors

damiannolan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.