Spring Boot SSL [https] Example

In this spring boot example, learn to configure web application to run on SSL (HTTPS) with self-signed certificate. Also learn to create SSL cert, as well.

Boxed Streams in Java

In java 8, to convert a stream of primitives to collection, you must first box the elements in their wrapper class and then collect them i.e. boxed stream.

Spring Cloud – Zipkin and Sleuth

Zipkin is a very efficient tool for distributed tracing in the microservices ecosystem. Distributed tracing, in general, is the latency measurement of each component in a distributed transaction where multiple microservices are invoked to serve a single business usecase. Let’s say from our application, we have to call 4 different …

ELK Stack Tutorial with Example

In this ELK tutorial, learn to integrate ELK stack in microservice ecosystem for distributed logs management and processing, and viewing logs in UI Console.

Spring 5 New Features and Upgrades

Spring 5 is the first major release, almost four years after Spring Framework 4.0. Lets quickly go through some exciting features coming in Spring 5.0.

Java 9 Features and Enhancements

Java 9 is bringing lots of new enhancements which are going to affect your programming style and habit, in big way. The biggest change is the modularization of Java. It’s another big change after Lambdas in Java 8. In this article, I am listing down changes which will be part …

Java Modules Tutorial

JPMS (Java Platform Module System) is the major enhancement in Java 9. It is also known as Project Jigsaw. In this Java 9 modules tutorial, we will learn about modules (in general) and how your programming style will change in future when you will start writing modular code.

Hoverfly: Microservices Virtualization Example

Learn about service virtualization concepts in detail and also look into a popular and useful service virtualization tool – Hoverfly. Also see how Hoverfly can be used to capture request/responses in proxy mode and use those captured responses while Hoverfly will run in simulation mode.

Dozer bean mapping example

Dozer bean mapping example. Learn dozer for mapping nested object, use Spring bean mapping builder, dozer custom converters to copy data between beans.

AWS Lambda Function Example

Today along with Microservices, another concept is very popular that is Serverless architecture. Serverless refers to the cloud deployment model with elasticity where you deploy your code/services to 3rd party cloud providers (e.g. AWS) instead of managing servers and platform manually. Cloud provider provides all infrastructure and platform support where …

Java 9 – JShell

JShell allows us to execute Java code snippets and get immediate results without having to create a solution or project or using any code editor.

Get all Dates between Two Dates as Stream

Date and time handling has always been a pain area for Java developers. The new Date-Time API added in Java 8 changed the way, we interact with date and time in Java. New Date API is a very powerful and much-needed improvement. The only thing missing was, getting a stream …

Lombok Introduction and Eclipse Installation

Lombok is very handy tool for minimizing the boilerplate code as well as providing lot’s of other features such as lazy loading, thread safety or immutability. This is the reason it becoming very popular among the developer community.

Private Methods in Interface – Java 9

Java 9 onward, you are allowed to include private methods in interfaces. Using private methods, now encapsulation is possible in interfaces as well. In this java 9 tutorial, we will learn about interface private methods in detail. Table of Contents Interfaces till Java 7 Static and defaults methods since Java …

Consul Service Registration and Discovery Example

Learn to create Microservices, based on Spring cloud, registering on HashiCorp Consul registry server and how other microservices (discovery clients) use it to register and discover services to call their APIs.

Hystrix Circuit Breaker Pattern – Spring Cloud

Learn to leverage the one of the Spring cloud Netflix stack component called Hystrix to implement circuit breaker while invoking underlying microservice. It is generally required to enable fault tolerance in the application where some underlying service is down/throwing error permanently, we need to fall back to different path of …

Adding Role Based Security with Spring Boot REST APIs

Learn to create JAX-RS 2.0 REST APIs using Spring Boot and Jersey framework, and add role based security using JAX-RS annotations e.g. @PermitAll, @RolesAllowed or @DenyAll. Table of Contents Project Structure Create REST APIs Secure REST APIs with JAX-RS Annotations Write security filter using JAX-RS ContainerRequestFilter Demo Project Structure The …

Generate REST API Docs with Swagger

Now a days REST and Microservices have got a lot of momentum. At the same time, actual REST specification does not suggest any standard way to document the REST APIs that we are going to expose [like WSDL for SOAP]. As a result, everybody is documenting their APIs in their …

Create Jersey REST APIs with Spring Boot

Learn to configure and create JAX-RS 2.0 REST APIs using Spring Boot and Jersey framework. This example application uses Jersey’s ServletContainer to deploy the REST APIs.

Spring Cloud Config Server with Git Integration

Config server is where all configurable parameters of microservices are written are maintained. It is more like externalizing properties / resource file out of project codebase to an external service altogether, so that any changes to that property does not necessitate the deployment of service which is using the property. All such property changes will be reflected without redeploying the microservice.

Command Design Pattern

Command pattern is a behavioral design pattern which is useful to abstract business logic into discrete actions i.e. commands. It motivates loose coupling.

Java Inheritance

Java Inheritance refers to the ability of a child class to inherit all the non-private properties and methods from the parent class.

Lucene RAMDirectory Example

In this Lucene 6 tutorial, we will learn to use RAMDirectory to run quick examples of POCs because it is not intended to work with huge indexes.

Lucene UnifiedHighlighter Example

Lucene UnifiedHighlighter is the highest-performing highlighter, especially for large documents. Tutorial to highlight search terms in indexed documents/files.

Lucene Search Highlight Example

In Lucene highlighter example, learn to search in documents and highlight search terms in search results using SimpleHTMLFormatter and Fragmenter.

Strategy Design Pattern

Strategy design pattern is behavioral design pattern where we choose a specific implementation of algorithm or task in run time – out of multiple other implementations for same task.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.