Skip to content

srivatsa-cfp/blog-business-service

Repository files navigation

Blog Business Service

This service provides ability for Blog creation and access to blog project, which has a Vertx HTTP server which handles blog creation, blog access and create blog comments requests.

In this service Vert.x is used embedded. I.e. we use the Vert.x APIs directly in our own classes rather than deploying the code in verticles.

All the configuration are available in config

dev.json - Local setup
uat.json - Test environment setup
prod.json - Production environment setup

The build.gradle uses the Gradle shadowJar plugin to assemble the application and all it’s dependencies into a single "fat" jar.

To build the "fat jar"

./gradlew shadowJar

Run the fat jar as a standalone runnable jar:

java -jar -Dvertx.logger-delegate-factory-class-name=io.vertx.core.logging.Log4j2LogDelegateFactory build/libs/blog-business-service-4.1.2-fat.jar

Before running the standalone jar following steps are needed:

export PROFILE_NAME = dev

There is a docker-compose.yml which sets up the Mongo Database instance. Simply run the following command to setup the Mongo DB instance.

docker-compose up -d

You can use Mongo Atlas to visually look into the Database.Mongo Atlas can be downloaded from https://www.mongodb.com/

(You can take that jar and run it anywhere there is a Java 8+ JDK. It contains all the dependencies it needs so you don’t need to install Vert.x on the target machine).

Now point your request at http://localhost:8081 or port which you have configured in config/dev.json

Project also has the following json file to set up the all services in Postman application

BlogBusinessService.postman_collection.json

All the Test classes are available in Test Folder. If you are using IntelliJ, go to src/test/java, Right click on com.vertx.business.services.test and Run Tests.

For Performance Testing, go to the jmeterReport and run the .jmx file from jmeterReport folder. Go to jmeterReport/*blog/index.html for more detailed statistics about the performance report. You can download the jmeter from https://jmeter.apache.org/download_jmeter.cgi and go to bin/jmeter.sh to run the jmx file and run the following command to generate the report

./jmeter -g report.csv -o <path>/jmeterReport/blog

FlowChart, Swim Lane and ER diagrams are available in diagrams folder

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published