Spring Boot Microservices Tutorial - Part 2 - Order Service

Sdílet
Vložit
  • čas přidán 16. 07. 2024
  • In this Spring Boot 3 Microservices tutorial series, we will learn how to build microservices using Spring Boot and Spring Cloud.
    This is part 2 of the series, in this part, we will cover:
    - Building Order Service
    - Database migrations using Flyway
    - Writing Integration Tests using Test Containers
    Timestamp:
    Generate Order Service - 00:00
    Initialize Database using Docker Compose - 06:25
    Build Submit Order Endpoint - 10:55
    Database migrations using Flyway - 18:30

Komentáře • 31

  • @elizabethr5161
    @elizabethr5161 Před 7 dny

    awesome video, learned a lot.

  • @Shil131
    @Shil131 Před 13 dny

    Many Many and Many Thanks for posting this playlist ! ☺

  • @nailtagiyev6340
    @nailtagiyev6340 Před 3 měsíci

    Thank you, brother

  • @user-ql4nt3te6r
    @user-ql4nt3te6r Před 3 měsíci

    excited fo playlist

  • @hrsatsangi
    @hrsatsangi Před 3 měsíci +4

    Please sir Font ko thoda Bigger rakhiye
    Because of while we are working together with split screen there is a problem to read the text 😢😢

  • @bhavyanth.kondapalli
    @bhavyanth.kondapalli Před 2 měsíci

    Hello, instead of we downloading the MySQL workbench to connect to local databases, we can use the built in database tool in IntelliJ right? It's in the same location where we run the maven commands. It allows us to connect to most of the available databases just by downloading the required drivers.

  • @rishiraj2548
    @rishiraj2548 Před 3 měsíci

    🙂🙂👍

  • @ChandanNayak-lq1pd
    @ChandanNayak-lq1pd Před 3 měsíci

    Sir,are you releasing the course today?

  • @priyansusahoo
    @priyansusahoo Před 2 měsíci +2

    Hi Sai, I'm facing some problem related to creating the order_service container, it's throwing this error:
    \order-service>docker compose up -d
    [+] Running 0/2
    - Network order-service_default Created 0.2s
    - Container mysql Starting 0.2s
    Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:3306 -> 0.0.0.0:0: listen tcp 0.0.0.0:3306: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
    Could you help me fix this error.

    • @anotherOne12342
      @anotherOne12342 Před 2 měsíci +2

      You might have an instance already running on this port. Therefore either close the instance that is running on the port or just change the port by changing the docker-compose.yml ports to -"3307:3306"

    • @priyansusahoo
      @priyansusahoo Před 2 měsíci +1

      @@anotherOne12342 thank you

  • @Sebastian-zs8cp
    @Sebastian-zs8cp Před 3 měsíci

    Why you don't use the dbname in docker-compose in feld MYSQL_DATABASE 2:15 and named there and save great new file? thx

  • @champ853
    @champ853 Před měsícem +1

    Just a heads up for anyone doing this video. I am using the open source version of Intellij IDEA and am unable to create sql files. It just shows as a regular file so when I run OrderServiceApplication it doesn't migrate to version V1

    • @champ853
      @champ853 Před měsícem

      I was able to bypass but making a script in mysql workbench to create t_orders table
      CREATE TABLE order_service.t_orders (
      id INT AUTO_INCREMENT PRIMARY KEY,
      order_number VARCHAR(255) NOT NULL,
      price DECIMAL(10, 2) NOT NULL,
      quantity INT NOT NULL,
      sku_code VARCHAR(255) NOT NULL
      );

    • @keyingxu6738
      @keyingxu6738 Před 26 dny +1

      I had to remove the record in flyway_schema_history, and rerun the application with following sql:
      CREATE TABLE order_service.t_orders (
      id INT AUTO_INCREMENT not null PRIMARY KEY,
      order_number VARCHAR(255) default null,
      price DECIMAL(10, 2),
      quantity INT,
      sku_code VARCHAR(255)
      );

  • @asrarahmad7671
    @asrarahmad7671 Před měsícem

    Make it zoom in

  • @howsusisthis
    @howsusisthis Před 2 měsíci

    My 'order-service' scheme is not being created. I deleted the mysql folder mentioned in volumes and tried again a couple of times.

    • @shouryakhujneri5132
      @shouryakhujneri5132 Před měsícem

      I am experiencing a similar issue. did you manage to fix it ?

    • @samirkumarram5402
      @samirkumarram5402 Před měsícem

      try to write the db name in double quote

    • @vind190
      @vind190 Před 29 dny

      +1, I tried but still having the issue. How to fix it?

  • @shobhitsolanki8717
    @shobhitsolanki8717 Před 3 měsíci

    Sir, Series poori hone m kitna time lgega. I am following along actually 6 din m pichla sara bhul gya

    • @ProgrammingTechie
      @ProgrammingTechie  Před 2 měsíci

      Aur 2 weeks lagega, poora episodes release hone ke bad dekho course. I can only release 2 videos per week.

  • @pradeepravi9608
    @pradeepravi9608 Před 3 měsíci +1

    Sir git link?

    • @ProgrammingTechie
      @ProgrammingTechie  Před 3 měsíci +2

      github.com/SaiUpadhyayula/spring-boot-microservices/tree/initial-setup

    • @ProgrammingTechie
      @ProgrammingTechie  Před 3 měsíci

      The source code will be updated for each part

  • @niteshupadhyay4680
    @niteshupadhyay4680 Před 2 měsíci +1

    Any one getting this error "Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Validate failed: Migrations have failed validation Detected failed migration to version 1 (init). Please remove any half-completed changes then run repair to fix the schema history." then drop flyway history table from your schema and then re run your program now everything will work fine

    • @Uttkarsh_8
      @Uttkarsh_8 Před měsícem

      did you find a workaround??

    • @saurabhvishwakarma3066
      @saurabhvishwakarma3066 Před 28 dny

      @@Uttkarsh_8 follow these steps
      1) Goto to workbench and drop the table named flyway_schema_history
      2) Change the migration script to this
      CREATE TABLE IF NOT EXISTS `t_orders` (
      `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
      `order_number` VARCHAR(255) DEFAULT NULL,
      `sku_code` VARCHAR(255),
      `price` DECIMAL(19,2),
      `quantity` INT(11),
      PRIMARY KEY (`id`)
      );
      now rerun the application.
      if still any error is coming the change the mySql version 8.1.0 in docker-compose.yml file
      i.e. image: mysql:8.1.0
      if still problem is not solved then chhod do 🤣🤣🤣🤣🤣🤣