Skip to content

Aggregator service that listens to a Message Queue and processes new Products

License

Notifications You must be signed in to change notification settings

sergiopoliveira/aggregator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aggregator service

Github Actions Codacy Badge codecov

Aggregator service will to listen to a Message Queue, parse the JSON messages to Products and and saves them to the database. Also tracks if the Product is newly added or updated.

To be used together with the Importer service.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

JDK 11 and Maven or Docker is required to run this project.

Build and Run

Maven

Build and run the project with Maven:

mvn package
mvn spring-boot:run

Docker

Use the following docker-compose to run the full project:

version: '3'
services:
  activemq:
    container_name: activemq
    image: vromero/activemq-artemis
    ports:
      - "8161:8161"
      - "61616:61616"
  importer:
    image: sergiopoliveira/importer
    ports:
      - "5050:5050"
    depends_on:
      - activemq
  aggregator:
     image: sergiopoliveira/aggregator
     ports:
      - "5051:5051"
     depends_on:
      - activemq
  zipkin:
     image: openzipkin/zipkin
     ports:
      - "9411:9411"

REST Endpoints

http://localhost:5051/api/v1/products -> List all products in the database
http://localhost:5051/api/v1/statistics/daily -> Get daily statistics for Products inserted or updated

Running the tests

Tests created using JUnit and Mockito. Run them as:

mvn test

Built With

  • Java 11
  • Spring Boot
  • Spring Data JPA
  • ActiveMQ
  • MapStruct
  • Maven
  • JUnit, Mockito
  • H2 in-memory database

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Aggregator service that listens to a Message Queue and processes new Products

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published