Skip to content

Event Driven, Non-Blocking, Asynchronous RESTful API using Vertx with basic CRUD Operations

Notifications You must be signed in to change notification settings

subhasam/event-driven-restful-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Event Driven RESTful API

@author : Subhasis Samal

An Event Driven RESTful API using Vertx with basic CRUD Operation

docs/Event-Driven-WDS-API.png

Technology Stack

  1. Vertx 3.x
  2. Java 8
  3. MongoDB (Database)
  4. Redis (Cache)
  5. Docker (Container)
  6. Junit (Testing)
  7. Mockito
  8. Maven (Build)

Build and Deployment

  • MongoDB installation and Test Data Set Up
  1. Refer the instructions to install MongoDB : https://docs.mongodb.com/manual/installation/
  2. Make sure Mongo DB is running on the default port 27017
$ mongod -dbpath data/db/
  1. Insert Agent related data with this query db.agents.insert() and passing the agent data present in this file- agentData.json
$ git clone https://github.com/subhasam/work-distribution-api.git

$ cd work-distribution-api
$ mvn clean install
  • To run in IDE - Import the source code in Eclipse IDE and add the Run Configurations Configure JRE and Run Configuration

  • Steps for Installation through Docker(WORK IN PROGRESS)

$ git clone https://github.com/subhasam/event-driven-restful-api.git

$ cd event-driven-restful-api

$ mvn clean install 

$ docker-compose build

$ docker-compose up
  • After install wait until the below message appears in the console which means API is ready to process you request.
Congratulations !! Work Distribution API is ready to process your request at http://localhost:9090

API Status Check:

Hit this URL on browser or through any REST Client, you will see a response from the server.

http://localhost:9090/workdistribution/v1/health-check
RESPONSE : Health-Check : Work Distribution API is Up Running...

Testing the Work Distribution API

You can use any Rest Client of your choice like Postman/Insomnia/Chrome's Rest Client Extension to test the API. For every request except Health check, you need to pass an attribute "access_token" with any value in the Header for authentication.

access_token: subhasis

API End Points :

METHOD End-Point Description Test Data/Request-Response Reference
GET /workdistribution/v1/health-check API Health Check ApiHealthCheck.json
GET /workdistribution/v1/skills Lists Available Skills AvailablesSkills.json
POST /workdistribution/v1/tasks Create a Task TaskCreationReqRes.json
PATCH /workdistribution/v1/tasks/taskId Mark a Task as Complete MarkTaskComplete.json
Common Errors Common-API-Errors.json

API Sample Request and Response

Sample Test Data - Request and Response are listed under "docs" directory.

Work-In-Progress and Future Enhancements

  • Docker Mongo Connectivity Fix
  • Enable Unit Tests and Add Test Clients
  • Logging
  • Redis Connectivity Issue Fix
  • Integration with Message Queue(Active MQ)/Streaming Middleware(Kafka)
  • Event Bus with Verticles Developed in Multiple Languages
  • Integration with PostgreSQL
  • Integration with SaaS
  • Integration with CouchBase
  • EventBus Additional Microservices

About

Event Driven, Non-Blocking, Asynchronous RESTful API using Vertx with basic CRUD Operations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published