25 Dec 2024

feedDZone Java Zone

Ulyp: Recording Java Execution Flow for Faster Debugging

The article presents Ulyp, which is an open-source instrumentation agent that records method calls (including arguments and return values) of all third-party libraries of JVM apps. Software engineers can later upload a recording file to the UI desktop app in order to better understand the internals of libraries and even all the applications. The tool can help developers understand the internals of frameworks faster, gain deeper insights, find inefficiencies in software, and debug more effectively.

In a few words, Ulyp allows to run this code, which sets up a database source, a cache over the source, and then queries the cache:

25 Dec 2024 6:00pm GMT

23 Dec 2024

feedDZone Java Zone

Understanding Root Causes of Out of Memory (OOM) Issues in Java Containers

Out-of-memory errors in containerized Java applications can be very frustrating, especially when happening in a production environment. These errors can happen for various reasons. Understanding the Java Memory Pool model and different types of OOM errors can significantly help us in identifying and resolving them.

1. Java Memory Pool Model

Java Heap

Purpose

Java heap is the region where memory is allocated by JVM for storing Objects and dynamic data at runtime. It is divided into specific areas for efficient memory management (Young Gen, Old Gen, etc.). Reclamation of memory is managed by the Java GC process.

23 Dec 2024 10:00pm GMT

Java 21 Features: A Detailed Look at the Most Important Changes in the New LTS Release

Since the Java platform adopted a six-month release cycle, we've moved past the perennial questions such as "Will Java die this year?" or "Is it worth migrating to the new version?". Despite 28 years since its first release, Java continues to thrive and remains a popular choice as the primary programming language for many new projects.

Java 17 was a significant milestone, but Java 21 has now taken 17's place as the next long-term support release (LTS). It's essential for Java developers to stay informed about the changes and new features this version brings. Inspired by my colleague Darek, who detailed Java 17 features in his article, I've decided to discuss JDK 21 in a similar fashion (I've also analyzed Java 23 features in a follow-up piece, so check it out too).

23 Dec 2024 2:00pm GMT

20 Dec 2024

feedDZone Java Zone

How to Test PATCH Requests for API Testing With Playwright Java

Automated API testing offers multiple benefits, including speeding up the testing lifecycle and providing faster feedback. It helps in enhancing the efficiency of the APIs and allows teams to deliver the new features speedily to the market.

There are multiple tools and frameworks available in the market today that offer automation testing of the APIs, including Postman, Rest Assured, SuperTest, etc. The latest entry on this list is the Playwright framework, which offers API and Web Automation Testing.

20 Dec 2024 6:00pm GMT

19 Dec 2024

feedDZone Java Zone

Using Java Class Extension Library for Data-Oriented Programming - Part 2

This is the second article that presents an object-oriented programming (OOP) approach to effectively separate data from domain-specific logic in data-oriented programming, utilizing the dynamic class extensions using the Java Class Extension Library. You can read the first article there.

Problem

Let us reconsider the same scenario where we are building a warehouse application designed to handle the shipping of various items. We have established a hierarchy of classes to represent the goods we have:

19 Dec 2024 4:00pm GMT

17 Dec 2024

feedDZone Java Zone

Charge Vertical Scaling With the Latest Java GCs

In the dynamic landscape of Java ecosystem enhancements, one could miss an important progress that has been made in Java Garbage Collection (GC) in recent years. Meanwhile, the latest generations of GC bring far-reaching consequences for running Java applications. This article intends to highlight the significant effects brought to us by ZGC and Shenandoah.

Garbage Collection

Garbage Collection is a feature that distinguishes Java from many other programming languages. The GC mechanism exempts manual memory management from development routine via finding and removing objects no longer used by an application automatically.

17 Dec 2024 9:00pm GMT

16 Dec 2024

feedDZone Java Zone

Dropwizard vs. Micronaut: Unpacking the Best Framework for Microservices

Microservices architecture has reshaped the way we design and build software, emphasizing scalability, maintainability, and agility. Two frameworks, Dropwizard and Micronaut, have gained prominence in the microservices ecosystem, each offering unique features to simplify and optimize development. In this article, we delve into a detailed comparison to help you determine which framework best suits your needs.

Comparison Overview

Dropwizard and Micronaut differ significantly in their design philosophies and capabilities:

16 Dec 2024 3:00pm GMT

13 Dec 2024

feedDZone Java Zone

Enabling Behavior-Driven Service Discovery: A Lightweight Approach to Augment Java Factory Design Pattern

The Factory Pattern is one of the popular creational design patterns in Java. It provides a single access point to obtain the suitable implementation of a service that is exposed as an abstract class or interface by using a service identifier that's often the shorthand name of the implementation type and represented by a String or Enum. This pattern is used to create objects without specifying the exact class of object that will be created in the runtime and many of the frameworks and Java APIs developers come across every day use this pattern.

