Home » Java


Getters and Setters Considered Harmful

Java programmers habitually pepper their classes with “getters” and “setters,” and this practice is so ingrained that probably few ever question why they do so, or whether they should. Lately I have come think that it is better not to and I have begun avoiding it in the Java code that I write. In this blog post I will explain ...

Read More »

Spring Data JPA Example with Spring Boot


1. Introduction In this post, we shall demonstrate how to leverage the powerful Spring Data JPA APIs to interact with the database, in-memory H2 database for this lesson. Spring Data JPA offers a set of very powerful and highly-abstracted interfaces which are used to interact with any underlying database. Databases can be MySQL, MongoDB, Elasticsearch or any other supported database. ...

Read More »

Setting Up Cassandra With Priam

I’ve previously explained how to setup Cassandra in AWS. The described setup works, but in some cases it may not be sufficient. E.g. it doesn’t give you an easy way to make and restore backups, and adding new nodes relies on a custom python script that randomly selects a seed. So now I’m going to explain how to setup Priam, ...

Read More »

How to change the default port of Spring Boot application


By default, Spring Boot applications run on an embedded Tomcat via port 8080. In order to change the default port, you just need to modify server.port attribute which is automatically read at runtime by Spring Boot applications. In this tutorial, we provide the common ways of modifying server.port attribute. 1- application.properties Create application.properties file under src/main/resources and define server.port attribute ...

Read More »

New Parallax Control For Java (JavaFX)

Introduction Parallax is a visual effect where you combine two layered images moving at different speeds to achieve a sense of depth. Think about when you’re driving on the road and you see the trees close to you moving fast whereas the trees that are further away will move in the same direction but slower, the result is that you ...

Read More »

Raw String Literals Coming to Java

It appears likely that “raw string literals” are coming to Java. JEP 326 (“Raw String Literals”) started as Issue JDK-8196004 and was announced as a “new JEP candidate” on March 2. The JEP and associated issue point out that “Java remains one of a small group of contemporary programming languages that do not provide language-level support for raw strings.” The ...

Read More »

Understanding Cloneable interface in Java

What is Object Cloning? Object Cloning is a process of generating the exact field-to-field copy of object with the different name. The cloned object has its own space in the memory where it copies the content of the original object. That’s why when we change the content of original object after cloning, the changes does not reflect in the clone object. ...

Read More »

Apache Camel 2.21 Released – Whats New

We have just released Apache Camel 2.21 and I will in this blog highlight the noteworthy changes.                       This release do NOT support Spring Boot 2. Support for Spring Boot 2 will come in Camel 2.22, which we plan to release before summer 2018.   1) Working with large JMS ...

Read More »

Free eBook: The Complete Guide to Java Logging in Production

The Complete GitHub Logging Research: How the World’s Top Companies Choose How and What to Log We all use log files to monitor our applications in production. Some of us prefer using log management tools like Splunk or ELK, while others sift through raw logs on their notepad or terminal. It doesn’t matter if you choose the former or the ...

Read More »