All Projects → asc-lab → Micronaut Microservices Poc

asc-lab / Micronaut Microservices Poc

Licence: apache-2.0
Very simplified insurance sales system made in a microservices architecture using Micronaut

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Micronaut Microservices Poc

Firecamp
Serverless Platform for the stateful services
Stars: ✭ 194 (-50.76%)
Mutual labels:  kafka, mongodb, postgresql, consul
Devicehive Java Server
DeviceHive Java Server
Stars: ✭ 241 (-38.83%)
Mutual labels:  microservices, kafka, postgresql, jwt
Fw Spring Cloud
SpringCloud构建实战、从入门到高级,包含eureka、zuul、gateway、feign、ribbon、hystrix、mq、turbine、nacos、elk、consul、zookeeper、rocketmq、kafka、分布式事务(RocketMq、LCN、Seata)、分库分表(Sharding-JDBC)、分布式锁(Redis、Guava)、jwt、SkyWalking、Zipkin、bootadmin等使用案例
Stars: ✭ 276 (-29.95%)
Mutual labels:  kafka, consul, zipkin, jwt
My Cheat Sheets
A place to keep all my cheat sheets for the complete development of ASIC/FPGA hardware or a software app/service.
Stars: ✭ 94 (-76.14%)
Mutual labels:  microservices, postgresql, consul
Nakadi
A distributed event bus that implements a RESTful API abstraction on top of Kafka-like queues
Stars: ✭ 734 (+86.29%)
Mutual labels:  microservices, kafka, postgresql
Sample Vertx Microservices
Two applications in different branches illustrates how to create asynchronous microservices with Vert.x, Consul and MongoDB, and how to secure them with Vert.x OAuth2 module and Keycloak
Stars: ✭ 37 (-90.61%)
Mutual labels:  microservices, consul, jwt
Modernarchitectureshop
The Microservices Online Shop is an application with a modern software architecture that is cleanly designed and based on.NET lightweight technologies. The shop has two build variations. The first variant is the classic Microservices Architectural Style. The second one is with Dapr. Dapr has a comprehensive infrastructure for building highly decoupled Microservices; for this reason, I am using Dapr to achieve the noble goal of building a highly scalable application with clean architecture and clean code.
Stars: ✭ 154 (-60.91%)
Mutual labels:  microservices, zipkin, microservices-architecture
Coolstore Microservices
A full-stack .NET microservices build on Dapr and Tye
Stars: ✭ 1,903 (+382.99%)
Mutual labels:  microservices, postgresql, microservices-architecture
Event Sourcing Jambo
An Hexagonal Architecture with DDD + Aggregates + Event Sourcing using .NET Core, Kafka e MongoDB (Blog Engine)
Stars: ✭ 159 (-59.64%)
Mutual labels:  microservices, kafka, mongodb
Dotnet New Caju
Learn Clean Architecture with .NET Core 3.0 🔥
Stars: ✭ 228 (-42.13%)
Mutual labels:  microservices, kafka, mongodb
Gin Boilerplate
The fastest way to deploy a restful api's with Gin Framework with a structured project that defaults to PostgreSQL database and JWT authentication middleware stored in Redis
Stars: ✭ 559 (+41.88%)
Mutual labels:  microservices, postgresql, jwt
Nest Angular
NestJS, Angular 6, Server Side Rendering (Angular Universal), GraphQL, JWT (JSON Web Tokens) and Facebook/Twitter/Google Authentication, Mongoose, MongoDB, Webpack, TypeScript
Stars: ✭ 307 (-22.08%)
Mutual labels:  mongodb, jwt, jwt-auth
Madclones
A collection of frameworks that I love with a strong focus on clean code, testing, software architecture/design and devops.
Stars: ✭ 480 (+21.83%)
Mutual labels:  microservices, mongodb, microservices-architecture
Bookstoreapp Distributed Application
Ecommerce project is being developed using Spring Boot Microservices and Spring Cloud (Backend) and React (Frontend). Splitting the Ecommerce functionality into various individual microservices so that they can be distributed, scale really well and make use of resources efficiently.
Stars: ✭ 63 (-84.01%)
Mutual labels:  microservices, consul, zipkin
Netcoremicroservicessample
Sample using micro services in .NET Core 3.1 Focusing on clean code
Stars: ✭ 403 (+2.28%)
Mutual labels:  microservices, consul, microservices-architecture
My Moments
Instagram Clone - Cloning Instagram for learning purpose
Stars: ✭ 140 (-64.47%)
Mutual labels:  microservices, kafka, mongodb
Spring Samples For All
spring、spring-boot、spring-cloud 常用整合用例
Stars: ✭ 401 (+1.78%)
Mutual labels:  kafka, mongodb, zipkin
Spring Boot 2.x Examples
Spring Boot 2.x code examples
Stars: ✭ 104 (-73.6%)
Mutual labels:  kafka, mongodb, postgresql
Pos
Sample Application DDD, Reactive Microservices, CQRS Event Sourcing Powered by DERMAYON LIBRARY
Stars: ✭ 207 (-47.46%)
Mutual labels:  microservices, kafka, microservices-architecture
Surging
Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline. The service engine supports http, TCP, WS,Grpc, Thrift,Mqtt, UDP, and DNS protocols. It uses ZooKeeper and Consul as a registry, and integrates it. Hash, random, polling, Fair Polling as a load balancing algorithm, built-in service gove…
Stars: ✭ 3,088 (+683.76%)
Mutual labels:  microservices, kafka, consul

