Learn about Spring boot, microservice V1

Tram Ho

Hi everyone, recently I started to hear about the term microservice. What is it, what is its application, should it be used in programming? So I went online to find out and try to play it for a bit. About the advantages I learn of the microservice can be summed up by 2 dispersed and flexible words. I read, read and summarized Mr. Moises Macero. If you search and read online we will realize that most of the applications in that guide are not suitable for a real project, when we want to apply to something bigger then the guides That is not suitable.

  • The big items we will explore though may not be fully understood but also the application of its cool development method:
  • We will use Spring boot to demo.
  • Developed according to the Test-Driven development method (the principle will be to write unit tests before completing the logic functions.it will obviously run fail because at this time we have only declared the method, but did not write anything in it, then I have just completed the logic gradually so that the test case will run properly. Grab the skirt one sentence: I wrote all the wrong things first and I corrected them).
  • Next will cover microservice offline. Because the microservice heard through our name, we can already imagine that it will split the service, but then the system will still work, there are several separation methods as follows: Service discovery, API gateway, load balancing.
  • Then there are 2 more concepts: Event-Driven system and end-to-end testing: these 2 things I don’t feel good right now, or I’ll update them later. -Join the code, use comand to run I’ve never tried and with me, I use netbean 11 to code spring offline. Ae up the spring initializer generate 1 maven project okay the parameters have selected maven already, java 8 is okay, dependece just leave it blank.
  • The scope of the application we are writing is as follows. To test the capacity as well as improve the computing skills of the user everyday. The program will show 2-digit multiplication, and the user will enter the name and the value of the result, the user calculates and fills the result. Everyone, and then the program will return true or false. OK clear the idea of ​​the problem. Handshake each method only. Just now, you have downloaded the code on Spring init already, open and write the necessary packages and classes.
  • Class Multiplication:
  • an interface
  • An application:
  • Most importantly, in the style of Test-Driven development, we need to set up the test first:
  • You can see the source code here and give me some motivation. https://github.com/quangnhse05858/Social-multipli-app-V1 Pause V1 here, this is my first blog, you need to clear where the comment is so I know, fix and add it in the next ver Please.
Share the news now

Source : Viblo