Guide to ConcurrentModificationException

Guide to ConcurrentModificationException

Introduction If you run the following code: There are chances you will get the following exception: I said “there are chances” because you run the same code repeatedly, and sometimes there is no exception thrown. So, what is ConcurrentModificationException and when you might encounter it. The JDK’s said: This exception may be thrown by methods … Read more

Adapter Design Pattern Tutorial In Java

Adapter Design Pattern Tutorial In Java

Introduction The Adapter design pattern is a structural pattern that allows objects with incompatible interfaces to work together. It does this by converting the interface of one class into another interface that the client expects. This pattern is often used to make existing classes work with each other without modifying their source code. Real-world example … Read more

Configure Spring Logging To Elasticsearch

Configure Spring Logging To Elasticsearch

Overview In this quick tutorial, I will show you how to configure Spring logging to Elasticsearch so you can search, visualize and do many useful things with your log. Things that you cannot do by looking at the console output. Let’s get started. Create ELK stack using Docker Compose If you don’t have Elasticsearch running … Read more

Spring Boot Commandline Runner Tutorial

Spring Boot Commandline Runner Tutorial

Overview There are times you need to do some start-up work when your Spring application launch. One of the methods is to use the CommandlineRunner interface. In this post, I’m going to show you how to use this interface to run startup tasks with flexibility. Let’s get started. Meet the CommandlineRunner interface The CommandlineRunner interface … Read more