Search results for #SpringBootTip
A practical tip for Java Developers by @vlad_mihalcea - well-known Java Champion and author of "High-Performance Java Persistence." Get the industry-best Java Spring Boot developers: bit.ly/3tO2UML #java #javaspringboot #springboottip #softwaredevelopment #trootech
I'm observing @QuarkusIO for a long time. I think it's time to consider migration from Spring Boot into Quarkus especially if you develop on the Kubernetes-native platform. You may expect some tips in the near future - smth similar to #SpringBootTip series some months ago.
Spring Boot Tip 💡 To expose liveness or readiness probes for #Kubernetes set property management.endpoint.health.probes.enabled to true. To include components to the probe use management.endpoint.health.group.{probe}.include, e.g. for MongoDB include "mongo" component 🍃 #SpringBootTip
Spring Boot Tip 💡 Are you looking for a reactive, declarative HTTP client for Spring Boot apps ala Spring Cloud OpenFeign for synchronous communication? Use a reactive version of Feign client provided by @playtika. 🍃 #springbootTip #springboot
Spring Boot Tip 💡 You can run a Docker container with Testcontainers in your tests using @testcontainers and @container. Since Testcontainers sets randomized ports, you need DynamicPropertySource annotation to obtain the port number and set it as a property. 🍃 #SpringBootTip
Spring Boot Tip:💡 Inspired by @piotr_minkowski :) Starting with @springboot 2.4 you have the option to monitor beans initialization time at application startup using FlightRecorderApplicationStartup class. Events are recorded to @java flight recorder. #SpringBootTip 👇👇👇👇
Spring Boot Tip 💡 You can change the default location of the Spring configuration file with "spring.config.location". The priority of property sources is determined by the order of files in the list. The most significant is in the end. 🏷️ #SpringBootTip #SpringBoot
New post: 🍃Spring Boot Tips, Tricks and Techniques - a summary of my list of #SpringBootTip-s previously shared on Twitter. @nicolas_frankel @mikemybytes @wimdeblauwe @odrotbohm @rieckpil thanks for your valuable opinions & suggestions. piotrminkowski.com/2021/01/13/spr…
Spring Boot Tip 💡 With the Dekorate project, you won’t create any Kubernetes YAML manifests manually, but just use annotations. Set build and deploy parameters during the Maven build to generate manifests and deploy an app on Kubernetes 🕸️. #SpringBootTip #SpringBoot
#SpringBootTip 💡 ❗️Be careful when running Spring WebFlux on a Docker container with Java <10. By default, Spring WebFlux sets a size of worker thread pool = available CPUs (min 4). But Java <10 does not recognize CPUs available on the container, but on the whole machine.
Spring Boot Tip 💡 Inject Git data into the application Step 1⃣: Include "git-commit-id-plugin" to the plugins and build your project. Step 2⃣: Inject "git.properties" to the application using the "GitProperties" bean. 🏷️ #SpringBootTip #SpringBoot
Spring Boot Tip 💡 Error handling with Spring MVC 1⃣ Use a global error handler with "ControllerAdvice". 2⃣ Throw "ResponseStatusException" inside the controller method. 🏷️#SpringBootTip
Spring Boot Tip 💡 Rollback transaction after each test If you need to rollback changes in the data after each test, avoid doing it manually. Instead, just annotate your test class with "Transational". Rollback is default behavior in the test mode. #SpringBootTip
Spring Boot Tip 💡 How to ignore not existing config file? Option 1: Set the "spring.config.on-not-found" property to "ignore". Option 2: Use the "optional" keyword in the config file location. #SpringBootTip
Spring Boot Tip 💡 How to define multiple conditions combined with logical "OR" on a bean? Create a class that extends "AnyNestedCondition", put there all your conditions, and then use it with "Conditional" annotation. #SpringBootTip
Spring Boot Tip 💡 Generate a random HTTP port number Option 1: Set the "server.port" property to 0 Option 2: Set a random port in a custom predefined range, e.g. 8000-8100, with no guarantee that it will be unassigned #SpringBootTip
Spring Boot Tip 💡 How to inject Maven data into an application? Option 1: Use special placeholders with 'project' prefix and "@" delimiter Option 2: Generate 'build-info' properties with Spring Boot Maven Plugin and inject them using BuildProperties. #SpringBootTip