13 Nov 2025

feedDZone Java Zone

When Memory Overflows: Too Many ApplicationContexts in Spring Integration Tests

In Spring, the ApplicationContext is the central container object that manages all beans (i.e., components, services, repositories, etc.).

Its tasks include reading the configuration (Java Config, XML, annotations), creating and managing bean instances, handling dependency injection, and running the application lifecycle.

13 Nov 2025 5:00pm GMT

12 Nov 2025

feedDZone Java Zone

How to Map PostgreSQL JSON Data Types in Java Using asentinel-orm

It isn't seldom when software products need to easily and efficiently manage the direct storage and handling of JSON content directly into the underlying database. The purpose of this article is to exemplify how such tasks can be conveniently accomplished via the asentinel-orm, a lightweight ORM tool built on top of Spring JDBC, which possesses most of the features one would expect from such a project.

We will start by defining a simple entity that contains a JSONB column. Then, we will configure a sample application that uses the asentinel-orm to handle its data access towards a PostgreSQL database that stores such entities. Lastly, we will exemplify and emphasize how the actual JSON data can be queried and stored properly.

12 Nov 2025 5:00pm GMT

11 Nov 2025

feedDZone Java Zone

Debugging Performance Regressions in High-Scale Java Web Services: A Systematic Approach

High-scale, real-time services live under unforgiving economics. Ad tech and similar platforms push millions of requests through Java web services, where a handful of milliseconds either unlock profitable throughput or sink margins under excess compute. Regressions in latency and resource usage rarely arrive with sirens; they slip in alongside routine refactors, dependency upgrades, or subtle shifts in traffic shape. What looks like a harmless tweak in a unit test can magnify into elevated CPU, long garbage collection pauses, or thread starvation once it meets production load. The work of debugging these regressions is less about isolated heroics and more about following a disciplined trail from symptoms to causes, correlating signals across the JVM, and validating fixes under real heat.

Industry-wide, the cost of performance regressions is notoriously high, though rarely measured with public precision. In environments like ad tech, where margins are directly tied to throughput and latency, even a minor, sustained performance degradation can translate to significant operational expense and lost revenue. Teams that adopt systematic debugging and profiling practices don't just resolve incidents faster; they build a culture of performance awareness that prevents regressions from being deployed in the first place. The resulting efficiency gains, often manifesting as reduced cloud spend or the ability to handle more traffic on the same hardware, directly improve the bottom line. This article examines how that discipline works in practice for Java services running on Tomcat.

11 Nov 2025 7:00pm GMT

Gatherers in Java: What They Are and Why They Matter

Java 8, released more than a decade ago, is a major milestone. With this version, Java brought a fundamental shift from only being an object-oriented programming (OOP) to a combination of OOP and functional programming (FP) as well. To achieve this, Java 8 came in with support of lambdas, stream APIs, etc., as core language features.

Stream API is influenced and modeled after the collection pipeline. A typical stream has three stages, viz., source, intermediate operations, and terminal operations.

11 Nov 2025 5:00pm GMT

06 Nov 2025

feedDZone Java Zone

The JVM Pause That Wasn't: A War Story

In high-performance computing, we are trained to hunt for bottlenecks in our code, our algorithms, or our infrastructure. But my favorite bug was not in any of those. It was an invisible interaction between the JVM's garbage collector and the server's disk, resulting in 15+ second, stop-the-world (STW) pauses on a service handling millions of requests per second.

The Mystery: The 503 Spikes

I was working on a large-scale Java service handling millions of user requests per second. The system was designed for extreme throughput, but we were plagued by intermittent spikes in load balancer timeouts, causing 503 responses to be returned to the users.

06 Nov 2025 1:00pm GMT

05 Nov 2025

feedDZone Java Zone

JPlus: A Modern Java Superset Language

JPlus is a Java superset language running on the JVM that enhances developer productivity while staying fully compatible with the Java ecosystem.

