javacodegeeks.com

Configuring and using AWS EKS in production

Its been some weeks now that our migration to Amazon EKS (work place) is completed and the clusters are in production. I have written a brief in the past on some major points, you can find it here. With some extra confidence while the system is serving real traffic I decided to come back for a more concrete and thorough list of steps and a set of notes I gathered through this journey. Obviously...

javacodegeeks.com

Hot-deploying into Kubernetes using Telepresence & WAD

When you’re testing your enterprise application in a Kubernetes environment, the turnaround for changing, re-packaging, and re-deploying your application can become quite high. Telepresence aims to mitigate this, by proxying a locally running process into our Kubernetes cluster, as if the local process were part of the cluster. If we combine that approach with a hot-redeploy tool such as WAD we...

javacodegeeks.com

Spring Bean Scopes

Introduction:Spring core container instantiates beans and manages their life-cycle. While defining a bean, we can provide its scope. Unless explicitly provided, singleton is the default scope of beans in a Spring container.We have five types of bean scopes available in Spring. In this tutorial, we’ll explore each of them.1. singleton:The singleton scope ensures that there exists only a single...

javacodegeeks.com

Reactive Relational Database Transactions

Spring Framework announced recently to ship with support for reactive transaction management.Let’s take an in-depth look at how this works for R2DBC, the reactive specification for SQL database access.Transaction Management is a pattern and not technology-specific. From that perspective, its properties and runtime behavior are a function of the implementing technology.TL; DR: From a database...

javacodegeeks.com

Spring Boot YAML Configuration

In this quick tutorial, we’ll learn how to use a YAML file to configure properties of a Spring Boot application.What is YAML File?Instead of having an application.properties in Spring, we can use the application.yml as our configuration file. YAML is a superset of JSON and we can use it for configuring data. The YAML files are more human-readable, especially when we have a lot of...

javacodegeeks.com

Jakarta EE without javax: the world won’t end this time either

If you missed the news, Oracle is donating the Java EE specification to the Eclipse foundation. This decisions has followed a rather long period of hibernation in the specification process where people rightfully suspected a loss of strategic interest in Java EE by Oracle. At first, the decision to donate the specification was well-met by the Java EE and broader Java community. Without Oracle...

javacodegeeks.com

Spring ClassPathXmlApplicationContext

Introduction:Spring provides two types of containers:BeanFactory: It supports bean instantiating and wiringApplicationContext: It extends the BeanFactory and so provides all those features as that a BeanFactory. Additionally, it provides automatic registration of BeanPostProcessor, internationalization, and many more featuresThe Spring container is responsible for instantiating and managing the...

javacodegeeks.com

Spring Dependency Injection

Introduction:In a well-designed Java application, the classes should be as independent as possible. Such a design promotes reusability of components. It also makes it easier to unit test the various components.The concept of dependency injection promotes loose coupling among Java objects.In this tutorial, we’ll talk about the dependency injection in Spring framework.Inversion Of...

javacodegeeks.com

Spring Boot Exit Codes – Create Custom Exit Code

When running a Spring Boot application, we get a system exit code of 0, when everything goes fine.  For any unhandled exceptions, the application returns with an exit code 1.It’s possible for us to return a custom exit code from our Spring Boot application. In this tutorial, we’ll learn to do so.Implementing ExitCodeGenerator:Let’s start by creating a class that implements the...

javacodegeeks.com

Using @ResponseStatus for Http Status in Spring

Introduction:In Spring MVC, we can set the status of the HttpResponse in several ways. In this tutorial, we’ll achieve it using the @ResponseStatus annotation.We can use @ResponseStatus to mark a method or an exception class with a status code and reason that should be returned. On invoking the marked handler method or when a specified exception is thrown, the HTTP status will be set to the one...

javacodegeeks.com

@Component vs @Repository vs @Service in Spring

Introduction:With Spring’s auto-scanning feature, it automatically detects various beans defined in our application. We usually annotate our beans using one of the available Spring annotations – @Component, @Repository, @Service, @Controller.On detecting the bean, Spring simply registers it into the ApplicationContext.In this quick tutorial, we’ll look at the difference between @Component,...

javacodegeeks.com

Apache Ant 1.10.6 released – fork mode for junitlauncher and new jmod and link tasks

Apache Ant 1.10.6 has been released this week. This release contains numerous bug fixes as well as some very exciting new features. The complete release notes is available here and the downloads itself are available here. In this article, I will go over some of the new features that have made it into this release.Running JUnit5 tests in a forked JVM, using junitlauncher taskA while back, Ant...