03 Feb 2025
DZone Java Zone
Java Stream API: 3 Things Every Developer Should Know About
Time flies! I remember the time when Java 8 was such a reference, and everybody was talking about it like something new and revolutionary. Frankly speaking, it was new and revolutionary. But now, projects using Java 8 might be labeled "legacy." If Java 8 itself became a legacy, the features introduced in that version would still be actual. And let's talk today about one of them - Stream API.
In case you don't know, Java Stream API is a powerful tool that allows programmers to write Java code in a functional programming style. Introduced long ago, it makes working with collections easier by enabling filtering, transformation, and aggregation.
03 Feb 2025 8:00pm GMT
MuleSoft OAuth 2.0 Provider: Password Grant Type
OAuth 2.0 is a widely used authorization framework that allows third-party applications to access user resources on a resource server without sharing the user's credentials.
The Password Grant type, also known as Resource Owner Password Credentials Grant, is a specific authorization grant defined in the OAuth 2.0 specification. It's particularly useful in scenarios where the client application is highly trusted and has a direct relationship with the user (e.g., a native mobile app or a first-party web application). This grant type allows the client to request an access token by directly providing the user's username and password to the authorization server. While convenient, it's crucial to implement this grant type securely, as it involves handling sensitive user credentials.
03 Feb 2025 5:00pm GMT
29 Jan 2025
DZone Java Zone
How to Split PDF Files into Separate Documents Using Java
Asking our Java file-processing applications to manipulate PDF documents can only increase their value in the long run. PDF is by far the most popular, widely used file type in the world today, and that's unlikely to change any time soon.
Introduction
In this article, we'll specifically learn how to divide PDF files into a series of separate PDF documents in Java - resulting in exactly one new PDF per page of the original file - and we'll discuss open-source and third-party web API options to facilitate implementing that programmatic workflow into our code. We'll start with a high-level overview of how PDF files are structured to make this type of workflow possible.
29 Jan 2025 9:00pm GMT
The Energy Efficiency of JVMs and the Role of GraalVM
As the world becomes increasingly conscious of energy consumption and its environmental impact, software development is joining the movement to go green. Surprisingly, even the choice of runtime environments and how code is executed can affect energy consumption. This brings us to the world of Java Virtual Machines (JVMs), an integral part of running Java applications, and the rising star in the JVM world, GraalVM.
In this article, we will explore how code performance and energy efficiency intersect in the JVM ecosystem and why GraalVM stands out in this domain.
29 Jan 2025 12:00pm GMT
28 Jan 2025
DZone Java Zone
Using Spring AI to Generate Images With OpenAI's DALL-E 3
Hi, community!
This is my first article in a series of introductions to Spring AI. Today, we will see how we can easily generate pictures using text prompts. To achieve this, we will leverage the OpenAI API and the DALL-E 3 model.
28 Jan 2025 6:00pm GMT
How Apache Flink and Apache Paimon Influence Data Streaming
Apache Paimon is made to function well with constantly flowing data, which is typical of contemporary systems like financial markets, e-commerce sites, and Internet of Things devices. It is a data storage system made to effectively manage massive volumes of data, particularly for systems that deal to analyze data continuously such as streaming data or with changes over time like database updates or deletions.
To put it briefly, Apache Paimon functions similarly to a sophisticated librarian for our data. Whether we are operating a large online business or a little website, it keeps everything organized, updates it as necessary, and ensures that it is always available for use. An essential component of Apache Paimon's ecosystem, Apache Flink is a real-time stream processing framework that significantly expands its capabilities. Let's investigate how well Apache Paimon and Apache Flink work with each other so effectively.
28 Jan 2025 2:00pm GMT
27 Jan 2025
DZone Java Zone
Integrating AI With Spring Boot: A Beginner’s Guide
Do you need to integrate artificial intelligence into your Spring Boot application? Spring AI reduces complexity using abstractions you are used to apply within Spring Boot. Let's dive into the basics in this blog post. Enjoy!
Introduction
Artificial intelligence is not a Python-only party anymore. LangChain4j basically opened the Java toolbox for integrating with AI. Spring AI is the Spring solution for AI integration. It tries to reduce the complexity of integrating AI within a Java application, just like LangChain4j is doing. The difference is that you can use the same abstractions as you are used to apply within Spring Boot.
27 Jan 2025 2:00pm GMT
24 Jan 2025
DZone Java Zone
Multi-Tenancy and Its Improved Support in Hibernate 6.3.0
Multi-tenancy has become an important feature for modern enterprise applications that need to serve multiple clients (tenants) from a single application instance. While an earlier version of Hibernate had support for multi-tenancy, its implementation required significant manual configuration and custom strategies to handle tenant isolation, which resulted in higher complexity and slower processes, especially for applications with a number of tenants.
The latest version of Hibernate 6.3.0, which was released on December 15, 2024, addressed the above limitations with enhanced multi-tenancy support through better tools for tenant identification, schema resolution, and enhanced performance for handling tenant-specific operations. This article talks about how Hibernate 6.3.0 enhanced the traditional multi-tenancy implementation significantly.
24 Jan 2025 12:00pm GMT
23 Jan 2025
DZone Java Zone
Multi-Tenant Data Isolation and Row Level Security
Over the past one and a half years, I was involved in designing and developing a multi-tenant treasury management system. In this article, I will share our approaches to the data isolation aspect of our multi-tenant solution and the learnings from it.
Background and Problem Regarding Data Isolation
Before going into the problem that I will focus on today, I must first give some background into our architecture for storage and data in our system. When it comes to data partitioning for SaaS systems, at the extreme far right end, we have the approach of using dedicated databases for each tenant (silo model), and on the other side of the spectrum is the shared database model (pool model).
23 Jan 2025 6:00pm GMT
20 Jan 2025
DZone Java Zone
Create a Custom Logger to Log Response Details With Playwright Java
While working on the series of tutorial blogs for GET, POST, PUT, PATCH, and DELETE requests for API Automation using Playwright Java. I noticed that there is no logging method provided by the Playwright Java framework to log the requests and responses.
In the REST-assured framework, we have the log().all()
method available that is used for logging the request as well as the response. However, Playwright does not provide any such method. However, Playwright offers a text()
method in the APIResponse
interface that could be well used to extract the response text.
20 Jan 2025 7:00pm GMT
How to Edit a PowerPoint PPTX Document in Java
Building applications for programmatically editing Open Office XML (OOXML) documents like PowerPoint, Excel, and Word has never been easier to accomplish. Depending on the scope of their projects, Java developers can leverage open-source libraries in their code - or plugin-simplified API services - to manipulate content stored and displayed in the OOXML structure.
Introduction
In this article, we'll specifically discuss how PowerPoint Presentation XML (PPTX) files are structured, and we'll learn the basic processes involved in navigating and manipulating PPTX content. We'll transition into talking about a popular open-source Java library for programmatically manipulating PPTX files (specifically, replacing instances of a text string), and we'll subsequently explore a free third-party API solution that can help simplify that process and reduce local memory consumption.
20 Jan 2025 6:00pm GMT
Evolution of Recommendation Systems: From Legacy Rules Engines to Machine Learning
In the world of technology, personalization is the key to keeping users engaged and satisfied. One of the most visible implementations of personalization is through recommendation systems, which provide users with tailored content, products, or experiences based on their interactions and preferences. Historically, the first implementations of recommendation systems were built on legacy rule-based engines like IBM ODM (Operational Decision Manager) and Red Hat JBoss BRMS (Business Rule Management System).
However, recent advances in machine learning have fundamentally changed how recommendations are generated. This article explores how legacy rules-based systems operate, their limitations, and how machine learning has disrupted this space.
20 Jan 2025 5:00pm GMT
14 Jan 2025
DZone Java Zone
Optimizing Java Applications for AWS Lambda
Java has long been a trusted language for enterprise applications due to its versatility and ability to run seamlessly across various platforms, but as serverless platforms like AWS Lambda gain momentum, deploying Java applications in serverless platforms presents unique challenges, notably due to bloated packages and time to get initialized.
This led to an increase in the popularity and adoption of languages such as Go, Node.js, and Python for applications that are traditionally built on Java. When we take a deeper look to understand the inherent struggles that JVM-based applications have, the prominent ones are slow cold starts, high memory consumption, and runtime inefficiencies, making lighter runtimes more attractive in cloud-native environments.
14 Jan 2025 1:00pm GMT
13 Jan 2025
DZone Java Zone
Buildpacks: An Open-Source Alternative to Chainguard
The industry's increasing focus on secure container images is undeniable. Companies like Chainguard - specializing in delivering container images free of CVEs - have demonstrated the demand by recently raising an impressive $140 million at a $1.1 billion valuation. In the open-source ecosystem, Cloud Native Buildpacks, an incubating CNCF project, and their vibrant communities deliver a comparable value proposition by automating the creation of optimized and secure container images.
In this article, I'll explore Buildpack's core concepts, comparing them with Docker to illustrate their functionality and highlight how they provide a community-driven alternative to the value Chainguard brings to container security.
13 Jan 2025 11:00am GMT
07 Jan 2025
DZone Java Zone
How to Test DELETE Requests for API Testing With Playwright Java
API testing has gained a lot of momentum these days. As UI is not involved, it is a lot easier and quicker to test. This is the reason why API testing is considered the first choice for performing end-to-end testing of the system. Integrating the automated API Tests with the CI/CD pipelines allows teams to get faster feedback on the builds.
In this blog, we'll discuss and learn about DELETE API requests and how to handle them using Playwright Java for automation testing, covering the following points:
07 Jan 2025 7:00am GMT
03 Jan 2025
DZone Java Zone
Efficient Asynchronous Processing Using CyclicBarrier and CompletableFuture in Java
In today's world enterprise applications increasingly require the ability to asynchronously process large datasets. The processing of data must correlate and compute results at the same time. This article illustrates how CyclicBarrier and CompletableFuture, combined, perform efficiently in processing and producing desired results from large datasets.
Why to Use Asynchronous Processing?
Asynchronous processing lets tasks run without blocking others. Unlike synchronous processing, which runs tasks in order, it allows multiple tasks to proceed at once. This method is handy for tasks that need to wait for external resources, like network requests. It boosts efficiency and responsiveness in applications.
03 Jan 2025 10:00pm GMT