Git Product home page Git Product logo

order-payment-microservice-sample2's Introduction

This is my sample project when i learning about microservice

Description

I use 3 microservices:

  • order-service to create orders. This services sends messages to Kafka. It uses the KafkaTemplate.
  • stock-service to store and check amount product in inventory on the order
  • payment-service to store and check customer balance on the order

Technologies

  • Spring Boot
  • Spring Kafka
  • Kafka
  • Zookeeper
  • PostgreSQL
  • confluent cloud

How To Run

  1. Go to docker folder, then run command: docker compose up -d

How to call API

  1. Import api collection json file order-payment-stock-service.postman_collection.json in postman folder to postman application
  2. API list:
  • localhost:8081/products/generate/{number}: Generate seed data for stock-service

    • Example: localhost:8081/products/generate/100: product records
  • GET: localhost:8081/products: Get all products

  • GET: localhost:8081/products/{id}: Get product with id = {id}

  • POST: localhost:8081/products: Post 1 product record into database

  • PUT: localhost:8081/products/{id}: Update product record with id = {id} on database

  • localhost:8082/customers/generate/{number}: Generate seed data for payment-service

  • GET: localhost:8082/customers: Get all products

  • GET: localhost:8082/customers/{id}: Get customer with id = {id}

  • POST: localhost:8082/customers: Post 1 customer record into database

  • PUT: localhost:8082/customer: Update customer record with id = {id} on database

  • localhost:8080/orders/generate/{number}: Generate orders

  • GET: localhost:8080/orders: Get all orders

  • POST: localhost:8080/orders: Post 1 order record into database

  • GET: localhost:8080/orders/stream: Get all orders from Kafka stream

order-payment-microservice-sample2's People

Contributors

toannv95 avatar

Watchers

 avatar

Forkers

toannv6895

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.