Why Support JPlus?

JPlus fills a unique gap in the Java ecosystem:

05 Nov 2025 6:00pm GMT

04 Nov 2025

feedDZone Java Zone

Top Takeaways From Devoxx Belgium 2025

In October 2025, I visited Devoxx Belgium, and again it was an awesome event! I learned a lot and received quite a lot of information, which I do not want to withhold from you. In this blog, you can find my takeaways of Devoxx Belgium 2025!

Introduction

Devoxx Belgium is the largest Java conference in Europe. This year, it was already the 22nd edition. As always, Devoxx is being held in the fantastic theatres of Kinepolis Antwerp. Each year, there is a rush on the tickets. Tickets are released in several batches, so if you could not get a ticket during the first batch, you will get another chance.

04 Nov 2025 1:00pm GMT

30 Oct 2025

feedDZone Java Zone

Building Reactive Microservices With Spring WebFlux on Kubernetes

Migrating from a monolithic Java 8 system to a reactive microservice architecture on Kubernetes allowed us to dramatically improve performance and maintainability. In this article, I'll share our journey, key Spring Cloud Kubernetes features we adopted, the challenges we faced during development, and the lessons we learned along the way.

Business Logic

We have a data processing logic that streams information into S3 storage using Kafka, Spark Streaming, and Iceberg. Initially, we encountered multiple challenges, such as file optimization issues and Spark's unpredictable memory behavior. After addressing these issues, we achieved significant cost savings. Once the insert service was completed, we needed to select an appropriate search engine service. We chose Trino as it fulfilled the needs of our data science department. We also serve customers who perform operations on our S3 data, which can result in high system load. Before this modernization, our platform ran on an old monolithic architecture built with Java 8, which created several performance and maintenance challenges.

30 Oct 2025 2:00pm GMT

27 Oct 2025

feedDZone Java Zone

Writing (Slightly) Cleaner Code With Collections and Optionals

Kilo is an open-source project for creating and consuming RESTful and REST-like web services in Java. Among other things, it includes the Collections and Optionals classes, which are designed to help simplify code that depends on collection types and optional values, respectively. Both are discussed in more detail below.

Collections

Kilo's Collections class provides a set of static utility methods for declaratively instantiating list, map, and set values:

27 Oct 2025 7:00pm GMT

Set Up Spring Data Elasticsearch With Basic Authentication

Recently, I wrote the Introduction to Spring Data Elasticsearch 5.5 article about Spring Data Elasticsearch usage as a NoSQL database. The article covered just the setup of the unsecured Elasticsearch. However, we need to be able to connect to the secured Elasticsearch as well. Let's follow the previous article and see the needed changes to run and connect to the secured Elasticsearch.

In This Article, You Will Learn

Set Up Secured Elasticsearch

The setup for creating a secure Elasticsearch is pretty similar to the steps in the already-mentioned article. The technologies used in this article, compliant with the compatibility matrix, are:

27 Oct 2025 5:00pm GMT

24 Oct 2025

feedDZone Java Zone

Diagnosing and Fixing a Page Fault Performance Issue With Arm64 Atomics

While running a synthetic benchmark that pre-warmed the cache, we noticed an abnormal performance impact on Ampere CPUs. Digging deeper, we found that there were many more page faults happening with Ampere CPUs when compared to x86 CPUs. We isolated the issue to the use of certain atomic instructions like ldadd, which load a register, add a value to it, and store data in a register in a single instruction. This triggered two "page faults" under certain conditions, even though this is logically an all-or-nothing operation, which is guaranteed to be completed in one step.

In this article, we will summarize how to qualify this kind of problem, how memory management in Linux works in general, explain how an atomic Arm64 instruction can generate multiple page faults, and show how to avoid performance slowdowns related to this behavior.

24 Oct 2025 12:00pm GMT

23 Oct 2025

feedDZone Java Zone