ASCLAB Micronaut PoC - LAB Insurance Sales Portal

Build Status

This is an example of a very simplified insurance sales system made in a microservice architecture using Micronaut.

Comprehensive guide describing exactly the architecture, applied design patterns and technologies can be found on our blog in article Building Microservices with Micronaut.

We have recently upgraded to Java 14 (you must have JDK14 in order to build and run the project).

We encourage you to read, because in this README there is only a substitute for all information.

Other articles around microservices that could be interesting:

Architecture overview

Micronaut Microservices Architecture

  • agent-portal-gateway - Gateway pattern from EAA Catalog implementation.
    The complexity of “business microservices” will be hidden by using Gateway pattern. This component is responsible for the proper redirection of requests to the appropriate services based on the configuration. The frontend application will only communicate with this component. This component show usage of non-blocking http declarative clients.

  • payment-service - main responsibilities: create Policy Account, show Policy Account list, register in payments from bank statement file.
    This module is taking care of a managing policy accounts. Once the policy is created, an account is created in this service with expected money income. Payment-service also has an implementation of a scheduled process where CSV file with payments is imported and payments are assigned to policy accounts. This component shows asynchronous communication between services using Kafka and ability to create background jobs using Micronaut. It also features accessing database using JPA.

  • policy-service - creates offers, converts offers to insurance policies.
    In this service we demonstrated usage of CQRS pattern for better read/write operation isolation. This service demonstrates two ways of communication between services: synchronous REST based calls to pricing-service through HTTP Client to get the price, and asynchronous event based using Apache Kafka to publish information about newly created policies. In this service we also access RDBMS using JPA.

  • policy-search-service - provides insurance policy search.
    This module listens for events from Kafka, converts received DTOs to “read model” (used later in search) and saves this in database (ElasticSearch). It also exposes REST endpoint for search policies.

  • pricing-service - calculates price for selected insurance product.
    For each product a tariff should be defined. The tariff is a set of rules on the basis of which the price is calculated. MVEL language was used to define the rules. During the policy purchase process, the policy-service connects with this service to calculate a price. Price is calculated based on user’s answers for defined questions.

  • product-service - simple insurance product catalog.
    Information about products are stored in MongoDB. Each product has code, name, image, description, cover list and question list (affect the price defined by the tariff). This module shows usage of reactive Mongo client.

  • auth-service - JWT based authentication service, this services provides login functionality.
    Based on login and password users get authenticated and JWT token with their privileges is created and returned. This services shows built-in Micronaut support for JWT based security.

  • documents-service - Service build with kotlin. Responsible for generating pdf document when new policy event is received.

  • chat-service - Example WebSocket usage. Chat for salesman.

  • dashboard-service - Business dashboards that presents our agents sales results. Dashboard service subscribes to events of selling policies and index sales data in ElasticSearch. Then ElasticSearch aggregation framework is used to calculate sales stats like: total sales and number of policies per product per time period, sales per agent in given time period and sales timeline. Sales stats are nicely visualized using ChartJS.

  • web-vue - SPA application built with Vue.js and Bootstrap for Vue.

