Hi all, In this Tutorial, i will be talking about template based Email using spring boot application.

To implement Email Functionality with spring boot We require below dependencies .

  1. FreeMarker (As we are going to use FreeMarker template for our Email Html and content)
  2. JavaMail Api(Api for sending java mails).

Whole source code can be found on my github repository

Lets first define and create Models, controller and other classes which we require to send email.

  1. EMail.java , A simple Pojo for having To,From,model and content to send mail.
  2. MailSender.java , A Service to send email
  3. emailtemplate.flth

First thing we…


Recently i worked on a java microservice which was reading records from a csv file and inserting or updating into database through sql procedure. Database was Microsoft SQL.

Initially i wrote a simple java program, which was reading record one by one from CSV and was inserting that record into database. and it was working fine. However there was an issue , Issue was performance of insertion or updation of records in database. with one record at a time it was taking roughly 1 minute for 1000 insertion or updation and if i had 18000 records , it was taking…


Spring Boot Admin is a web application, used for managing and monitoring Spring Boot applications. As no of microservices is more , it become difficult to manage and monitor them . that is where Spring Boot Admin come into picture.

Each microservice is considered as a client and register to the admin server(Spring Boot Admin) . Behind the scenes, Spring Boot Admin uses Spring Boot Actuator endpoints.

I have created a tutorial on spring actuator as well , which can be read from below link and admin server dependency in pom.xml of admin server.

<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-server</artifactId>
</dependency>

After this…


Spring Boot Actuator is a sub-project from spring boot framework, It helps us to monitor and manage our application. we can gather all these info using jmx or http endpoints.

To include in your maven spring project , you have to add below dependency in your pom.xml

<dependencies>    
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId> </dependency>
</dependencies>

Spring boot actuator provide various built-in features , ready-to use in production. You get below endpoints without writing a single line of code. However we have to enable some the endpoints for use.

The following technology-agnostic endpoints are available:

auditevents

Exposes audit events information for the current…


Moving your monolithic application to microservices architecture gives us immense benefit. Now we need to deploy only services ,which we changed. we can have seperate team working on seperate microservice without impacting each others. We can develop different microservices in different language and platform. However all these benefits comes with lot of headaches.

When you have 20–30 microservices, dev, test, stage, prod environment. Each env has different version of microservice. It become quite difficult to track ,What code is deployed on which environment on kubernetes. did my code get update after deployment. From which branch , Which commit from git…


Recently i got a chance to work on microservices ,In existing code i observed some annotations in my pojo or JPA entities and did not see any setter or getter for properties defined. But in my whole code getter and setter were getting used .I realized there is something going behind the scene and these annotation are generating setter getter for my JPA during compilation time. After some research i had an answer. answer was a library known as lombok :)

Getters/Setters, Constructors — So Repetitive

Encapsulating object properties via public getter and setter methods is such a common practice in the Java world, and…


Recently i got a chance to work on microservices ,In existing code i observed some annotations in my pojo or JPA entities and did not see any setter or getter for properties defined. But in my whole code getter and setter were getting used .I realized there is something going behind the scene and these annotation are generating setter getter for my JPA during compilation time. After some research i had an answer. answer was a library known as lombok :)

Getters/Setters, Constructors — So Repetitive

Encapsulating object properties via public getter and setter methods is such a common practice in the Java world, and…


Cloud functions is a serverless platform for building event-base microservices. it is basically scalable pay as you go Functions-as-a-Service (FaaS) to run your code with zero server management from google.

Cloud function can be primarily divided into 2 kind of function.


Phone Book

Design a data structure to store your contacts: Names of people along with their phone numbers.The data structure should be able to do the following quickly:

  • Add contacts.
  • Lookup the phone number by name.
  • Determine who is calling given their phone number.

To do that:

To implement this we will be using HashMap and Trie data structure. Trie data help us to search and provide suggestion on basis of keystroke entered. Once we select any contact name we can search in hashmap.

Generally search query on a Trie is to determine whether the string is present or not in the…

krishankant singhal

Angular,Vuejs,Android,Java,Git developer. i am nerd who want to learn new technologies, goes in depth.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store