OnlyJava is your source for Blog Aggregation in the Java industry

Creating Mappers Without Creating Underlying Objects in Java

 Mark As Read    

As most Java developers know, putting values in a Java Map (like a HashMap) involves creating a large number of auxiliary objects under the covers. For example, a HashMap with int keys and long values might, for each entry, create a wrapped Integer, a wrapped Long object, and a Node that holds the former values together with a hash value and a link...

Spring Boot: Exception Handling [Video]

 Mark As Read    

In the video below, we take a closer look at exception handling in Spring Boot. Let's get started!

Spring Boot FreeMarker Tutorial With Example | Spring Boot Tutorial [video]

 Mark As Read    

In the video below, we take a closer look at Spring Boot FreeMarker Tutorial with Example | Spring Boot Tutorial. Let's get started!

Java and Immutability: Making Predictable Applications

 Mark As Read    

What This Article About Immutability is a broad concept and has many angles. Immutability is a set of practices that potentially might reduce the number of bugs in your application. As a consequence, this subject invokes confusion. Here, we review it from a different perspective. I'll explain the most important immutability aspects in clear languag...

Why Programs Fail A Book Review

 Mark As Read    

When I got my new job as a developer advocate, one of the first things I asked for was books. Lots of books. Some of them cover my new job and others talk about debugging. Ive been debugging for decades, but I feel like the theory around debugging is a bit vague. My goal was to bolster the terminology used by academics and peers. A secondary goal i...

A List of Java Cache Providers

 Mark As Read    

Last week, we described several criteria to look at to choose a cache. This week, its time to list Java cache providers based on these criteria. Java Caching System Guava Caffeine Ehcache Infinispan Coherence Community Edition Ignite Geode Hazelcast Java Caching System JCS is a distributed caching system wri...

How to Produce a Spring REST API Following the OpenAPI Specification

 Mark As Read    

The OpenAPI specification defines how to write HTTP APIs that can be consumed by any programming language and provide insight into the APIs functionality without access to source code or documentation. In other words, following the specification makes it easier for consumers to understand what it does and how to use it. Tools, such as Swagger, can ...

Separation of Reactive and Non-Reactive Code

 Mark As Read    

One of the most important distinctions to keep in mind when working with Project Reactor or any other reactive streams implementation is the difference between assembly-time vs. subscription-time in code execution. Regardless of your level of experience with reactive programming, odds are youve already encountered the famous:

Happy Birthday, Abbie!

 Mark As Read    

Our daughter, Abbie, turned 19 this week. She's having a fun freshman year at the University of Colorado in Boulder. She's in the Business and Computer Science Program, has a good attendance record, and sends me Venmo invoices for good grades every couple of weeks. I had a "proud Dad" moment recently when she told me she wanted to learn Python and ...

Raible Designs 873 days ago

From Spring Boot Microservices to Lambda Functions

 Mark As Read    

You may be one of many organisations (or an engineer in one) that operates Java microservices in the cloud with a desire to move towards a serverless architecture, but are unable to justify the steep migration path (e.g. decomposing your services into functions, rewriting in a more suitable language etc.) from those microservices to the likes of AW...

Spring Boot Pet Clinic App: A Performance Study

 Mark As Read    

Spring pet clinic application is a sample application developed by the Spring Framework developers to demonstrate the capabilities of Spring Boot, Spring MVC, and Spring Data Framework. We set out to conduct a performance test on this application and see whether we can identify any performance bottlenecks. Environment Setup We cloned the Spring pet...

See Spring Native in Action With the Okta Spring Boot Starter

 Mark As Read    

The Spring team announced a new experimental Spring Native project in the fall of 2020, which gave Spring developers hope for faster startup times. Converting your Spring apps to native executables is what Spring Native is all about, and it does this by using GraalVM. This was a huge announcement because the new kids on the block, Micronaut, and Qu...

Add gRPC to Your Java Application

 Mark As Read    

