Java

In this tutorial you will learn how to use Spring Cloud Bus to notify running Microservices about the changes in Spring Cloud Config property file. Running Microservices will be updated with new properties stored in Spring Cloud Config file without the need for you to restart them. These way you can update values in a…

Read More Spring Cloud Bus – Refreshing Config Changes

In this tutorial you will learn how to download, install and run Rabbit MQ on your computer. I am also going to show you how to change default Rabbit MQ Administrator password and how to create a new user. Download, Install and Run Rabbit MQ To download Rabbit MQ for your computer, visit the following…

Read More Rabbit MQ – Download, Install and Change Password

In this short Spring Boot tutorial I am going to show you how use @Validated and @Email annotations to validate email address sent to a RESTful Web Service in HTTP GET Request. If you are looking for an example of how to validate email address sent in HTTP POST request, please have a look at my…

Read More Spring Boot – Validate Email in @RequestParam

In this tutorial on Spring Cloud you will learn how to create your own Spring Cloud Config Server and also, how to configure a Spring Boot Application to be a Spring Cloud Config Client. Spring Cloud Config Server Spring Cloud Config Server is a Spring Boot application. So to create our own Spring Cloud Config…

Read More Spring Cloud Config Server and Config Client

In this tutorial you will learn how to use Zuul API Gateway to enable the load balancing of your RESTful Web Services registered with Eureka Discovery Service. Because Zuul API Gateway internally uses Ribbon Load Balancer there is almost nothing you need to do to have this load balancer work for you. To be able…

Read More Zuul and Eureka – Load Balancing Example

Spring Boot has a nice feature which enables the application to automatically restart when you make a change to your Java code. This automatic restart of your application is often called Hot Swap. Spring Boot Dev Tools Dependency To enable your Spring Boot application to automatically restart when you make a change to your Java…

Read More Spring Boot Hot Swap or Automatic Restart

In this tutorial on Spring Framework you will learn how to use constructor-based dependency injection(DI) in Spring Framework when building RESTful Web Services. Injecting an Object Let’s assume we need to inject a Utility class into a Service class we have. Below is an example of a UserService class which uses Constructor-Based dependency injection to…

Read More Constructor-Based Dependency Injection in Spring

In this tutorial, you will learn how to use the @Autowired and @Qualifier annotations together to auto wire a specific Bean. Sometimes you might have more than one Bean of the same type and if you do not explicitly specify which one you would like to auto wire, you will get an NoUniqueBeanDefinitionException when starting up…

Read More How to Use @Autowired and @Qualifier in Spring

In this short Spring Boot tutorial, you will learn how to pass command-line arguments to your Spring Boot application. Passing Command-Line Arguments To pass command line arguments to your Spring Boot app when running it with Maven use the -Dspring-boot.run.arguments. In the below code example, I will pass two command-line arguments: firstName and lastName. mvn spring-boot:run…

Read More Pass Command-Line Arguments to Spring Boot Application