How to generate PDF report from MySQL database in Spring Boot

I am going to show yo how to download PDF file from MySQL database using Spring Boot and iText library in Java programming language. Many applications require dynamic generation of PDF documents for reporting purpose, such as, generating statements for customers, readers buying online specific chapters of a book, etc. In my another tutorial I had shown how to create or write to a PDF file using Java based iText library. The iText library is freely available and can be used using maven or gradle build tool. We can also…

Continue

How to generate Excel Report from MySQL Database in Spring Boot

Here I am going to show you how to download excel file from MySQL using Spring framework. Generating excel report from MySQL database has few advantages over other file formats. Most of the people you are working with in your organization are familiar with excel file format, hence it needs a short learning curve. You may also like to read how to download json file in Spring Boot. The excel file has other benefits as given below: It allows you to use templates and formulas to aggregate data. It has…

Continue

Docker Compose – Dockerizing Spring Boot Microservices MySQL App

Introduction Here I am going to show you how to use docker compose for dockerizing Spring Boot Microservices MySQL app. Docker Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration. You know that it is a best practice for a container to have only one process with single responsibility. But as I am going to dockerize Spring Boot Microservices app and MySQL…

Continue

How to Trace Microservices Logs with Spring Cloud Sleuth and Zipkin

Introduction Here I am going to explain how to trace Spring Boot Microservices logs with Spring Cloud Sleuth and Zipkin Server. Spring Cloud Sleuth provides Spring Boot auto-configuration for distributed tracing. One of the problems most developers face difficulty of tracing logs as your microservices applications grow and requests propagate from one microservice to another microservice. So it could be quite part to try to figure out how a particular request travels through the application when you don’t have any idea regarding the implementation of microservices you are calling.

Continue

Create, Build, Package and Run Spring Boot Application with Docker in CentOS 7

Introduction Here in this tutorial I am going to show you how to create a simple Spring Boot application. Then how to build, package and run this Spring Boot application with Docker in Linux environment (CentOS). I am going to use both gradle and maven as build tools for running build on this Spring Boot application. In my previous tutorial I had discussed how to install docker on CentOS 7. I am not going to tell you here why do you need docker but you can read it from my…

Continue

How include required gradle project into another project

Here I will tell you how to include the required gradle project into another project. Situation may occur when you need to have dependency of another gradle project into your current gradle project, but neither of these projects is a multi-module project. So in this case you can easily add the required project into your current working project. To include another gradle project you need to edit the settings.gradle file of the current project. In the current project’s settings.gradle file, you have to add the project’s name which you want…

Continue

How to upload multiple files using Spring REST API

Introduction Here in this tutorial I am going to tell you how to upload multiple files using Spring Boot REST API. I had also shown you in my another example how to upload single file using Spring Boot REST API framework. For uploading file(s) you can use any client, for example, browser or any REST client (Postman) that supports for uploading of files. Even you can write client side code using HTML, CSS jQuery/JavaScript or React JS, Angular etc. to upload multiple files.

Continue

Spring Asynchronous Request Processing via DeferredResult Class

Introduction I am going to discuss here how to perform asynchronous request processing via Spring’s DeferredResult class. A DeferredResult can be used when the application wants to produce the return value from a thread of its own choice. A DeferredResult is what is possibly not-yet-finished computation that will be available in future. Spring MVC 3.2 introduced a Servlet 3 based asynchronous request processing. Normally once request processing is finished, you leave the controller handler method, but it is not the same case with DeferredResult. Spring MVC will hold on with…

Continue

Spring Centralized Runtime Properties Configuration without refreshing the Client

Introduction This tutorial walks you through the process of consuming the configurations from the Spring cloud config server. So we will setup a config server and build a client application consumes the configuration on startup and then refreshes the configuration without restarting the client. Let’s say you have some configuration values which may be changed during runtime and it is not possible always to restart your application and change the configuration values. Here Spring configuration helps us to externalize our properties or configurations.

Continue

GraphQL Spring MySQL CRUD Example

Introduction The tutorial, GraphQL Spring MySQL CRUD example will show you how to build CRUD (Create, Read, Update, Delete) operations using GraphQL with Spring Boot framework. We will use MySQL database server for storing data and Spring Data JPA to perform database activities. My previous tutorials on GraphQL explained about how to wrap REST APIs instead of converting them into GraphQL APIs. I explained on this using Spring Boot and NodeJS technologies.

Continue