Before we proceed, be sure the check out the spring-cloud-config. Depending on your use case, this might be what you want , Spring Cloud Config. Lets say that we have following .properties files in our project: application.propertiesapplication-dev.propertiesapplication-prod.propertiescustom.properties Spring will use these files, if we do not tell it otherwise. We can override the location of … Continue reading Spring external .properties file
Category: Spring
Spring, Spring Boot
Remote debugging Spring Boot App
I have an application running on a remote server and I need to debug it. Don't worry, server is firewall-ed and access is strictly controlled. What we want to achieve is to run the spring boot application in debug mode. We need to tell the VM to run in debug, how we will connect to … Continue reading Remote debugging Spring Boot App
Run SpringBoot application in Docker image
This is a short recipe on how to run your spring boot application within a docker image. The idea comes from John Thompson's docker for java developer course, so be sure to check it out here https://www.udemy.com/docker-for-java-developers/. What do we want to accomplish? Create a fat (uber) jar of our applicationCreate a Docker file (a … Continue reading Run SpringBoot application in Docker image
Spring Boot?
While we can talk a lot about Spring Boot's opinionated views and it's auto-configuration classes.... https://spring.io/projects/spring-boot "A picture is worth a thousand words." I found pretty much the best explanation there is, purely by accident. I am stealing the image and putting the source link below 😉 https://medium.com/@sampathsl/exception-handling-for-rest-api-with-spring-boot-c5d5ba928f5b
Spring properties
There are a lot of tutorials and examples on how to use spring properties, be it a .properties or .yaml file. Here, we will take a look at most common scenarios. Lets see how we can: Inject a property value into a field, using @Value annotation Use a property value inside annotation Have a list … Continue reading Spring properties