Each business microservice has also -api module (payment-service-api, policy-service-api etc.), where we defined commands, events, queries and operations.

In the picture you can also see the component internal-command-bus. This component is used internally by microservices if we want to use a CQRS pattern inside (simple example in OfferController in policy-service).

Building

This step requires Java 14 (JDK), Maven and Yarn.

For demo purposes build process is automated by a shell script. For Unix-based systems:

build-without-tests.sh

For Windows:

build-without-tests.bat

If you already run the necessary infrastructure (Kafka, Consul etc.), you should run build with all tests: For Unix-based systems:

build.sh

For Windows:

build.bat

Running

Prerequisites

  • docker
  • docker-compose

Windows users: make sure to set core.autocrlf false in git configuration before cloning this repository.

For Windows users, append below line C:\Windows\System32\drivers\etc\hosts:

127.0.0.1 kafkaserver

For frontend app running, you must add file .env.local based on .env-example .

Zipkin

Automated deployment

To run the whole system on local machine just type:

docker-run.sh

Make sure you've first built the microservices! Check this. This script will provision required infrastructure and start all services. Setup is powered by docker-compose and configured via docker-compose.yml file.

Afterwards you need to add kafka cluster - either via web UI (Kafka Manager -> Cluster -> Add Cluster) or using provided script:

kafka-create-cluster.sh

At this point system is ready to use: http://localhost

Manual deployment

If you want to run services manually (eg. from IDE), you have to provision infrastructure with script from scripts folder:

infra-run.sh

Afterwards you need to add kafka cluster - either via web UI (Kafka Manager -> Cluster -> Add Cluster) or using provided script:

kafka-create-cluster.sh
  • Consul dashboard: http://localhost:8500
  • Zipkin dashboard: http://localhost:9411/zipkin/
  • Kafka Manager dashboard: http://localhost:9000/
  • JSReport dashboard: http://localhost:5488/

Add POLICY template to JsReport

Zipkin

  1. Click "+".
  2. Type name "POLICY" and content from file policy.template.
  3. Commit changes.

Consul without our script

docker run -p 8500:8500 consul

Zipkin without our script

docker run -d -p 9411:9411 openzipkin/zipkin

Kafka without our script

Setup Kafka on Windows with this instruction.

JSReport without our script

docker run -p 5488:5488 jsreport/jsreport

OpenAPI/Swagger docs

agent-portal-gateway provides the API description.

You can go to URL: [http://localhost:8081/swagger/lab-insurance-sales-portal-api-1.0.yml][http://localhost:8081/swagger/lab-insurance-sales-portal-api-1.0.yml]

Add new microservice

Create new microservice with Micronaut CLI:

mn create-app pl.altkom.asc.lab.[SERVICE-NAME]-service -b maven

This command generate project in Java and Maven as build tool.

Examples

Chat

Chat

Sales Dashboard

Sales Dashboard

Tracing requests with Zipkin

Zipkin

Show topics on Kafka

Kafka

Show registered services in Consul

Consul

Show document templates in JS Report

JSReport

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].