Spring Boot Microservices Tutorial - Part 1 - Building Services

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ต.ค. 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 1 of the series, in this part, we will cover:
    The High-Level Architecture of the project
    The Logical Architecture of the project
    Building Product Service
    Writing Integration Tests using Test Containers

ความคิดเห็น • 105

  • @ProgrammingTechie
    @ProgrammingTechie  6 หลายเดือนก่อน +26

    The tutorial series and the upcoming parts includes some changes below compared to the previous Microservices Series:
    - Spring Boot 3
    - Integration Tests using Latest Testing Techniques
    - Spring Cloud Feign for inter service communication
    - API Gateway implementation using Spring Cloud Gateway MVC instead of Spring Cloud Gateway with Webflux
    - Add Circuit Breaker Logic in API Gateway
    - Security using latest Keycloak
    - Distributed Tracing using Grafana Stack instead of Slueth
    - Deployment using Kubernetes
    Link to Written Tutorial: programmingtechie.com/2024/03/28/spring-boot-microservices-tutorial/

    • @calvinmashishi4932
      @calvinmashishi4932 6 หลายเดือนก่อน +2

      Good day,
      Is this the same Microservices course but with Springboot 3?

    • @ProgrammingTechie
      @ProgrammingTechie  6 หลายเดือนก่อน

      The tutorial series includes some changes below:
      - Spring Boot 3
      - Integration Tests using Latest Testing Techniques
      - Spring Cloud Feign for inter service communication
      - API Gateway implementation using Spring Cloud Gateway MVC instead of Spring Cloud Gateway with Webflux
      - Add Circuit Breaker Logic in API Gateway
      - Security using latest Keycloak
      - Distributed Tracing using Grafana Stack instead of Slueth
      - Deployment using Kubernetes

    • @mysticfit977
      @mysticfit977 6 หลายเดือนก่อน

      how long will it take to post all the courses, Sir?

    • @zhang张辉
      @zhang张辉 6 หลายเดือนก่อน

      Sir, will the entire tutorial be free

    • @shrutisharma3469
      @shrutisharma3469 6 หลายเดือนก่อน

      When part 2 is coming?

  • @defrankline
    @defrankline 6 หลายเดือนก่อน +26

    Kindly implement oauth2.0 jwt authorization instead of keyclock this time around

    • @paulkimani6594
      @paulkimani6594 2 หลายเดือนก่อน

      I agree , most systems are utilising oauth2.0 jwt for security implementation

  • @alhasanKhaled
    @alhasanKhaled หลายเดือนก่อน +2

    00:03 Building a Spring Boot application using microservices architecture for an online shop
    02:08 Implementing various services for order processing and notifications
    06:17 Creating a product service using Spring Boot and Maven
    08:39 Setting up MongoDB using Docker Compose in Spring Boot Microservices
    13:36 Configuring MongoDB URI and creating domain model
    15:57 Adding post mapping annotation and creating product request class
    20:43 Creating and saving product objects in the repository
    22:53 Changing the response type for confirmation of product creation.
    27:31 Adding authentication information to MongoDB URI
    29:46 Test containers library can spin up Docker containers for real databases for integration testing
    33:59 Configuring Rest Assured for application testing
    36:08 Creating a test for the product controller endpoint
    Crafted by Merlin AI.

  • @mohammedabbutalha2793
    @mohammedabbutalha2793 5 หลายเดือนก่อน +4

    Hi,
    Am getting AuthenticationFailed for the MongoDB even though I have given the correct entries in the docker-compose.yml and the right connection string in the application.properties. Can you please help me

    • @saujan6289
      @saujan6289 5 หลายเดือนก่อน

      I am getting the same error, Can't get over it.

    • @saujan6289
      @saujan6289 5 หลายเดือนก่อน +1

      I found the problem in my case, I had local instance of mongodb If you have mongodb installed locally uninstall it.

    • @azamatshauenbekov6319
      @azamatshauenbekov6319 5 หลายเดือนก่อน

      @@saujan6289 or change port on 27018*

    • @ritheasenn
      @ritheasenn 4 หลายเดือนก่อน

      @@saujan6289 so I need to uninstall the mongodb locally one in my computer and using only the mongodb in docker instead ?

    • @anotherOne12342
      @anotherOne12342 4 หลายเดือนก่อน

      Had the same issue with an already running instance from the tutorial before. Either stop the old one, or use another port. (Change docker-compose.yml --> port: - "27018:27017" (Host 27018 mapped to 27017 within docker container port))

  • @manhnguyenviet9286
    @manhnguyenviet9286 หลายเดือนก่อน

    Error response from daemon: error while creating mount source path '/host_mnt/Users/vietmanh21/Documents/Project/vmshop/product/data/mysql': mkdir /host_mnt/Users/vietmanh21/Documents: operation not permitted
    Error when docker compose up -d

  • @nihadgurbanov1461
    @nihadgurbanov1461 2 หลายเดือนก่อน +1

    I have used ModelMapper but it didn't work with record due to the use of Java records for ProductResponseDto. Java records implicitly declare their fields as final and provide a constructor, getters, equals(), hashCode(), and toString() methods automatically. However, records do not have a no-argument constructor, which ModelMapper requires to instantiate the class.

  • @methildac3759
    @methildac3759 10 วันที่ผ่านมา

    can someone help me out?
    my application is not starting after all configurations+code.
    the server connects and then disconnects when i run my app.
    im using springboot 3.3.4.

  • @dineshnanda3808
    @dineshnanda3808 29 วันที่ผ่านมา

    Can someone help me in authenticating the mongodb. Checked everything still getting the error.

  • @favio.romero
    @favio.romero 2 หลายเดือนก่อน +4

    These tutorials are pure gold. I started the previous version until the hour 2 when I realised there was a newer version so I'm retracking (enjoyingly) the path until I reach where I left and can continue from there. I can't tell you how much I learnt so far. Thank you !!! This is 5 stars !!!

    • @movietrailer3616
      @movietrailer3616 5 วันที่ผ่านมา

      Is the previous version is same project and can we do modification and continue with newer version?

    • @favio.romero
      @favio.romero 4 วันที่ผ่านมา

      @@movietrailer3616 Well, not exactly. I should have updated my comment. I haven't finished the newer version yet but the differences can be seen on the architectural diagram. At the end I decided to finish the original version and then start the newer one with that base of knowlege. I must say I met (and still meeting) a lot of issues but I could resolve them all so far, they gave me a lot of training in finding, researching and debugging problems. If you have time constraints just go for the newer version but if you don't, I would recommend you to do as I'm doing. Finishing version one successfully is helping me to understand better the spring mindset and how to address the new issues appearing.

    • @movietrailer3616
      @movietrailer3616 3 วันที่ผ่านมา

      @@favio.romero Thanks for your comment I am going with older version then because newer version got Front End technology like Angular which I am not interested also not sure if I skip the angular part still I can continue in newer version playlist. Best luck to you btw you can refer Github link of you find any difficulty.

    • @favio.romero
      @favio.romero 3 วันที่ผ่านมา

      @@movietrailer3616 welcome. I skipped the Angular Part of the newer version, I'll replace it with a REACT exercise later on. I didn't uploaded to github yet, when I do I'll let you know.

  • @ritikmishra8974
    @ritikmishra8974 2 หลายเดือนก่อน

    Hi while hitting post api, i am facing the error authentication failed with error 18 and i tried to give username and password also with authenticationDatabase as admin but it is not working...any suggestions any help??

  • @darkdragon5307
    @darkdragon5307 6 หลายเดือนก่อน +2

    finally, a new tutorial. I will skip this until full episodes are downloaded, though

  • @susparshbanerjee1916
    @susparshbanerjee1916 หลายเดือนก่อน

    Can anyone please explain me why we are not using any @Autowired annotations for object management?

    • @gameanalytic
      @gameanalytic 24 วันที่ผ่านมา

      that annotation is one of the injection types in Spring Boot, calling field injection, aswell with others; constructor and setter injection types. However field injection makes some troubles with testing, during last few years Spring devs not recommending its use, instead we use setter or constructor injection types. Best practise is using constructor injection type.

  • @hrsatsangi
    @hrsatsangi 6 หลายเดือนก่อน +1

    Eagerly waiting for this series thank you Sai for such a great effort
    Love From AGRA ❤❤

    • @shobhitsolanki8717
      @shobhitsolanki8717 5 หลายเดือนก่อน

      Can we pls connect, From Agra too. Lets build a project together.

  • @huynguyenhoang3460
    @huynguyenhoang3460 หลายเดือนก่อน

    HI guys, I'm doing part testing in product-service so there won't be an error message like this:
    java.lang.IllegalArgumentException: JSON input text cannot be null or empty.
    while:
    package com.msnh.product_service;
    import com.msnh.product_service.dto.ProductRequest;
    import io.restassured.RestAssured;
    import io.restassured.parsing.Parser;
    import org.hamcrest.Matchers;
    import org.junit.jupiter.api.BeforeEach;
    import org.junit.jupiter.api.Test;
    import org.springframework.boot.test.context.SpringBootTest;
    import org.springframework.boot.test.web.server.LocalServerPort;
    import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
    import org.testcontainers.containers.MongoDBContainer;
    import org.testcontainers.shaded.com.fasterxml.jackson.databind.ObjectMapper;
    import java.math.BigDecimal;
    @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
    class ProductServiceApplicationTests {
    @ServiceConnection
    static MongoDBContainer mongoDBContainer = new MongoDBContainer("mongo:7.0.7");
    @LocalServerPort
    private integer port;
    private objectMapper objectMapper;
    @BeforeEach
    empty set() {
    RestAssured.baseURI = "localhost";
    RestAssured.port = port;
    RestAssured.defaultParser = Parser.JSON;
    }
    static {
    mongoDBContainer.start();
    }
    @Test
    void shouldCreateProduct() throws Exception {
    ProductRequest productRequest = getProductRequest();
    RestAssured.given()
    .contentType("application/json")
    .body(productRequest)
    .When()
    .post("/api/product")
    .Later()
    .log().all()
    .statusCode(201)
    .body("id", Matchers.notNullValue())
    .body("name", Matchers.equalTo(productRequest.name()))
    .body("description", Matchers.equalTo(productRequest.description()))
    .body("price", Matchers.is(productRequest.price().intValueExact()));
    }
    private ProductRequest getProductRequest() {
    return new ProductRequest("iPhone 13", "iPhone 13 black 512gb", BigDecimal.valueOf(1200));
    }
    }
    please help me

  • @ugveydev
    @ugveydev 6 หลายเดือนก่อน +1

    Course is very good brother I was learning from the old series also was good but this one is really great I think

  • @ruhuseyn
    @ruhuseyn 6 หลายเดือนก่อน +1

    I am very excited about this tutorial. Your explanation is awesome. Good luck

  • @davidontiveros2895
    @davidontiveros2895 5 หลายเดือนก่อน +1

    Appreciate all the new content. Question, how is this different from the current playlist you have ? The one you posted a year ago ? Trying to figure out if I should just start with this one or keep watching the old one.

    • @ProgrammingTechie
      @ProgrammingTechie  5 หลายเดือนก่อน +1

      This is the more relevant playlist and more detailed, check the pinned comment

    • @davidontiveros2895
      @davidontiveros2895 5 หลายเดือนก่อน +1

      @@ProgrammingTechieappreciate it. Didn’t see the comment 🤦🏻‍♂️. Your content is very helpful.

  • @nikitapujahari1624
    @nikitapujahari1624 4 หลายเดือนก่อน

    HI Sir,
    Is this series is free?? Or we need to take subscription.
    How many upcoming classes are there??

  • @Sebastian-zs8cp
    @Sebastian-zs8cp 5 หลายเดือนก่อน

    hi, your graphic is wrong 3:50 and special your arrows for sync. comm and unsync. comm. it make me confius. sync. comm = and unsync. comm = ->....can you straighten that out?

  • @srikarsharma9628
    @srikarsharma9628 4 หลายเดือนก่อน

    can this project be developed on a macbook Air..looking at so many software components that were used ?

  • @prasanthsanjeevi2563
    @prasanthsanjeevi2563 5 หลายเดือนก่อน

    @ProgrammingTechie Your training is awesome, why cant you make udemy course?

  • @prashish2022
    @prashish2022 หลายเดือนก่อน

    IS there a github repo

  • @samipdave1589
    @samipdave1589 15 วันที่ผ่านมา

    amazing video bro

  • @karthikr3259
    @karthikr3259 4 หลายเดือนก่อน

    Thank you for the videos, Could you please also cover Microservices design patterns and principles

  • @Coolpratik10
    @Coolpratik10 5 หลายเดือนก่อน

    Which one should i continue sir ji .. The previous one that you posted a year back "Apr 23, 2022 Spring Boot Microservices Full Course" or this one ? @ProgrammingTechie

  • @azamatshauenbekov6319
    @azamatshauenbekov6319 5 หลายเดือนก่อน

    how ide authomatic write code? do tutor, please)

  • @anandlshinde
    @anandlshinde 5 หลายเดือนก่อน

    @PragrammingTechie Thanks for creating this series
    I followed the same steps for docker. same configuration was added in docker-compose file but still I am facing the below error while executing docker compose up -d command. can anyone guide me here to resolve this issue? Thank in advance!
    `version` is obsolete"
    error during connect: this error may indicate that the docker daemon is not running

    • @BrainRainGoAway
      @BrainRainGoAway 4 หลายเดือนก่อน

      is you docker client running in background ?

  • @HaniDaddy
    @HaniDaddy 6 หลายเดือนก่อน

    Wow that's a great tutorial, can you please add frontend frameworks like React or Angular for this series.

  • @poornima.dpreethi4546
    @poornima.dpreethi4546 5 หลายเดือนก่อน

    Why Eureka is used when client side server zookeeper is present

  • @AmitDobal
    @AmitDobal 2 หลายเดือนก่อน

    Thanks for the video. One suggestion, the font is very small. It's very hard to see in laptop.

  • @shouryakhujneri5132
    @shouryakhujneri5132 4 หลายเดือนก่อน

    Did Anyone face any issues with integration tests ?
    while writing the test case for shouldCreateProduct method,
    it is asking me to typecast it to ResponseAwareMatcher) like this : -
    .body("id", (ResponseAwareMatcher) Matchers.notNullValue())
    .body("name", (ResponseAwareMatcher) Matchers.equalTo("iphone 15"))
    Can someone please help with this ? @ProgrammingTechie

  • @elizabethr5161
    @elizabethr5161 2 หลายเดือนก่อน

    Awesome Tutorial, Thanks a lot Sai..

  • @nailtagiyev6340
    @nailtagiyev6340 6 หลายเดือนก่อน +1

    Cool. Thanks for the course!

  • @szymonnizioek3810
    @szymonnizioek3810 6 หลายเดือนก่อน

    Very helpful video! I have one question about your model class: why is it anomic (consisting of a setter, getter, such as a value object) instead of being a rich business entity class (which contains some state, behavior, and validations)?

    • @ProgrammingTechie
      @ProgrammingTechie  5 หลายเดือนก่อน

      I want to keep this simple :) , in this tutorial, I am mainly concentrating on the surrounding technologies instead of each individual project.

  • @dineshdevagalla2918
    @dineshdevagalla2918 หลายเดือนก่อน

    Please let me know what are the prerequisites that i needed, to complete the tutorial with ease. @ProgrammingTechie

    • @ProgrammingTechie
      @ProgrammingTechie  หลายเดือนก่อน

      This is the first thing I mentioned in the video, try watching at least the first 10 seconds

  • @张云勇
    @张云勇 6 หลายเดือนก่อน

    where can I get the source code of the course

  • @youssefzahi3418
    @youssefzahi3418 5 หลายเดือนก่อน

    Can you implement oauth2.0 jwt authorization instead of keyclock this time around

    • @ProgrammingTechie
      @ProgrammingTechie  5 หลายเดือนก่อน

      Can you explain more about what you mean ? If you want to use OAuth2 then you have to use any authorization server like Keycloak/Auth0/Okta
      You cannot implement OAuth2 without it.
      If you want to just have JWT Authentication and Authorization without using Keycloak, then I have to tell you that's not a standard practice in the real world.
      JWT auth is used only when you are using monolithic apps.

  • @hugofernando846
    @hugofernando846 6 หลายเดือนก่อน

    Thank you man! Very good explanation! Keep going. :D

  • @tabrezshaikh7705
    @tabrezshaikh7705 6 หลายเดือนก่อน

    Thanks a lot! I was waiting for this. Any idea, by when will all the episodes of this tutorial be released? Also, what is the total watch time of this complete series?

    • @ProgrammingTechie
      @ProgrammingTechie  5 หลายเดือนก่อน +1

      Hey, it will take 2 more weeks to release the whole course, I don't know the total watch time, but it will be greater than 6 hours

  • @Sebastian-zs8cp
    @Sebastian-zs8cp 5 หลายเดือนก่อน

    In 8:06 why you don't take the cloud lib and why u use maven not gradle becous it is faster as maven?

    • @ProgrammingTechie
      @ProgrammingTechie  5 หลายเดือนก่อน

      I don't know if Maven is faster than Gradle, for me I am more used to Maven, and I see no reason to switch to Gradle.

  • @luigiscottorosato2977
    @luigiscottorosato2977 6 หลายเดือนก่อน

    What will you use to keep secrets? hashicorp? I think you didn't use it in the other tutorial

  • @mustafaadel9703
    @mustafaadel9703 5 หลายเดือนก่อน

    Can you explain why did you use mongo with the product service ?

    • @faixan13
      @faixan13 4 หลายเดือนก่อน

      because product data is usually unstructured means every product can have different attributes as we dont need rigid schema for that or proper relationships.

  • @gerardsegismundo8931
    @gerardsegismundo8931 6 หลายเดือนก่อน +1

    thank you. can you pls do or add aws to it?

    • @ProgrammingTechie
      @ProgrammingTechie  6 หลายเดือนก่อน +3

      I will not be covering this in this series.
      Deploying Kubernetes to AWS EKS is first of all not covered in the free tier.
      You will be charged for the usage of AWS.
      In my paid course I will be covering deployment to cloud with the deployment to GCP.

    • @joelravanely8914
      @joelravanely8914 6 หลายเดือนก่อน +1

      regarding the paid course, will there be a frontend? like Angular?@@ProgrammingTechie

  • @alexanderay2585
    @alexanderay2585 5 หลายเดือนก่อน

    Hello, will you create frontend for this project? thanks

    • @ProgrammingTechie
      @ProgrammingTechie  5 หลายเดือนก่อน +1

      Frontend is not planned for this series

  • @Ben-vz6zm
    @Ben-vz6zm 3 หลายเดือนก่อน

    exactly what i am looking for!!!

  • @sumanta8504
    @sumanta8504 5 หลายเดือนก่อน

    Nice video. But the font size is very small, and watching on the laptop is very difficult, please increase the font size in future videos.

    • @ProgrammingTechie
      @ProgrammingTechie  5 หลายเดือนก่อน

      I increased the font size in the latest 2 videos, got a new monitor recently that messed up the recording resolution 😔

    • @sumanta8504
      @sumanta8504 5 หลายเดือนก่อน +1

      @@ProgrammingTechie I used my big monitor to watch the video and the laptop screen for IntelliJ. Normally, I do it the other way around, but I switched because of the font size. Anyway, it's not a big problem when you have great content :)

  • @shrutisharma3469
    @shrutisharma3469 6 หลายเดือนก่อน

    One word::- Wow....such an amazing course.

  • @NaTa-qn4yv
    @NaTa-qn4yv 4 หลายเดือนก่อน

    Good. Thanks for the tutorial!

  • @nawwintphyu1873
    @nawwintphyu1873 2 หลายเดือนก่อน

    Thank you so much!

  • @prashlovessamosa
    @prashlovessamosa 6 หลายเดือนก่อน

    Sai sir what are the prerequisite to start with this i can build a rest api with Spring Boot but hav no exp with k8s should i learn that first ?

    • @ProgrammingTechie
      @ProgrammingTechie  6 หลายเดือนก่อน

      No need I will start with basics of k8s

    • @prashlovessamosa
      @prashlovessamosa 6 หลายเดือนก่อน +1

      @@ProgrammingTechie Great

  • @raghavanaliassaravananm1546
    @raghavanaliassaravananm1546 6 หลายเดือนก่อน

    Lovely. Thank you for the series Sai.

  • @kunaiEUW
    @kunaiEUW หลายเดือนก่อน

    Thank you for this course ! just want to know why didn't we use a discovery service?

    • @ProgrammingTechie
      @ProgrammingTechie  หลายเดือนก่อน

      We use Kubernetes for service discovery

    • @kunaiEUW
      @kunaiEUW หลายเดือนก่อน

      @@ProgrammingTechie Thank you for your response, so why dont we call services with their names instead of url? how can we manage multiple instances

    • @ProgrammingTechie
      @ProgrammingTechie  หลายเดือนก่อน

      @@kunaiEUW Kubernetes manages it by itself if we have multiple instances, it does the load balancing,.
      we are using the service names itself, the url is constructed using the service name, if you are making a http call then you have to create a url according to the http specification.

  • @ayanluap
    @ayanluap 2 หลายเดือนก่อน

    Pure Gem!!!!!!!

  • @SunilRathod-d9r
    @SunilRathod-d9r 5 หลายเดือนก่อน

    excited for playlist

  • @minhhieuo1043
    @minhhieuo1043 6 หลายเดือนก่อน

    thanks bro!

  • @BiswajitSamalOdisha
    @BiswajitSamalOdisha 6 หลายเดือนก่อน

    Thank you

  • @rubbish9231
    @rubbish9231 6 หลายเดือนก่อน

    Nice

  • @Yourmothersmuff
    @Yourmothersmuff 2 หลายเดือนก่อน

    Awesome I was waiting for this.

  • @Shopme-ty2wv
    @Shopme-ty2wv 6 หลายเดือนก่อน

    Very good Explanation.
    when the next part be released?