gRPC is a high-performance, open-source universal RPC framework.There are various benefits to using gRPC. It simplifies development by providing client/server code. It supports multiple languages. It all starts with defining a .proto file, .proto files reside on src/main/proto file.

Understanding Eclipse's Plugin Build

 Mark As Read    

This article provides a concise definition of the term Eclipse Plugin for the purpose at hand: What Is This Plugin Thing You Are Talking About? When we say 'Plugin' in this article, we mean an OSGi bundle that is running on an Eclipse runtime which has the Equinox Extension Point Registry installed.

Creating More Intuitive Java APIs With Optional

 Mark As Read    

Creating intuitive APIs is a very important skill for you to reduce the chances of bugs and make your software more maintainable. When you dont create intuitive APIs, your code becomes error-prone and the developers (including you) may misuse an API. Lets see an example of a non-intuitive API.

How to Avoid Stalling in Reactive Java Applications

 Mark As Read    

These days, apps must be able to handle high loads and hordes of concurrent users without crashing. One scaling strategy involves increasing the number of available threads, to get around the issue of blocking code in traditional Java apps. When latency comes into play, many of these extra threads become inactive and waste resources. Writing asynch...

The Debugger Checklist Part II

 Mark As Read    

In the Debuggers Checklist Part I, I introduced some of the high-level concepts and reviewed some of the common things you can do. In this part, we'll get down to the process. Again, it's important to stress that this is boiled down and concentrated. Is this thing even working?

Deploy Quarkus applications to Kubernetes using a Helm chart

 Mark As Read    

Serverless functions are driving the fast adoption of DevOps development and deployment practices today. Knative on Kubernetes is one of the most popular serverless platforms to adopt serverless function architectures successfully. But developers must understand how serverless capabilities are specified using a combination of Kubernetes APIs, Knati...

Spring Boot Groovy Console

 Mark As Read    

Observability is a must-have nowadays in modern cloud services. There are multiple levels and options to provide observability into a service. Logging is the basic one but is well used can perform... ...

GroovyBlogs.org 878 days ago

We Should Write Java Code Differently

 Mark As Read    

For the last few years, Im writing articles that describe a new, more functional way to write Java code. But the question of why we should use this new coding style remains largely unanswered. This article is an attempt to fill this gap. Just like any other language, Java evolves over time. So does the style in which Java code is written. Code writ...

Connect to a Database Instance Running Inside a Java Testcontainer Using IntelliJ IDEA

 Mark As Read    

JUnit is one of the most popular unit testing frameworks used with Java to create repeatable tests. With JUnit, each test is written as a separate method inside a Java class. IntelliJ IDEA provides an option to run these test cases from within the IDE. In case you have a module that communicates with a MySQL database, you can unit test the module b...

Deploy a Java application using Helm, Part 2

 Mark As Read    

In the previous article in this series, you learned how to deploy Java applications to Red Hat JBoss Enterprise Application Platform (JBoss EAP) using Helm on Red Hat OpenShift. Developers can use the procedures in Part 1 to easily stand up traditional Java application servers on Kubernetes with predefined Kubernetes manifestos. What if you could h...

Ultra-fast Java In-Memory Database Apps & Microservices with MicroStream

 Mark As Read    

MicroStream is a fundamentally new persistence framework for storing complex Java object graphs natively, which means the object graph is stored on disk as it is in RAM. Vice versa it allows you to load any single subgraph on-demand that is then merged with your object graph in ram automatically. This leads to fantastic benefits: You can use object...

Understanding Spring Boot Project, Spring Initializr, and POM.xml

 Mark As Read    

In the video below, we take a closer look at the understanding Spring Boot project, Spring Initializr, and pom.xml. Let's get started!

HTTP Methods: GET, POST, DELETE and PUT RESTful Web Services With Spring Framework | Spring Boot

 Mark As Read    

In the video below, we take a closer look at HTTP Methods: GET, POST, DELETE and PUT RESTful Web Services with Spring framework | Spring Boot. Let's get started!

RESTful API Example with Spring Data REST

 Mark As Read    

