-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the MerchFinder wiki!
This wiki describes the structure of the project and the configurations of the various components.

a) The Kafka server and MySQL database containers are instantiated and configured.
b) The user connects to localhost:8080 through the browser and receives the index.html page generated from the index.jsp file.
c) The user enters the name of the product that wants to search.
d) The controller receives the HTTP-GET request from the user and tries to obtain this information from cache (i.e from the database). If:
- successful, it injects the results into the jsp file and sends the generated HTML page to the user. The database serves as a cache for searched products in order to prevent REST API calls for repeated product searches.
- unsuccessful, it will have to get the information from the REST API. After obtaining the results (the default number of products obtained from the Ebay Finding API is 100) the controller stores them in the database, proceeds to inject them into the jsp file and sends the generated HTML page to the user.
e) The EJB TimeSessionBean.java is started at the web application startup and is executed every 30 seconds. This EJB gets the list of different product searches in the database and only updates 1 searched product each execution time. This is to reduce the number of calls to the Ebay API as it has a limit for free usage.
- Due to time constraints, instead of updating the search results in the database (by only adding new products), the EJB adds all 100 received products, even if repeated.
f) After receiving, processing and storing the search results into the database, the EJB uses a Kafka producer to send a message to the Kafka server with the name of product that was updated.
g) The Kafka consumer process requests the Kafka cluster for the available messages published by the Kafka producer and prints them in the terminal.
Wiki
Project configuration