Spring Boot Microservices Tutorial - Part 3 - Inventory Service
Vložit
- čas přidán 7. 04. 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 Inventory Service
- Database migrations using Flyway
This is where fun begins)
I have deleted the container created for order service. I am grtting an error designated data directory /var/lib/mysql is unusable . How to resolve this
docker compose works for me but the command inside init.sql is never executed for me. anyone else facing same issue?
Resolved..
🙂🙏
By what time period we can expect all the videos of this series to be posted. Asking because I have started old series so if this videos will be posted faster i will resume this series instead of old one. And Thanks for all the work you are doing. Kudos!
You can expect 2 videos per week, every Monday and Friday, there are still 8 more videos to go
Hi @ProgrammingTechie
Greetings
One Question on Integration Test
In most of the projects docker will be running on remote CICD server. not available on Local machine. is it possibelto connect to remote docker host through configs in test cases or should we rely write test first and rely on cicd pipelines for execution.
Hi,
Yes you can use remote docker instance to run the test container tests.
Test containers also provides a cloud offering where it provides a remote docker host to run the tests.
datmt.com/backend/configure-testcontainers-to-use-remote-docker-hosts/
The container name "/mysql" is already in use by container
You have to change the container_name variable in the Docker Compose file to, for example, container_name: mysql1."
When I run the mysql docker container for the inventory service I get an error saying "The container name "/mysql" is already in use by container" even though I have shut down the docker container for the order service. It works when I change the name but I was just wondering how it works for you without changing the name.
Same here
@@mustafaadel9703 same question
I guess he have deleted the container for the earlier service that is why he was not getting any issues.
What appearance theme are you using?
It's Gradianto Midnight Blue
@@ProgrammingTechie thanks!
I am getting an error when you run the application for the first time around 5:44, stating "Detected failed migration to version 1 (init). Any suggestions?
It could be due to a failed flyway migration. Just delete the latest entry from the flyway_schema_history table and run again.
Why do you choose jar instead of war? I have been reading about it and didn't find a proper answer. What I read about is that Jar runs on desktop and has webserver packed into it whereas war file runs inside webserver so you will need to take care of that also while creating a container in docker. Using jar will make sure each of our microservice runs independently.
The second difference I read is JAR files allow us to package multiple files in order to use it as a library, plugin, or any kind of application. On the other hand, WAR files are used only for web applications. Then why are we choosing JAR when our microservice is a web application?
Spring Boot provides us the option of running an embedded tomcat server inside our applications, so that's why there is no need to create a WAR file, you can just create a JAR and run your application.
Also, a JAR file by definition does not contain a webserver packed into it, it's Spring Boot which is providing us this option.
@@ProgrammingTechie thanks
Can you share github link?