Cancel @Async Thread in Spring Boot

Before going to the cancel async example, please quickly check these two short articles because it might give you a better overview of what I’m saying. Stop thread execution Control thread using exceptions Premise: You have a Spring Boot app that needs to execute a long running task. You don’t want to have the user … Read more

Enum with Different Behavior in Java

You sometimes need an enum with different behavior in Java. Consider the following case where you have an employee management application. It displays information about all the company’s employees. In your application settings you want to configure how many fields you want to see. For example you might not care about the employee’s date of … Read more

SQL Timestamp to LocalDate Java

Timestamps stored in database systems are usually retrieved as a type of java.sql.Timestamp objects. You can convert SQL Timestamp to LocalDate (Java 8) by first converting to LocalDateTime then to LocalDate. This is required because dates in database systems are usually stored as both day and time (yyyy-mm-dd hh:mm:ss). Since Timestamp contains both a date … Read more

Java Cache Service using Spring

We’ll now create a simple yet effective Java cache service using Spring Boot. A cache service is useful to leverage load on the database, especially if multiple users are querying for information and specifically if that information doesn’t change quite as often. When a cache service is suitable? In any situations where you need to … Read more

React Native – ToolbarAndroid Drawer Navigation

I will explain my method for using ToolbarAndroid (actually i’m using the wrapper from react-native-vector-icons) to navigate to different screens. I will explain ToolbarAndroid drawer navigation using React Navigator’s stack navigator. ToolbarAndroid Drawer Navigation with Stack Navigator Create a new React Native project using this command: Create a new folder inside named src. We will … Read more