Ranking Full-Text Search Results in PostgreSQL Using ts_rank and ts_rank_cd With Hibernate 6 and posjsonhelper

In a previous article, we explored how to implement full-text search in PostgreSQL using Hibernate 6 and the posjsonhelper library. We built queries with to_tsvector, to_tsquery, and their simpler wrappers for the plainto_tsquery, phraseto_tsquery, and websearch_to_tsquery functions.

This time, we'll extend that foundation and explore how to rank search results based on their relevance using PostgreSQL's built-in ranking functions like ts_rank and ts_rank_cd.

23 Oct 2025 2:00pm GMT

Applying Domain-Driven Design With Enterprise Java: A Behavior-Driven Approach

When it comes to software development, one of the biggest mistakes is delivering precisely what the client wants. While this may sound cliché, the problem persists even after decades in the industry. A more effective approach is to begin testing with a focus on business needs.

Behavior-driven development (BDD) is a software development methodology that emphasizes behavior and domain terminology, also known as ubiquitous language. It uses a shared, natural language to define and test software behaviors from the user's perspective. BDD builds on test-driven development (TDD) by concentrating on scenarios that are relevant to the business. These scenarios are written as plain-language specifications that can be automated into tests, which also serve as living documentation.

23 Oct 2025 1:00pm GMT

20 Oct 2025

feedDZone Java Zone

MultiCloudJ: Building Cloud-Agnostic Applications in Java

According to a 2024 Gartner report, more than 92% of large enterprises now operate in multi-cloud environments. This reflects strategic priorities such as geographic scalability, high availability, regulatory compliance, and cost optimization.

But with these benefits comes significant complexity. Each provider - AWS, GCP, Alibaba Cloud, and others - exposes its own APIs, semantics, and SDKs. As a result, development teams must reconcile divergent models for storage, databases, identity, and more. The outcome is often fragmented codebases filled with conditional logic, code forking, duplicated workflows, and costly rewrites when onboarding new providers. For large organizations, this slows delivery, increases operational risk, and erodes the developer experience.

20 Oct 2025 5:00pm GMT

10 Oct 2025

feedDZone Java Zone

Infusing AI into Your Java Applications

Artificial intelligence (AI) is becoming increasingly pervasive. As an Enterprise Java developer, you might be wondering what value AI can add to your business applications, what tools Java provides to easily do that, and what skills and knowledge you might need to learn. In this article, we equip you with the basic knowledge and skills that you need to start exploring the capabilities of AI to build intelligent and responsive Enterprise Java applications.

When we talk about AI in this article, we mean getting responses from a large language model (LLM) based on a request that the Java application sends to the LLM. In our article's example, we create a simple chatbot that customers can ask for planetary tourist destination recommendations, and then use to book a spaceship to visit them. We demonstrate using Java frameworks like LangChain4j with Quarkus to efficiently interact with LLMs and create satisfying applications for end-users.

10 Oct 2025 7:00pm GMT

Diving into JNI: My Messy Adventures With C++ in Android

So, I've been deep in the trenches with JNI lately (yeah, that Java Native Interface stuff) while working on a project where we had to plug a C++ AI assistant into our Android app. At first, it felt like stepping into a weird twilight zone - half Java, half C++, and all these random edge cases you never think about until you hit them. I remember staring at the stack trace for what felt like hours, realizing that one tiny missed DeleteLocalRef was enough to crash the whole app. Thought I'd share what actually tripped me up, what worked, and some ways to make life a little less miserable if you ever have to do this.

What the Hell Is JNI Anyway?

JNI is basically the bridge that lets Java (or Kotlin) talk to C/C++ code and vice versa. On Android, it's the only real way to get heavy lifting done efficiently or access low-level APIs that Java/Kotlin just can't reach. Honestly, the first time I tried to wrap my head around it, I felt like I was learning a new language on top of Java and C++ at the same time.

10 Oct 2025 6:00pm GMT