This article aims to augment the design pattern to provide better readability and maintainability. It illustrates how the service discovery is automated by the proposed approach without requiring the factory method to manually accommodate code for the creation of a new service implementation every time a new service implementation is created for a different business need.

13 Dec 2024 3:00pm GMT

11 Dec 2024

feedDZone Java Zone

How to Test PUT Requests for API Testing With Playwright Java

API testing is a process that confirms that the API under test is working as expected. Generally, in Agile teams, due to shift left testing, API testing is performed earlier in the SDLC as it provides major benefits, like faster feedback and allowing the team to fix the bugs early in the phase.

There are multiple tools and frameworks available these days that help perform API testing quickly. Playwright is one such test automation framework that has gained a lot of popularity. Backed by Microsoft, it supports web and API automation testing in multiple programming languages.

11 Dec 2024 9:00pm GMT

10 Dec 2024

feedDZone Java Zone

Understanding Functional Programming: A Quick Guide for Beginners

Imagine you're working on a complex puzzle. There are two ways to solve it:

  1. The first way: You keep rearranging all the pieces directly on the table, moving them around, and sometimes the pieces you've already arranged get disturbed. This is like traditional imperative programming, where we directly modify data and state as we go.

10 Dec 2024 6:00pm GMT

04 Dec 2024

feedDZone Java Zone

How to Test GET Requests With Playwright Java for API Testing

Playwright is a popular open-source test automation framework created by Microsoft. It enables developers and test automation engineers to automate web applications on different browsers and platforms. It supports major programming languages, including JavaScript, TypeScript, Java, C#, and Python. It also uses API Automation Testing, which is seen as a major benefit over other web automation frameworks.

In this tutorial blog, we will learn to use Playwright with Java and test GET API requests in automation testing.

04 Dec 2024 8:00pm GMT

Configurable Feign Client Retry With Reusable Library and DRY

In microservice architectures, resilient communication between services is vital. Feign, a declarative web service client, is a popular choice for simplifying HTTP communication. But there is no out-of-the-box retry mechanism provided, which can be plugged seamlessly with the Feign client. This is a good-to-have feature, as adding retry logic to Feign clients enhances fault tolerance.

This article demonstrates how to implement retry logic with conditional configuration to Feign client and package it in a common library using Maven. The idea is to use it to expose Feign retry and features similar to those of the consumer of this library. It also helps in the Separation of Concerns. This approach ensures reusability across multiple microservices, adhering to the DRY design principle.

04 Dec 2024 6:00pm GMT

03 Dec 2024

feedDZone Java Zone

Simplify NoSQL Database Integration in Java With Eclipse JNoSQL 1.1.3

NoSQL databases have become a cornerstone of modern application development, offering scalability and flexibility for handling diverse data types. However, for many Java developers, integrating with NoSQL databases can be complex and time-consuming. This is where Eclipse JNoSQL comes in, providing a seamless and standardized way to connect your Java applications to various NoSQL databases.

This article explores how Eclipse JNoSQL 1.1.3 simplifies database integration, enhances developer productivity, and offers flexibility across different databases. We'll also walk you through a practical example using Quarkus and ArangoDB to demonstrate its features.

03 Dec 2024 3:00pm GMT

Why ‘mvn install’ May Risk Your Builds

When you are using mvn install in your build server, you should ask yourself the question of whether this is correct. You might be at risk without knowing it. In this blog, the problems with mvn install are explained, and solutions are provided.

Introduction

You are using a build server for several reasons: builds are not dependent on a developer's machine, you can run long integration tests or regression tests on the build server without blocking a developer's machine, you run security checks on the build server, SonarQube analysis, and so on.

03 Dec 2024 12:00pm GMT

28 Nov 2024

feedDZone Java Zone

How to Test POST Requests With Playwright Java for API Testing

Playwright is a test automation framework developed by Microsoft. It is available across multiple programming languages like Java, NodeJS, Python, and .Net. It supports both web and API test automation.

With 67.2k stars and 3.7k forks on GitHub, the framework has gained a lot of popularity. It has rich features that allow testing web applications using major browsers and performing API testing.

28 Nov 2024 8:30pm GMT

27 Nov 2024

feedDZone Java Zone

Choosing the Right Caching Strategy

Today, it's nearly impossible to build scalable applications without eventually addressing caching. Most development teams have likely experimented with different caching strategies or tools and eventually crafted a solution that works best for their own needs.

We deal with large volumes of data, ensuring low-latency data delivery is crucial across projects, whether B2C, B2B, or even desktop applications.

27 Nov 2024 4:00pm GMT