Comments on: Microservices with Spring Boot 3 and Spring Cloud https://piotrminkowski.com/2023/03/13/microservices-with-spring-boot-3-and-spring-cloud/ Java, Spring, Kotlin, microservices, Kubernetes, containers Wed, 21 Feb 2024 21:36:13 +0000 hourly 1 https://wordpress.org/?v=6.9.1 By: piotr.minkowski https://piotrminkowski.com/2023/03/13/microservices-with-spring-boot-3-and-spring-cloud/#comment-2313 Wed, 21 Feb 2024 21:36:13 +0000 https://piotrminkowski.com/?p=14062#comment-2313 In reply to Kamal.

Did you run the apps with `docker compose up` after building images? Or somehow differently?

]]>
By: piotr.minkowski https://piotrminkowski.com/2023/03/13/microservices-with-spring-boot-3-and-spring-cloud/#comment-2312 Wed, 21 Feb 2024 21:35:07 +0000 https://piotrminkowski.com/?p=14062#comment-2312 In reply to MPG.

Yes, there was a problem after migration to java 21 with the jib base image. I fixed it. Build with that command: `mvn clean package -DskipTests -Pbuild-image`

]]>
By: piotr.minkowski https://piotrminkowski.com/2023/03/13/microservices-with-spring-boot-3-and-spring-cloud/#comment-2311 Wed, 21 Feb 2024 21:33:39 +0000 https://piotrminkowski.com/?p=14062#comment-2311 In reply to Joe.

Hi,
There was a problem with jib after migrating to java 21. I just fixed it. Remember to build all the images with this command: mvn clean package -DskipTests -Pbuild-image. I’m using jib in config and discovery instead of cnb, because the base image contains curl.

]]>
By: MPG https://piotrminkowski.com/2023/03/13/microservices-with-spring-boot-3-and-spring-cloud/#comment-2222 Wed, 20 Dec 2023 10:52:12 +0000 https://piotrminkowski.com/?p=14062#comment-2222 A few things I experienced along the way to getting this running:
1. I had to add my own base images in the maven plugin config to use openjdk:21 since it was defaulting to a 17.x base image that was not compatible.
2. I had to run docker-compose up multiple times to get the application up, as it deemed the first two services as unhealthy on startup, despite there being no errors in the logs. Seems the healthcheck didn’t work, and I’ve checked curl was installed on the relevant images.

]]>
By: Joe https://piotrminkowski.com/2023/03/13/microservices-with-spring-boot-3-and-spring-cloud/#comment-2205 Mon, 20 Nov 2023 22:53:54 +0000 https://piotrminkowski.com/?p=14062#comment-2205 In reply to piotr.minkowski.

Hi Piotr. I did a test and the base image of each container doesn’t have the command curl in the path. For this reason, the config service started but unhealthy.

]]>
By: Kamal https://piotrminkowski.com/2023/03/13/microservices-with-spring-boot-3-and-spring-cloud/#comment-2175 Thu, 02 Nov 2023 06:46:40 +0000 https://piotrminkowski.com/?p=14062#comment-2175 Thanks for the article and the project source code.

1. Same as few others, I have noticed that the swagger ui loaded via Gateway service fails to invoke other services. Maybe in the swagger there must be a way to rewrite the URLs to gateway again as the swagger-ui is invoking URLs directly on each of the microservices.

Request from swagger-ui:
curl -X ‘GET’ ‘http://host:org-app-port/1/with-departments-and-employees’ -H ‘accept: */*’

Response:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://host:org-app-port/1/with-departments-and-employees. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

2. I am noticing a tracing related problem.

When I invoke the organizations service via the gateway which results in invoking both department and employee services using http://localhost:8060/organization/1/with-departments-and-employees, I was expecting a trace which spans across all these services. However, it does show a trace starting from gateway service but ending at organization service; but the other two calls are not linked to this trace. They are showing two new traces.

]]>
By: Hendi Santika https://piotrminkowski.com/2023/03/13/microservices-with-spring-boot-3-and-spring-cloud/#comment-2141 Thu, 21 Sep 2023 13:07:01 +0000 https://piotrminkowski.com/?p=14062#comment-2141 In reply to Raul Zamora.

I have same issue when try to hit another service using Swagger UI.

It said error to fetch service or CORS issue.

Could you check again the centralize Open API Doc?

Thanks

]]>
By: piotr.minkowski https://piotrminkowski.com/2023/03/13/microservices-with-spring-boot-3-and-spring-cloud/#comment-2132 Wed, 13 Sep 2023 13:46:14 +0000 https://piotrminkowski.com/?p=14062#comment-2132 In reply to df.

What do you mean? You can try it all using the `docker compose up` command.

]]>
By: df https://piotrminkowski.com/2023/03/13/microservices-with-spring-boot-3-and-spring-cloud/#comment-2125 Fri, 08 Sep 2023 04:50:12 +0000 https://piotrminkowski.com/?p=14062#comment-2125 this config server not connect to working

]]>
By: piotr.minkowski https://piotrminkowski.com/2023/03/13/microservices-with-spring-boot-3-and-spring-cloud/#comment-2087 Tue, 22 Aug 2023 08:20:54 +0000 https://piotrminkowski.com/?p=14062#comment-2087 In reply to Mandar Kulkarni.

Yes, I’ll prepare such an article in the fututee. Thanks for suggestion

]]>