In the video below, we take a closer look at RESTful API Example with Spring Data REST, and JPA Many To Many. Let's get started!

Spocklight: Adjusting Time With MutableClock

 Mark As Read    

Testing classes that work with date calculations based on the current date and time (now) can be difficult. First of all we must make sure our class under test accepts a java.time.Clock instance. This...

GroovyBlogs.org 885 days ago

Why Do We Need Spring Boot? Before Spring Boot and After Spring Boot | Spring Boot Features

 Mark As Read    

In the video below, we take a closer look at why we need Spring Boot. Also, learn about Before Spring boot and After Spring boot | Spring boot features. Let's get started!

The Debugger Checklist Part I

 Mark As Read    

Im a disorganized person by nature. When I follow a process, its by habit and intuition. But when a debugging problem keeps me up at night and gets me to that state of mind where a career of raising sheep in New Zealand seems like an attractive option Thats when I need to back off and walk through this process in an orderly fashion. This process n...

Interesting Application Garbage Collection Patterns

 Mark As Read    

As the author of GCeasy Garbage collection logs analysis tool, I get to see a few interesting Garbage Collection Patterns again and again. Based on the Garbage collection pattern, you can detect the health and performance characteristics of the application instantly. In this post, let me share a few interesting Garbage collection patterns that hav...

How To Copy Files From One Directory to Another in Java: Example

 Mark As Read    

Hello folks. I have been programming in Java for a long time, and you won't believe it, but there was no file copy method in the Java API until Java 7. Our options were either to: write it ourselves using a FileInputStream, a FileOutputStream, and a buffer to copy bytes from one to the other; or, better yet, use the FileChannel.transferTo() method ...

Improving Backend Performance, Part 3/3: Fast Analytics

 Mark As Read    

Analytics involves the computation of data to find patterns. From simple calculations - such as the sum of values or its average to statistics calculated with machine learning algorithms, analytics frequently deals with big amounts of data that need to be processed as fast as possible. We saw in the previous part of this series of articles, how ind...

What Is Ant, Really?

 Mark As Read    

Ant is a bit of a mystery bag. Its behavior is often obscure until you come to look at its code. Then you find that it consists of a number of fairly simple facilities that are often explained from a bottom-up detailed and technical viewpoint and not from a top-down architectural perspective. This article aims to provide the missing top-down view. ...

URL Shortener Complete Tutorial

 Mark As Read    

Introduction A URL shortener is a service that is used to create short links from very long URLs. Usually, short links have the size of one-third or even one-fourth of the original URL, which makes them easier to type, present, or tweet. Clicking on a short link user will be automatically redirected to the original URL. There are many URL shorte...

Building a Metadata Driven UI

 Mark As Read    

Description Metadata-driven UI is especially useful in project teams with a high back-end or DBA competence rather than UI. In general, it provides an element alignment by invocation of a single endpoint which provides all data required like cardinality, language, font size, and the font itself.

Smart Dependency Injection With Spring: Assignability (Part 2 of 3)

 Mark As Read    

Preface The Spring Framework is a very powerful framework and provides first class support for dependency injection (DI). This article is the second one in my series dedicated to dependency injection with Spring Framework. My series is split into these three articles: Basic usage of DI DI with assignability (this article) DI with generics In...

Improving Backend Performance Part 2/3: Using Database Indexes

 Mark As Read    

Database indexes are a concern of the developers. They have the potential to improve the performance of search and filter features that use an SQL query in the backend. In the second part of this series of articles, I'll show the impact that a database index has in speeding up filters using a Java web application developed with Spring Boot and Vaad...

Deploy a Java application using Helm, Part 1

 Mark As Read    

To deploy enterprise Java applications with Red Hat JBoss Enterprise Application Platform (EAP) servers to Red Hat OpenShift, developers have usually needed to learn how to use OpenShift templates or Operators to specify Kubernetes and OpenShift resources such as build config, deployment, volume, environment variables, and application image. This a...

