Subscription Service API


This service will communicate with internal microservices and publish successful subscription

Table of Contents

Introduction

This service is responsible for saving subscription data in persistence datastore, publish subscription event to rabbitmq to notify email service.

Features

  • Microservice architecture
  • Event driven architecture
    • Queues are treated as streams to get faster and reliable delivery and consumption
  • Smart Endpoints and Dumb Pipes
  • Validate request from public service or other upstream services
  • Save subscription is database
  • Return response to public service or other upstream services
  • publish event in event bus in reactive way

Requirements

The application can be run locally. Containerization is in progress

Local

Quick Start

Make sure your maven is pointing to JAVA_HOME and JAVA_HOME is set to Java16 JDK.

Make sure your RabbiMQ docker is up and running to see successful subscription event.

The RabbitMQ host value in the application.yml file is set to localhost.

Run Local

If your JAVA_HOME is set to Java16 JDK

$ mvn clean install
$ java -jar target/subscription-service-0.0.1-SNAPSHOT.jar

For multiple JDK issue

$ JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home
$ export JAVA_HOME
$ mvn clean install
$ java -jar target/subscription-service-0.0.1-SNAPSHOT.jar

Application will run by default on port 9090

Configure the port by changing server.port in application.yml

Test

100% UnitTest code coverage for business and controller layers using Junit Jupiter is used.

Improvements

  • API documentation using swagger-ui and open-api docs
  • Adoption of Reactive way of coding in whole project
  • Containerization
  • Integration with CICD i.e. jenkins / rancher
  • Metrics Expose
  • Integration with jaeger / slueth / opentelemetry for better traceability
  • Integration with metrics collector i.e. prometheus
  • Integration with ELK stack
  • Integration with grafana for better visibility, observability and alerts
  • Integration test
  • Automation testing or behavioral testing i.e. RobotFramework, Selenium