Command Line Runner in Spring Boot.

In this post, We will take a look at Command line runner in Spring Boot and how to implement them properly with an example. Typical Java Implementation Let’s take a small example in pure java. The above class is an example of a command line application. The application takes two command line arguments, then calculates…

Spring Boot Banner – Complete Guide

In this post, We will learn how to customize startup banner of a spring Boot application. Also, we will understand how we can use an image or gif file as a startup banner. Take a look at our Hello World Application. As you see, the default at the spring boot startup banner looks like below….

RESTful JPA Repositories with Spring Boot

In this post we will see how to create restful endpoints from JPA Repositories in a Spring Boot application. Introduction In the HATEOAS implementation tutorial, we pretty much save and retrieve data from the database. But there is too much boilerplate code for just managing the data(Controller methods). In situations like these, Spring Data REST comes…

Startup Actuator Endpoint in Spring Boot

This post will learn more about the new Startup Actuator endpoint and how we can use it to optimize the startup time of Spring Boot applications. Spring Boot startup sequence is a complex process. We can speed the Spring Boot application startup by tracking the application startup events. Till now we didn’t have an easier…

HTTP Error codes based on Exception in Spring Boot

In our previous installment, We have made sure our application follows a hypermedia format called HAL. However, At most of the controller methods, we have been throwing RuntimeException. These by design would cause 500 Error codes. But REST principles dictate that proper message or indication must be given back to the client when possible. For example,…

Spring Boot file Upload with Examples

In this post, we will see how to upload single or multiple files in Spring Boot using the MVC features of the WEB starter. What is a multipart File Upload request? There are three types of payloads in POST requests. The Request Body is a bunch of URL-encoded parameters The Request Body is RAW/Binary content….

Spring Boot HATEOAS for RESTFul Web Services

In this article, We will learn how to implement hateoas in a Spring boot restful web application. Introduction to HATEOAS Hypermedia is the most important aspect of RESTful services. To explain in short Hypermedia is a format where the response for one resource contains links to other resources that are related. Any system that uses…

RESTFul Web Services with Spring Boot

To understand RESTful API or RESTful web services, You first need to understand what an API is. API(Application Programming Interface) is a software/application/library/mechanism that helps one program to communicate with another. The most widely used API types are web-APIs or web services. In this type, a client sends an HTTP request, and the server sends…

Spring Boot and Zipkin for Distributed Tracing

In this post, We will learn how to use Zipkin with Spring Boot for distributed tracing. Spring Boot is currently the first choice of Developers to create microservices. With multiple services in place, Traceability of a single request can be cumbersome. Here is Zipkin to the rescue. Zipkin Architecture Zipkin is a distributed tracing tool that has…