A Java MicroProfile Application for Content Negotiation

 Mark As Read    

An HTTP server can use content negotiation to respond to different clients. Modern clients typically expect a JSON response. At times, a different format is required, such as XML for older clients or binary for newer ones. The process used to manage that challenge, as well as others like coping with numerous languages and even compressing HTTP requ...

Spring Boot File Upload Example With MultipartFile | Spring Boot Tutorial

 Mark As Read    

In the video below, we take a closer look at the Spring Boot file upload example with MultipartFile | Spring Boot Tutorial. Let's get started!

Spring Boot: @ConfigurationProperties, Property Validation Example

 Mark As Read    

In the video below, we take a closer look at Spring Boot @ConfigurationProperties, Property validation example. Let's get started!

How to Export All Modules to All Modules at Runtime in Java

 Mark As Read    

Due to the new module system, Java 9 does not allow an application by default to see all classes from the JDK, unlike all previous versions of Java. If we try to access some reserved module, we obtain an error like this:module <module-name> does not "opens <package-name>" to unnamed module. Everyone knows that we can solve this exceptio...

Making Parameters Optional or Required in RESTful Web Services With Spring Framework | Spring Boot

 Mark As Read    

In the video below, we take a closer look at making parameters optional or required - RESTful Web Services with Spring framework | Spring Boot. Let's get started!

Kotlin and FaaS, An Impossible Union?

 Mark As Read    

Some time ago, I read a post describing how to run a serverless Kotlin function on OpenFaaS. While the content is technically correct, I believe the concept itself is very wrong. Such posts can lead people to make ill-advised decisions: "because we can" is hardly a winning strategy. In this post, I'd like to first explain why the JVM platform is a ...

Stealing Data and Source Code From Java Application

 Mark As Read    

Attack Scenarios In this article, we review possible ways how to inject malware code in JVM/to sniff JVMs traffic/etc. The key objective of this article is to explain how to protect your application. The plan is to perform the next attacks: Read sensitive data from the dump. Steal source code by injecting malware in an external dependency. S...

Returning Object as JSON or XML Representation - RESTful Web Services With Spring Boot

 Mark As Read    

In the video below, we take a closer look at returning objects as JSON or XML representation - RESTful Web Services with Spring Boot. Let's get started!

Externalize Application Configuration With Spring Cloud Config

 Mark As Read    

Introduction One of the principles from the 12 Factor App, states that we have to separate our application configuration from the code. The configuration varies based on the environment and it's better to organize them based on the environment your application is running. So in this article, we will be looking at how we can externalize configurati...

How to Use Pattern Matching for instanceof From JDK16

 Mark As Read    

The new LTS version (version 17) of Java was released in September. And since the previous LTS (version 11), many cool features were added. One of the coolest ones is Pattern Matching for instanceof. Until Java 15, when we checked whether an object is an instance of a particular class, the compiler didnt infer the variables type, even if the object...

Allow Google Account Sign Ins Without a GMS Phone

 Mark As Read    

If users have not installed GMS on their phones, they cannot directly sign in to your app using a Google account. In this case, you can let them sign in to your app in web mode by obtaining the access token for sign-in authentication from Google. The procedure is as follows: Sign in to the Google Play Console, click Credentials, and create an OAuth...

Fluent Assertions Reloaded

 Mark As Read    

If youre not using fluent assertions in your tests yet and just rely on basic JUnit assertions, you might be missing out on a simple but very effective tool to write high-quality test code. The article starts with a short recap about the virtues of fluent assertions and how they address the shortcomings of basic assertions. But while very much in f...

Java
Welcome!
OnlyJava aggregates blogs for the Java industry.
Custom Feeds
Add any RSS feed to the information you read daily.
Blocked Feeds
Block feeds to remove blogs you’re not interested in.
Account Settings
Customize the site by adding or removing feeds.

About Us

OnlyJava is your source for all your Java news.

Have a Suggestion for Us?
Know of a Java blog that we're missing? Let us know!

Share OnlyJava.com